Annulla un 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": "Chiave API non valida o mancante",
"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 non trovato",
"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": "Conflitto di risorse",
"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": "Errore Interno del Server",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}Lotti
Annulla Batch
Interrompe il lavoro sugli elementi in coda di un batch. Gli elementi già in esecuzione potrebbero comunque terminare.
POST
/
v1
/
batches
/
{batch_id}
/
cancel
Annulla un 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": "Chiave API non valida o mancante",
"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 non trovato",
"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": "Conflitto di risorse",
"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": "Errore Interno del Server",
"detail": "An unexpected error occurred",
"created": 1704067200,
"metadata": {}
}Hai notato l’errore di battitura subito dopo aver inviato? Succede anche ai migliori. Annulla il batch e paghi solo per gli elementi che completano con successo.
- Già completati: Fatturati. Questi risultati sono pronti e ti aspettano.
- Ancora in coda: Mai eseguiti, mai fatturati. Qui risiedono i risparmi.
- Attualmente in esecuzione: Paghi solo per gli elementi di successo, come al solito.
Dopo aver annullato: Il batch può ancora mostrare
in_progress fino a quando gli elementi in esecuzione non terminano o scadono. Controlla i progressi con Batch Info. È sicuro richiamare di nuovo Annulla sullo stesso batch.Autorizzazioni
Risposta
Riepilogo dell'annullamento per l'intero batch.
Questa pagina è stata utile?