Testing the API

Testing the API

Testing the API

Use these approaches to explore the Chatway API safely before wiring it into production.

Try It in the docs

Each endpoint under API Reference includes a Try It panel. Enter your API key in the Auth section (X-API-KEY), fill in any path or query parameters, and send the request directly from the browser.

Try It sends requests to the same base URL shown in the docs server selector, so you can confirm authentication, request shape, and response structure without writing code first.

Try It sends real requests to the selected server. Start with GET /widgets, which only reads data. Use records reserved for testing before trying writes: those requests can change contacts, send messages or invite teammates. Naming a key “test” does not make its requests a simulation.

Test with curl

Copy any endpoint example and run it from your terminal:

curl -X GET "https://developers.chatway.app/api/v1/contacts" \
  -H "X-API-KEY: your_api_key" \
  -H "Accept: application/json"

Replace method, path, and body to match the operation you are testing. A 401 usually means a missing or invalid key; 422 means the payload or query string failed validation.

Confirm authentication

Run a simple read-only call such as GET /contacts or GET /widgets:

  • 200: key is valid and the request succeeded.
  • 401: key is missing, malformed, or revoked.
  • 403: key is valid but the requested action is not permitted for this account or resource.

Test write operations carefully

Before calling endpoints that create or update data (POST /messages, POST /contacts/initialize, POST /conversations/{id}/resolve, and similar):

  1. Choose test records and copy their IDs from the relevant list endpoint.
  2. Check the required fields and intended effect before sending one request. Use a conversation whose recipient expects test messages.
  3. Save the returned status and resource ID.
  4. Verify contact changes with Get Chat Contact, messages with List Conversation Messages, and status changes with List Conversations.
  5. If the request times out, check the result before sending it again. A missing response does not prove that the write failed.

Test webhooks locally

Webhooks are delivered to your server, not to the Chatway API. To test the full receive-and-reply flow locally:

  1. Expose your local webhook handler through an HTTPS tunnel, such as ngrok. An inspection service such as webhook.site can display deliveries, but does not run your local verification or reply code. Use synthetic messages when testing with an external inspection service.
  2. Register that URL under Settings → Developer Tools → Webhooks and subscribe to message.received.
  3. Send a test visitor message in your Chatway widget.
  4. Verify your endpoint receives the signed JSON envelope and returns a 2xx response within 4 seconds.
  5. Reply using POST /messages with conversation_id from data.conversation.id in the webhook and an agent_id from GET /agents (see Quickstart → Receive a message and send a reply).

See Webhook docs → Overview for header and signature verification details.

Suggested smoke-test checklist

StepRequestExpected
AuthGET /widgets with X-API-KEY200 and widget list
Reply flowReceive message.received, then POST /messages with data.conversation.id and agent_idWebhook 2xx, reply 201
ContactsGET /contacts200 and paginated contacts
ConversationsGET /conversations/all200 and conversation list
MessagesGET /conversations/{id}/messages200 for a valid conversation ID
Rate-limit handlingSimulate a 429 response in your client tests, both with and without Retry-After.The client waits before retrying and stops after its configured retry limit.

When something fails

Capture the HTTP status, response body, UTC timestamp, and the exact method + path. See Customer support if you need help from the Chatway team.

get/guides/testing-the-api

Request

  • Base URL: https://developers.chatway.app/api/v1
  • URL: https://developers.chatway.app/api/v1/guides/testing-the-api
  • Auth: none required

Response

Documentation.

Changes

No recorded changes to this operation across all 1 revision of this API.