Einen Batch abbrechen
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": "Ungültiger oder fehlender API-Schlüssel",
"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 nicht gefunden",
"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": "Ressourcenkonflikt",
"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": "Interner Serverfehler",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}Chargen
Batch abbrechen
Stoppt die Bearbeitung der in der Warteschlange befindlichen Elemente eines Batches. Elemente, die bereits laufen, können dennoch fertiggestellt werden.
POST
/
v1
/
batches
/
{batch_id}
/
cancel
Einen Batch abbrechen
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": "Ungültiger oder fehlender API-Schlüssel",
"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 nicht gefunden",
"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": "Ressourcenkonflikt",
"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": "Interner Serverfehler",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}Den Tippfehler direkt nach dem Absenden bemerkt? Das passiert den Besten. Brich den Batch ab, und du zahlst nur für die Elemente, die erfolgreich abgeschlossen werden.
- Bereits abgeschlossen: Abgerechnet. Diese Ergebnisse sind fertig und warten auf dich.
- Noch in der Warteschlange: Nie ausgeführt, nie abgerechnet. Hier liegen die Einsparungen.
- Gerade in Bearbeitung: Du zahlst nur für erfolgreiche Elemente, wie gewohnt.
Nach dem Abbrechen: Der Batch kann weiterhin als
in_progress angezeigt werden, bis die laufenden Elemente abgeschlossen sind oder ablaufen. Überprüfe den Fortschritt mit Batch Info. Das Abbrechen kann sicher erneut für denselben Batch aufgerufen werden.Autorisierungen
Antwort
Abbruchzusammenfassung für den gesamten Batch.
War diese Seite hilfreich?