sxsphinxstack

Skills / Working / Test an api integration

Working Code skill

Test an api integration

Test an API integration across contract, authentication, state, retries, errors, limits, observability, and cleanup.

Exercise the integration as a stateful conversation, not a single happy request. Prove how it behaves when either side is slow, unavailable, duplicated, changed, or only partly successful.

Inputs

  • Gather the versioned contract, consumer behavior, provider environment, credentials, quotas, webhooks, and support path.
  • Identify side effects, idempotency, pagination, async jobs, eventual consistency, retries, and data retention.
  • Prepare a sandbox or approved isolated account with synthetic data.

Procedure

  1. Record the supported contract version, permissions, endpoints, events, and expected state transitions.
  2. Verify authentication, authorization, expiration, rotation, and least-privilege failure behavior.
  3. Test representative valid requests and reconcile consumer and provider state.
  4. Exercise invalid input, missing permission, conflict, not found, and version mismatch.
  5. Simulate timeout, rate limit, provider error, dropped response, delayed webhook, and duplicate delivery.
  6. Verify idempotency, retry backoff, pagination, ordering, deduplication, and reconciliation.
  7. Check logs, metrics, correlation identifiers, alerts, and privacy-safe diagnostic context.
  8. Test schema additions and removals against the consumer's parsing behavior.
  9. Clean up test resources and confirm no credentials or synthetic records leak.
  10. Save a contract test report with failures, owners, and release decision.

Boundaries

Never test destructive or billable operations against production without explicit approval. Do not store real credentials or customer payloads in fixtures and logs. Respect provider rate limits and terms.