Pingtochat Docs

Pingtochat Docs

Did You Know?

We design Docy for the readers, optimizing not for page views or engagement

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

No parameter with header-text and body and footer

Estimated reading: 2 minutes 72 views

Endpoint:

POST http://{{your_domain}}/api/v1.0/{{phone_number_id}}/{{key}}/messages
Replace the placeholders:

{{key}}: Your API key for authentication.How to create key

{{your_domain}}: Your API domain.

{{phone_number_id}}: The ID linked to your WhatsApp Business API number.

Headers:

  • Content-Type: application/json
  • Authorization: Bearer <your_access_token>

Example Payload:

{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "91xxxxxxxxxx",
    "type": "template",
    "template": {
        "name": "utility_g",
        "language": {
            "code": "en_us"
        },
        "components": [
            
        ]
    }
}

6. Key Components in the Payload

messaging_product

  • Type: String
  • Description: Specifies the messaging platform. Always set to "whatsapp".

recipient_type

  • Type: String
  • Description: Defines the recipient type. Use "individual" for one-on-one messaging.

to

  • Type: String
  • Description: The recipient’s WhatsApp number in international format (e.g., "91xxxxxxxxxx").

type

  • Type: String
  • Description: Defines the type of message. Always set to "template".

template.name

  • Type: String
  • Description: Specifies the pre-approved WhatsApp template name. In this case, it is "utility_g".

template.language.code

  • Type: String
  • Description: Language code for the template. The value should match the approved template settings.
  • Example: "en_us" for English (United States).

components

  • Type: Array
  • Description: This field is empty ([]) since the utility_g template does not include any dynamic content.

7. Expected API Response

When the request is successful, the API will return an HTTP 200 OK status along with the following JSON response:

{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "91xxxxxxxxxx",
      "wa_id": "91xxxxxxxxxx",
      "status_id": "NTg0MTc="
    }
  ],
  "messages": [
    {
      "id": "M2s4da2y4P",
      "message_status": "accepted"
    }
  ]
}

Response Field Descriptions

messaging_product

  • Type: String
  • Description: Always returns "whatsapp" to indicate the platform.

contacts

  • Type: Array
  • Description: Contains recipient details.

Fields within contacts:

  • input: The phone number used in the API request.
  • wa_id: WhatsApp ID linked to the phone number.
  • status_id: A unique identifier representing the status of the message.

messages

  • Type: Array
  • Description: Contains information about the sent message.

Fields within messages:

  • id: A unique message identifier.
  • message_status: Indicates the status of the message processing.
    • "accepted" – The message was successfully processed.

Sample codes

Leave a Comment

Share this Doc

No parameter with header-text and body and footer

Or copy link

CONTENTS