API promemoria
API Annulla promemoria
Ferma un promemoria ricorrente in modo che non venga più eseguito. Usala quando un cliente paga, un abbonamento termina o un'automazione non serve più.
https://wbiztool.com/api/v1/reminder/cancel/Corpo: JSON o campi di un modulo
Ti serve il reminder_id restituito da Crea promemoria. Se non lo hai, trovalo con Elenca promemoria.
Esempio rapido#
curl -X POST https://wbiztool.com/api/v1/reminder/cancel/ \
-H "Content-Type: application/json" \
-d '{
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"reminder_id": "3187"
}'import requests
reminder_id = 3187
response = requests.post(
"https://wbiztool.com/api/v1/reminder/cancel/",
json={
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"reminder_id": str(reminder_id), # must be a string in JSON
},
timeout=60,
)
try:
result = response.json() # read the body even when the HTTP code is 400 or 404
except ValueError:
raise SystemExit(f"HTTP {response.status_code}: not JSON. Check that your api_key exists.")
if result["status"] == 1:
print("Reminder cancelled")
else:
print("Failed:", result["message"])// Node.js 18+ (built-in fetch). Save as .mjs to use top-level await.
const reminderId = 3187;
const response = await fetch("https://wbiztool.com/api/v1/reminder/cancel/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
client_id: 12345,
api_key: "YOUR_API_KEY",
reminder_id: String(reminderId), // must be a string in JSON
}),
});
// Read the body even when the HTTP code is 400 or 404. A non-JSON reply means the request crashed.
const text = await response.text();
let result;
try {
result = JSON.parse(text);
} catch {
throw new Error(`HTTP ${response.status}: not JSON. Check your api_key and send reminder_id as a string.`);
}
if (result.status === 1) {
console.log("Reminder cancelled");
} else {
console.error("Failed:", result.message);
}<?php
$payload = [
'client_id' => 12345,
'api_key' => 'YOUR_API_KEY',
'reminder_id' => (string) 3187, // must be a string in JSON
];
$ch = curl_init('https://wbiztool.com/api/v1/reminder/cancel/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
]);
$result = json_decode(curl_exec($ch), true);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($result === null) {
echo "HTTP $httpCode: not JSON. Check your api_key and send reminder_id as a string.";
} elseif ($result['status'] === 1) {
echo 'Reminder cancelled';
} else {
echo 'Failed: ' . $result['message'];
}Sostituisci 12345 e YOUR_API_KEY con i tuoi valori. Consulta Autenticazione per sapere dove trovarli.
Parametri della richiesta#
client_idintegerobbligatorioIl tuo ID Client API, da Impostazioni → Chiavi API.
api_keystringobbligatorioLa tua chiave API, dalla stessa pagina.
reminder_idstringobbligatorioID del promemoria da annullare, come restituito da Crea promemoria o Elenca promemoria. Deve appartenere allo stesso spazio di lavoro della chiave API.
Inviare campi di un modulo evita il problema, perché ogni valore di un modulo è una stringa:
curl -X POST https://wbiztool.com/api/v1/reminder/cancel/ \
-d client_id=12345 \
-d api_key=YOUR_API_KEY \
-d reminder_id=3187
Risposta#
Una richiesta riuscita restituisce HTTP 200:
{
"message": "Reminder cancelled successfully",
"status": 1
}
| Campo | Tipo | Descrizione |
|---|---|---|
status | integer | 1 se il promemoria è stato annullato, 0 se la richiesta non è riuscita. |
message | string | Reminder cancelled successfully, altrimenti l'errore. |
Errori#
Gli errori restituiscono HTTP 400 con status impostato su 0, salvo dove indicato:
{ "status": 0, "message": "Reminder not found" }
| Messaggio | Come risolvere |
|---|---|
Invalid JSON format: … | Il corpo JSON non è valido. Ricevi questo errore anche per una richiesta con campi di un modulo senza client_id, o per qualsiasi richiesta GET. |
Reminder ID cannot be null | Aggiungi reminder_id. |
Auth Error - Please send correct API key and Client id | Invia sia client_id sia api_key. |
Invalid client id | Invia client_id come numero. |
Invalid reminder id | reminder_id deve essere un numero intero, come 3187. |
Auth Error: invalid api key | La chiave appartiene a un altro client_id. |
Auth Error: please check client id | La chiave non è associata a uno spazio di lavoro. Crea una nuova chiave nello spazio di lavoro che vuoi usare. |
Demo Account cannot access APIs | Usa un account normale. |
Upgrade your plan to use reminders feature | Il tuo piano non include i promemoria. I promemoria creati in precedenza continuano a essere eseguiti e a consumare crediti, e non possono essere annullati né messi in pausa, né tramite l'API né dalla dashboard, finché non passi a un piano superiore. |
Reminder not found (HTTP 404) | L'ID non esiste, è in un altro spazio di lavoro oppure il promemoria è già stato annullato. |
Error cancelling reminder: … (HTTP 500) | Si è verificato un problema da parte nostra. Riprova. |
Se l'api_key non esiste o è stata eliminata, la risposta è una pagina di errore HTML con HTTP 500 invece di JSON. Prova la tua chiave con Verifica credenziali.
Cosa comporta l'annullamento#
- Il promemoria si ferma immediatamente e non verrà più eseguito. Si possono annullare anche i promemoria in pausa.
- Scompare da Elenca promemoria e dalla pagina Promemoria.
- Un promemoria annullato non può essere ripristinato. Per ricominciare, crea un nuovo promemoria.
- Un messaggio che il promemoria aveva già messo in coda prima dell'annullamento non viene rimosso e potrebbe comunque essere inviato.
Suggerimenti#
- Annullare due volte restituisce
Reminder not found. Se ritenti le richieste, interpreta quel messaggio come «già annullato». - Mettere in pausa non è possibile tramite l'API. Per fermare temporaneamente un promemoria, mettilo in pausa nella pagina Promemoria.
- Modificare una pianificazione: non esiste un'API di aggiornamento. Annulla il promemoria e creane uno nuovo con la nuova
cron_expression.
