Pingtochat Docs

Pingtochat Docs

Did You Know?

Advanced visual search system powered by Ajax

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

No parameter with header-text and body and button quick-replay and visit-website

Estimated reading: 3 minutes 71 views

PingtoChat’s Marketing Category enables businesses to send pre-approved WhatsApp template messages through the WhatsApp Business API. The supported message types include:

  1. Messages Without Parameters
  2. Messages With Parameters
  3. Messages With Parameters and Attachments
  4. Messages With Buttons (Quick Reply, URL)

For URL buttons, they do not need to be included in the example payload request.

Description:

A basic template message without dynamic parameters.

Endpoint:

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

Method:

POST

Headers:

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

Example Payload:

{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "91xxxxxxxxxxx",
    "type": "template",
    "template": {
        "name": "marketing_i",
        "language": {
            "code": "en_us"
        },
        "components": [
            {
                "type": "button",
                "sub_type": "quick_reply",
                "index": 0,
                "parameters": [
                    {
                        "type": "text",
                        "text": "Unsubscribe from Promos"
                    }
                ]
            }
        ]
    }
}

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., "91xxxxxxxxxxx").

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 "marketing_i".

template.language.code

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

components

  • Type: Array
  • Description: Defines the interactive elements in the template.

1. Quick Reply Button

  • Type: button
  • Description: Adds an interactive Quick Reply button.
sub_type
  • Value: "quick_reply"
  • Description: Defines the button as a Quick Reply.
    • "quick_reply": Provides a predefined response option.
index
  • Type: Integer
  • Description: Position of the button in the template.
    • "0": The first button.
parameters
  • Type: Array
  • Description: Defines the button text.
    • text: "Unsubscribe from Promos"

Response

If the request is successful, the API returns a 200 OK response with the following JSON structure:

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

Response Field Descriptions

messaging_product

  • Type: String
  • Description: Always returns "whatsapp".

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 for message status.

messages

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

Fields within messages:

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

Sample codes

Leave a Comment

Share this Doc

No parameter with header-text and body and button quick-replay and visit-website

Or copy link

CONTENTS