Pingtochat Docs

Pingtochat Docs

Did You Know?

Advanced visual search system powered by Ajax

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

Parameter with header body without static button url and quick-replay, phone-number

Estimated reading: 3 minutes 68 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_aa",
    "language": "en_US",
    "category": "UTILITY",
    "allow_category_change": true,
    "components": [
        {
            "type": "HEADER",
            "format": "TEXT",
            "text": "Our pingtochat {{1}} is on!",
            "example": {
                "header_text": [
                    "Summer Sale"
                ]
            }
        },
        {
            "type": "BODY",
            "text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
            "example": {
                "body_text": [
                    [
                        "the end of August",
                        "25OFF",
                        "25%"
                    ]
                ]
            }
        },
        {
            "type": "FOOTER",
            "text": "Use the buttons below to manage your marketing subscriptions"
        },
        {
            "type": "BUTTONS",
            "buttons": [
                {
                    "type": "QUICK_REPLY",
                    "text": "Unsubscribe from Promos"
                },
                {
                    "type": "PHONE_NUMBER",
                    "text": "Call",
                    "phone_number": "91xxxxxxxxxx"
                }
            ]
        }
    ]
}

Parameters

  • name (string, required) – Unique identifier for the template (e.g., “edit_aa”).
  • language (string, required) – Language code for the template (e.g., “en_US”).
  • category (string, required) – Category of the template (e.g., “UTILITY”).
  • allow_category_change (boolean, optional) – Whether the category can be changed (true/false).
  • components (array, required) – List of structural components of the template.

Components Breakdown

HEADER

  • type (string, required) – “HEADER”
  • format (string, required) – “TEXT”
  • text (string, required) – “Our pingtochat {{1}} is on!”

BODY

  • type (string, required) – “BODY”
  • text (string, required) – “Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.”

FOOTER

  • type (string, required) – “FOOTER”
  • text (string, required) – “Use the buttons below to manage your marketing subscriptions”

BUTTONS

  • type (string, required) – “BUTTONS”
  • buttons (array, required) – Contains interactive buttons.
QUICK_REPLY
  • type (string, required) – “QUICK_REPLY”
  • text (string, required) – “Unsubscribe from Promos”
PHONE_NUMBER Button
  • type (string, required) – “PHONE_NUMBER”
  • text (string, required) – “Call”
  • phone_number (string, required) – “91xxxxxxxxxx”

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 pingtochat {{1}} is on!",
            "example": {
                "header_text": [
                    "Winter Sale"
                ]
            }
        },
        {
            "type": "BODY",
            "text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
            "example": {
                "body_text": [
                    [
                        "the end of August",
                        "45OFF",
                        "35%"
                    ]
                ]
            }
        },
        {
            "type": "FOOTER",
            "text": "Use the buttons below to manage your Urwallet subscriptions"
        },
        {
            "type": "BUTTONS",
            "buttons": [
                {
                    "type": "QUICK_REPLY",
                    "text": "Unsubscribe Urwallet"
                },
                {
                    "type": "url",
                    "text": "Go to link",
                    "url": "https://app.pingtochat.com"
                },
                {
                    "type": "PHONE_NUMBER",
                    "text": "Call",
                    "phone_number": "91xxxxxxxxxx"
                }
            ]
        }
    ]
}

Components Breakdown

  • HEADER – Text: “Our summer sale is on in Urwallet!”
  • BODY – Text: “We are introducing our new product in Urwallet!”
  • FOOTER – Text: “Thank you for choosing Urwallet!”
  • BUTTONS
    • Quick Reply Button – “Unsubscribe Urwallet!”
    • URL Button – “Go to link” (Dynamic URL support with example values)
    • Phone Number Button – “Call” (Calls a specified phone number)

Response

{
    "success": true,
    "id": "xxxxxx",
    "name": "edit_s",
    "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

Parameter with header body without static button url and quick-replay, phone-number

Or copy link

CONTENTS