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

header-image to text

Estimated reading: 2 minutes 73 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": "header_image_to_text",
  "language": "en_US",
  "category": "MARKETING",
  "allow_category_change": true,
  "components": [
        { 
            "type": "HEADER",
            "format": "MEDIA", 
            "example": { 
                "media_url": "https://file-examples.com/wp-content/storage/2017/10/file_example_PNG_500kB.png"
            } 
        },
        {
        "type": "BODY",
        "text": "Shop now  and use code CR7000 to get more offer"
        },
        {
        "type": "FOOTER",
        "text": "Thank you for choosing us!"
        }
    ]
}

Components

  1. Header
    • Type: MEDIA
    • Format: IMAGE
    • Example URL: https://file-examples.com/wp-content/storage/2017/10/file_example_PNG_500kB.png
  2. Body
    • Text: "Shop now and use code CR7000 to get more offer"
  3. Footer
    • Text: "Thank you for choosing us!"

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!"
        },
        {
            "type": "BODY",
            "text": "We are introducing our new product in Urwallet!"
        },
        {
            "type": "FOOTER",
            "text": "Thank you for choosing Urwallet!"
        }
    ]
}

Components

  1. Header
    • Type: TEXT
    • Text: "Our summer sale is on!"
  2. Body
    • Text: "We are introducing our new product in Urwallet!"
  3. Footer
    • Text: "Thank you for choosing Urwallet!"

Response

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

header-image to text

Or copy link

CONTENTS