Send Interactive Template

Send an interactive template message

post

Sends an interactive template message to a specified client using customizable parameters.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
businessnamestringRequired

The business name associated with the template.

Body
clientstringOptional

Client ID (required if client_phone is not provided).

client_phonestringOptional

Client phone number, with country prefix (required if client is not provided).

client_namestringOptional

Client's name, required with client_phone.

callback_urlstringOptional

URL to receive message status updates.

delaystringOptional

Delay before sending the message, e.g., "10d".

agentsstring[]Optional

List of agent emails assigned to the chat.

Responses
200

Interactive template message sent successfully.

application/json
post
/template
POST /ext/v2/{businessname}/template HTTP/1.1
Host: api.pingueen.it/ext/v2/{businessname}
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 395

{
  "client": "text",
  "client_phone": "text",
  "client_name": "text",
  "callback_url": "text",
  "delay": "text",
  "agents": [
    "text"
  ],
  "template": {
    "language": {
      "policy": "text",
      "code": "text"
    },
    "name": "text",
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "text",
            "image": {
              "link": "text"
            },
            "currency": {
              "fallback_value": "text",
              "code": "text",
              "amount_1000": 1
            },
            "date_time": {
              "fallback_value": "text"
            },
            "payload": "text"
          }
        ]
      }
    ]
  }
}
200

Interactive template message sent successfully.

{
  "success": true,
  "data": {
    "message_id": "1232412421"
  }
}

Body Example

{
  "client_phone": "3932132123", //phone with prefix
  "client_name": "Jon Doe",
  "callback_url": "https://webhook.domain.it/inbound", //callback to get results (sent/delivered/read)
  "delay": "10m", //10 minutes delay
  "text_message": "Hi {{1}}, my name is {{2}} and your order {{3}} is ready! Pay the bill right now!",
  "agents": [
      "email@agent.it"    //assign the chat to the agent with that email
  ],
  "template": {
    "name": "TEMPLATE_NAME",
    "language": {
      "code": "it"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "document",
            "document": {
              "link": "https://documenturl.pdf"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "Tom"
          },
          {
            "type": "text",
            "text": "Dylan"
          },
          {
            "type": "text",
            "text": "123OrdID"
          }
        ]
      },

      {
          "type": "button",
          "sub_type" : "quick_reply",
          "index": "0", 
          "parameters": [
              {
                  "type": "payload",
                  "text":"Contact us"
              }
          ]
      },
      {
          "type": "button",
          "sub_type" : "url",
          "index": "1", 
          "parameters": [
              {
                  "type": "text",
                  // id of payment sistem. Es: in the template configuration 
                  // is approved the url https://buy.stripe.com/{{1}}
                  // this button is a Link CTA as: https://buy.stripe.com/9rwnB8RbYmPF5t2Mn09x4h
                  "text": "9rwnB8RbYmPF5t2Mn09x4h"
              }
          ]
      }

    ]
  }


}

Meta official documentation

Last updated