Whats91
Developers

Review Meta-compatible response shapes, validation rules, and error codes.

Meta-Compatible Responses and Errors

Summary

Review Meta-compatible response shapes, validation rules, and error codes.

Prerequisites

  • A Whats91 account
  • A generated public API token

Success Response

200 OK
{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "918888888888",
      "wa_id": "918888888888"
    }
  ],
  "messages": [
    {
      "id": "wamid.xxxxx"
    }
  ],
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}

The response keeps the Meta-compatible messaging_product, contacts, and messages shape, with Whats91 metadata added for tracing.

Validation Rules

  • Authorization: Bearer or JSON auth token fields are required.
  • The request body must be JSON.
  • to is required.
  • type defaults to text when omitted.
  • A supplied type requires its matching object.
  • Number-scoped tokens can only use their assigned phoneNumberId.

Error Codes

HTTPError codeMeaning
401MISSING_BEARER_TOKENMissing public API token.
401INVALID_PUBLIC_API_TOKENInvalid, expired, revoked, or inactive token.
403SENDER_NOT_ALLOWEDNumber-scoped token requested another sender.
404PHONE_NUMBER_NOT_FOUNDPath phoneNumberId is not connected to the authenticated customer.
400MISSING_TOto is missing.
400MISSING_TYPE_OBJECTPayload type requires a matching object.
400UNSUPPORTED_MESSAGE_TYPEUnsupported Meta-compatible message type.
415UNSUPPORTED_CONTENT_TYPERequest is not JSON.
Error response
{
  "error": {
    "message": "Missing required parameter: to",
    "type": "Whats91PublicApiException",
    "code": "MISSING_TO"
  },
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}

Related Documentation