Send Text Template

Send a text-based template message

post

Sends a template message to a specified client using placeholders and 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".

text_messagestringOptional

Template message text with placeholders like {{1}}.

agentsstring[]Optional

List of agent emails assigned to the chat.

Responses
200

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: 283

{
  "client": "text",
  "client_phone": "text",
  "client_name": "text",
  "callback_url": "text",
  "delay": "text",
  "text_message": "text",
  "agents": [
    "text"
  ],
  "template": {
    "language": {
      "policy": "text",
      "code": "text"
    },
    "name": "text",
    "components": [
      {
        "type": "text",
        "parameters": [
          {
            "type": "text",
            "text": "text"
          }
        ]
      }
    ]
  }
}
200

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! Thanks for your support",
  "agents": [
      "email@agent.it"    //assign the chat to the agent with that email
  ],
  "template": {
    "name": "TEMPLATE_NAME",
    "language": {
      "code": "it"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "Tom"
          },
          {
            "type": "text",
            "text": "Dylan"
          },
          {
            "type": "text",
            "text": "123OrdID"
          }
        ]
      }
    ]
  }
}

Meta official documentation

Last updated