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

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

Estimated reading: 3 minutes 69 views

Create a Template

Endpoint

http://{{your_domain}}/api/v1.0/{{phone_number_id}}/{{key}}/message_templates
  • {{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 Headers

  • Authorization: Bearer token for authentication.
  • Content-Type: Should be set to application/json.

Request Body

{
  "name": "edit_g",
  "language": "en_US",
  "category": "MARKETING",
  "allow_category_change": true,
  "components": [
        {
        "type": "HEADER",
        "format": "TEXT",
        "text": "Our summer sale is on!"
        },
        {
        "type": "BODY",
        "text": "Shop now  and use code CR7000 to get more offer"
        },
        {
        "type": "FOOTER",
        "text": "Thank you for choosing us!"
        },
        {
        "type":"BUTTONS",
        "buttons": [
                {
                "type": "QUICK_REPLY",
                "text": "Unsubscribe from Promos"
                },
                {
                "type": "url",
                "text": "Go to link",
                "url": "https://urwallet.pingtochat.com"
                },
                {
                "type": "PHONE_NUMBER",
                "text": "Call",
                "phone_number": "919526986676"
                } 
            ]
        }
    ]
}

Parameters

  • name (string, required) – The name of the template.
  • language (string, required) – Language code of the template (e.g., “en_US”).
  • category (string, required) – The category of the template (e.g., “MARKETING”).
  • allow_category_change (boolean, optional) – Determines whether the category can be changed.
  • components(array, required) – List of components in the template.
    • type (string, required) – Type of component (e.g., “HEADER”, “BODY”, “FOOTER”, “BUTTONS”).
    • format (string, optional) – Format type for the HEADER component (e.g., “TEXT”).
    • text (string, required for HEADER, BODY, FOOTER) – The actual text content of the component.
    • buttons(array, optional) – List of buttons in the BUTTONS component.
      • type (string, required) – Type of button (e.g., “QUICK_REPLY”, “url”, “PHONE_NUMBER”).
      • text (string, required) – The button label.
      • url (string, required for url button) – The link to redirect users.
      • phone_number (string, required for PHONE_NUMBER button) – The phone number for calling action.

Success Response

Status Code: 201 APPROVED

{
    "id": "xxxxxx",
    "status": "APPROVED",
    "category": "MARKETING"
}

Edit an Existing Template

Endpoint

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

Request Body

{
    "components": [
        {
            "type": "HEADER",
            "format": "TEXT",
            "text": "Our summer sale is on in Urwallet!"
        },
        {
            "type": "BODY",
            "text": "We are introducing our new product in Urwallet!"
        },
        {
            "type": "FOOTER",
            "text": "Thank you for choosing Urwallet!"
        },
        {
        "type":"BUTTONS",
        "buttons": [
                {
                "type": "QUICK_REPLY",
                "text": "Unsubscribe promo"
                },
                {
                "type": "url",
                "text": "Go to link",
                "url": "https://app.pingtochat.com"
                },
                {
                "type": "PHONE_NUMBER",
                "text": "Call",
                "phone_number": "911234567890"
                }
            ]
        }
    ]
}

Parameters

  • template_id (string, required) – The ID of the template to be updated.
  • components(array, required) – Updated list of components in the template.
    • type (string, required) – Type of component (e.g., “HEADER”, “BODY”, “FOOTER”, “BUTTONS”).
    • format (string, optional) – Format type for the HEADER component (e.g., “TEXT”).
    • text (string, required for HEADER, BODY, FOOTER) – The updated text content of the component.
    • buttons(array, optional) – Updated list of buttons in the BUTTONS component.
      • type (string, required) – Type of button (e.g., “QUICK_REPLY”, “url”, “PHONE_NUMBER”, “copy_code”).
      • text (string, required) – The button label.
      • url (string, required for url button) – The link to redirect users.
      • phone_number (string, required for PHONE_NUMBER button) – The phone number for calling action.
      • example (string, required for copy_code button) – Example code for the copy action.

Response

{
    "success": true,
    "id": "xxxxxx",
    "name": "edit_b",
    "category": "marketing"
}

Notes

  • The {{your_domain}} should be replaced with the actual domain.
  • The {{phone_number_id}}, {{key}}, and {{template_id}} should be replaced with the actual values.
  • Ensure that the request body is formatted correctly as JSON.
  • Only authorized users with a valid key can create or update templates.
  • Categories may be restricted based on platform policies.

Leave a Comment

Share this Doc

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

Or copy link

CONTENTS