Pcornel
Automation · APIs

API Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=5317

Back to the Topic

Answer

Evidence-first isolation of API failures from caller and endpoint selection through transport, authentication, request contract, server processing and target verification.

Remember

  • Symptom ≠ root cause; an HTTP error can be downstream of DNS, TLS, auth, schema, policy or application state.
  • Works in browser/tool ≠ automation works; identity, headers, proxy, environment and serialization can differ.
  • Retry success ≠ root cause fixed; transient recovery can hide quota, race or backend instability.
  • 2xx after change ≠ incident resolved; the original target outcome and regressions must be verified.

First checks

  • curl -v <url> — full exchange
  • Error body and request ID — details
  • Compare with API docs/examples — correctness

Commands

curl -sS -D - -o /dev/null <url>
Read-only/validation observation for HTTP/TLS/connectivity status and response headers from a documented read-only endp…
curl -v

Verify in this order

DNS/TLS → auth → request validation → server → response

Where it usually breaks

A changed status code or one successful retry proves only that the observed path changed; root cause remains open until the first failed boundary is explained and the target outcome is stable.

Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.

API Troubleshooting API boundary map

BoundaryHealthy evidenceSuspicious evidence
Caller / requestEnvironment/version, identity and exact request contract are attributableHidden defaults, wrong endpoint/version, leaked or mismatched credentials
Server / responseStatus, headers, structured body and request ID are interpreted togetherStatus-only handling, ignored error body, ambiguous async result or unsafe retry
State / proofWrite result is reconciled with resource read-back or acceptance testResponse success treated as final target success without verification
TroubleshootingFirst failed boundary is preserved, changed minimally and retestedBlind retries, credential rotation, replay or payload edits before evidence is captured

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5317

Confirmation

Confirm action

Continue?