Branch on: HTTP status and code ·
Diagnostics: Safe identifiers ·
Write recovery: Read current state
The important part
- A response can be missing, incomplete or non-JSON; keep a fallback parser.
- A 2xx response can accept background work without completing it.
- Never replay a copied write merely to reproduce an error.
The error object
Documented API errors use this envelope. Treatmessage as explanatory text, not a stable program interface. Infrastructure failures can return a different body, so parsing must have a fallback.
Error types
Status codes
Treat transport success and business completion separately. A Knowledge job can return HTTP 200 withstate:failed. HTTP 202 means work was accepted. A call’s 201 response proves acceptance, not that someone answered. The exact operation page defines each result.
Common errors
The Web agent endpoint is different
The installed widget has its own visitor-facing response contract. Do not apply a blanket “every widget response is HTTP 200” rule or invent a public widget endpoint from a dashboard URL. Use the current generated installation and preserve its unavailable state. The supported account settings API is documented under Web agent settings.Debugging with request IDs
When a response supplies a request identifier, retain it with the time, method, route template, status and machine code. An outboundrequest_id, a call ID and a diagnostic request header are different identifiers.
Do not record the full Bearer header, contact details, booking payload, recording URL or private connection credentials in a general log. A safe support report should describe the expected and observed result and include only the relevant identifiers through an authorised support channel.
Handling errors well
- Preserve the original operation record before investigating.
- Classify the response using the endpoint’s documented result and refusal rules.
- Read the existing resource, job or request journal when a write is uncertain.
- Make another write only after a deliberate decision that follows that operation’s contract.