Pingtochat Docs

Pingtochat Docs

Did You Know?

You can create any type of product documentation with Docy

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

Parameter with button

Estimated reading: 2 minutes 64 views

This API enables you to send WhatsApp authentication template messages using the provided template configuration. The messages are sent to individual recipients using a specific template ID, phone number ID, and API key.

Request Format

HTTP Method
  • POST
API Version
  • V1.0

Request URL

http://{{your_domain}}/api/v1.0/{{phone_number_id}}/{{key}}/messages

Replace placeholders:

  • {{your_domain}}: Your domain URL where the API is hosted.
  • {{phone_number_id}}: The unique identifier of the phone number used for sending messages.
  • {{key}}: Your API key for authentication.How to create key

Request Body

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "91xxxxxxxxxx",
  "bulk_id":"12345",
  "type": "template",
  "template": {
    "name": "authentication_template",
    "language": {
      "code": "en"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "958625"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "url",
        "index": "0",
        "parameters": [
          {
            "type": "text",
            "text": "958625"
          }
        ]
      }
    ]
  }
}

Response

Success Response

HTTP Status Code: 200 OK

Sample Response:

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

Message Sample View

958625 is your verification code. For your security, do not share this code.

Field Descriptions

Root-Level Fields

FieldTypeDescription
messaging_productstringMust be whatsapp. Identifies the messaging platform being used.
recipient_typestringMust be individual. Specifies the type of recipient.
tostringThe recipient’s phone number in E.164 format (e.g., 91xxxxxxxxxx).
typestringMust be template. Specifies the type of message being sent.

Template-Level Fields

FieldTypeDescription
nameStringName of the template. For example, "otp_message".
languageObjectSpecifies the language of the template.
componentsArrayContains the components of the message (body, buttons).

Notes

  1. Ensure the template name matches an approved template in your WhatsApp Business Account.
  2. The phone number must be in E.164 format (e.g., 91xxxxxxxxxx for Indian numbers).
  3. Language codes must follow ISO 639-1 standards.

Sample codes

Leave a Comment

Share this Doc

Parameter with button

Or copy link

CONTENTS