Annuleer een batch
curl --request POST \
--url https://api.olostep.com/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.olostep.com/v1/batches/{batch_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.olostep.com/v1/batches/{batch_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olostep.com/v1/batches/{batch_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/batches/{batch_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/batches/{batch_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/batches/{batch_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total_count": 100,
"done_count": 12,
"in_flight_count": 3,
"canceled_count": 87
}{
"id": "error_abc123",
"object": "error",
"code": "invalid_api_key",
"type": "https://docs.olostep.com/errors/invalid_api_key",
"status": 401,
"title": "Ongeldige of ontbrekende API-sleutel",
"detail": "The provided API key is invalid.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "not_found",
"type": "https://docs.olostep.com/errors/not_found",
"status": 404,
"title": "batch niet gevonden",
"detail": "No batch with id 'YOUR_BATCH_ID' exists for your team.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "resource_conflict",
"type": "https://docs.olostep.com/errors/resource_conflict",
"status": 409,
"title": "Hulpbronconflict",
"detail": "The batch deadline has passed.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "internal_server_error",
"type": "https://docs.olostep.com/api-reference/errors/internal_error",
"status": 500,
"title": "Interne Serverfout",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}Partijen
Batch Annuleren
Stopt het werk aan de items in de wachtrij van een batch. Items die al draaien, kunnen nog steeds voltooid worden.
POST
/
v1
/
batches
/
{batch_id}
/
cancel
Annuleer een batch
curl --request POST \
--url https://api.olostep.com/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.olostep.com/v1/batches/{batch_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.olostep.com/v1/batches/{batch_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olostep.com/v1/batches/{batch_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/batches/{batch_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/batches/{batch_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/batches/{batch_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total_count": 100,
"done_count": 12,
"in_flight_count": 3,
"canceled_count": 87
}{
"id": "error_abc123",
"object": "error",
"code": "invalid_api_key",
"type": "https://docs.olostep.com/errors/invalid_api_key",
"status": 401,
"title": "Ongeldige of ontbrekende API-sleutel",
"detail": "The provided API key is invalid.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "not_found",
"type": "https://docs.olostep.com/errors/not_found",
"status": 404,
"title": "batch niet gevonden",
"detail": "No batch with id 'YOUR_BATCH_ID' exists for your team.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "resource_conflict",
"type": "https://docs.olostep.com/errors/resource_conflict",
"status": 409,
"title": "Hulpbronconflict",
"detail": "The batch deadline has passed.",
"created": 1704067200,
"metadata": {}
}{
"id": "error_abc123",
"object": "error",
"code": "internal_server_error",
"type": "https://docs.olostep.com/api-reference/errors/internal_error",
"status": 500,
"title": "Interne Serverfout",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}Heb je de typfout ontdekt net nadat je op verzenden hebt gedrukt? Het overkomt de besten van ons. Annuleer de batch en je betaalt alleen voor items die succesvol worden voltooid.
- Al voltooid: Gefactureerd. Deze resultaten zijn klaar en wachten op je.
- Nog in de wachtrij: Nooit uitgevoerd, nooit gefactureerd. Hier zit de besparing.
- Nu aan het draaien: Je betaalt alleen voor succesvolle items, zoals gewoonlijk.
Na annulering: De batch kan nog steeds
in_progress tonen totdat de draaiende items voltooid zijn of een time-out hebben. Controleer de voortgang met Batch Info. Annuleren kan veilig opnieuw worden aangeroepen op dezelfde batch.Autorisaties
Respons
Annuleer samenvatting voor de hele batch.
Was deze pagina nuttig?