Pingtochat Docs

Pingtochat Docs

Did You Know?

Docy turns out that context is a key part of learning.

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

Message without parameter

Estimated reading: 2 minutes 73 views

Description:

Send a basic template message without any parameters.

Endpoint:

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

Replace the placeholders:

  • {{your_domain}}: Your API domain.
  • {{phone_number_id}}: The ID linked to your WhatsApp Business API number.
  • {{key}}: Your API key for authentication.How to create key

Method:

POST

Headers:

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

Example :

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

Field Descriptions:

  1. messaging_product: Always "whatsapp" for WhatsApp messaging.
  2. recipient_type: "individual" for single-user messages.
  3. to: Recipient’s phone number in E.164 format (e.g., 91xxxxxxxxxx for an Indian number).
  4. type: "template" for template messages.
  5. template: Contains details about the template:
    • name: Name of the pre-approved template (marketing_newyear in this case).
    • language: Specifies the language code.
      • code: Language code for the template (e.g., en for English).
    • components: An array for dynamic content or interactive elements (leave empty for simple messages).

Example Response

When the API processes the request successfully, it returns a response similar to this:

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

Response Details:

  • contacts:
    • input: The phone number you provided in the to field.
    • wa_id: WhatsApp ID of the recipient.
    • status_id: A unique identifier for the status of this contact.
  • messages:
    • id: A unique ID for the message.
    • message_status: Status of the message (e.g., "accepted").

Sample View:

Hi welcome to 2025

Sample codes

Leave a Comment

Share this Doc

Message without parameter

Or copy link

CONTENTS