Sending Media Message Template

You can use POST /api/v2/push/message endpoint to send message template to your customers. In order to use this feature, you need to create message template. You can request message template to our customer service.

With this media message template, you can send media like image, video & document along with your message text.

Body:

{
  "message": {
    "type": "template",
    "template": {
      "template_code_id": "{{fill_your_template_code_id}}",
      "payload": [
        {
          "position": "header",
          "parameters": [
            {
              "type": "{{your_can_fill_[document||image||video]}}",
              "document": {
                "url": "{{fill_your_url_[document||image||video]}}",
                "caption": "{{fill_value_caption_on_media}}"
              }
            }
          ]
        },
        {
          "position": "body",
          "parameters": []
        }
      ]
    }
  },
  "phone_number": "{{fill_your_recipient_number}}"
}

The main Object

Name
Required
Description

phone_number

Yes

Destination of phone number Values : country code + phone number (+6281381475159, 6281381475159)

message

Yes

Contain all message information body

The message Object

Name
Required
Description

type

Yes

The type of your message

Values : template

template

Yes

Contain template information

The template Object

Name
Required
Description

template_code_id

Yes

The registered template message, you will be given the template code id for your requested template Values : template code id

payload

Yes

Contain array of information for specific template

The payload Object

Name
Required
Description

position

Yes

Describe the position type Values : header | body

parameters

Yes

Array containing the content of each position type

The body parameters Object

Name
Required
Description

type

Yes

Describe the type for parameters Values : text

text

Yes

Contain value of text

The header parameters Object

Name
Required
Description

type

Yes

Describe the type value Values : text | image | video | document

text

Yes, when “type” : “text”

Contain value of text

image

Yes, when “type” : “image”

Media object containing image

video

Yes, when “type” : “video”

Media object containing video

document

Yes, when “type” : “document”

Media object containing document

The image, video & document Object

Name
Required
Description

url

Yes

The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.

Last updated