Skip to content

Message Template


Authorization

Add this header to every request in this page

json
{
  "Authorization": "Bearer ${token}"
}

🔒 Check WhatsApp Phone Status

Messages can be sent depending on WhatsApp Phone Number status

GET

/api/v1/message-templates/waba-status?channel_id=<channel_id>

Response

json
{
  "success": true,
  "message": "",
  "status_code": 200,
  "trace_id": "b287aef6-d09a-4ac3-8168-2193008179fb",
  "errors": [],
  "data": {
    "status": "<phone_status>",
    "id": "<phone_number_id>",
    "quality_rating": "<quality_rating>",
    "verified_name": "<phone_display_name>",
    "display_phone_number": "<phone_number>",
    "messaging_limit_tier": "<tier_limit>"
  }
}

Parameter Explanations

NameDescription
idThis is Channel Id which you are going to use while creating, getting and sending message templates
statusStatus of the Phone Number. Here is the status list. Check out Meta Documentation
  • CONNECTED: Ready to send messages
  • FLAGGED: Your phone marked as flagged due to low quality ratings.
  • RESTRICTED: You cant send any messages. Due to your quality rating. You have to wait some time before start sending again.
quality_ratingRating of the messages which you have sent to your customers for seven days. Rating is determined by the feedback from your customer. Here is the quality rating lists. Check out Meta Documentation
  • GREEN: High quality
  • YELLOW: Medium Quality
  • RED: Low Quality
messaging_limit_tierMaximum number of the business-initiated conversation of phone number can send in 24h.
  • TIER_50
  • TIER_250
  • TIER_1K
  • TIER_10K
  • TIER_100K
  • TIER_UNLIMITED

CAUTION

status -> When value is FLAGGED, message cannot be sent.

CAUTION

quality_rating -> When value is RED, no message can be sent.

WARNING

When your status is FLAGGED You have to be carefull. Your phone number at risk. Check your message templates. Revise the customer list that your sending messages templates to. If your customer marks your messages as spam. First your quality rating decreases and after that your number will be RESTRICTED!!! You wont be able to send messages anymore and your TIER would decrease.

TIP

If you keep your quality rating at GREEN your messaging tier will increase.

🔒 Check Message Template Name

We need to check the name status while creating the Message Template.

POST

/api/v1/message-templates/check-name

Body

json
{
  "channel_id": "",
  "name": ""
}

Response

json
{
  "success": true,
  "message": "",
  "status_code": 200,
  "trace_id": "04818782-39ee-4144-9f9b-fceccf51a38f",
  "errors": []
}

Parameter Explanation

NameDescription
nameName of the message template that you want to create
channel_idChannel Id of the message template. You can get your Channel Id on here

🔒 Create Message Template

Template Message creation process.

⚠️ Warning

If there is media submission in the message, please upload the media here.

POST

/api/v1/message-templates

Schema

json
{
  "name": "<template_name>",
  "category": "<template_category>",
  "components": [
      // <components>
  ],
  "allow_category_change": true,
  "language": "tr",
  "channel_id": "<channel_id>",
  "file_handle": "<file_hadle>"
}

Parameter Explanation

NameRequiredDescription
nametrueName of the message template that you want to create
categorytrueCategory of the message template. Right now only support 1.
  • MARKETING: Advertisement, Discount and any Product messages related to marketing
componentstrueCompoenents of the message template. You can check Offical Meta Documentation Here. We suggest you to create one at HeloRobo Panel
allow_category_changetrueAllow meta to change your submitted message template. Dont change this.
file_handlefalseUsed when you want to create Media Message Template. You can obtain file_handle from FB Upload by uploading your media.
channel_idtrueChannel Id of the message template. You can get your Channel Id on Channels
languagetrueMessage Template Language. Get the value from Languages

Response

json
{
  "success": true,
  "message": "",
  "status_code": 200,
  "trace_id": "aedebbe4-1abb-43a7-ac99-c569e375ecf1",
  "errors": [],
  "data": {
    "id": ""
  }
}

Examples


Basic Example

What this example have ?

  • Body component
json
{
  "name": "helorobo_demo",
  "category": "MARKETING",
  "components": [
    {
        "type": "BODY",
        "text": "Hello \n\nHow can we help you?"
    }
  ],
  "allow_category_change": true,
  "language": "tr",
  "channel_id": "<channel_id>"
}
Complex Example 1

What this example have ?

  • Body Compoenent with 1 ( Max 4 ) Param.
  • Footer Component
  • URL Button compoenent with param
  • Header
json
{
  "name": "helorobo_demo",
  "category": "MARKETING",
  "components": [
    {
      "type": "BODY",
      "text": "Hello {{1}} \n\nHow can we help you?"
    },
    {
      "type": "FOOTER",
      "text": "HeloRobo"
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "URL",
          "text": "Git",
          "url": "https://helorobo.com/add-to-calendar?user_id={{1}}"
        }
      ]
    },
    {
      "type": "HEADER",
      "format": "IMAGE"
    }
  ],
  "allow_category_change": true,
  "language": "tr",
  "channel_id": "",
  "file_handle": "" // optional
}

🔒 List Message Templates

Returns message templates.

GET

/api/v1/message-templates?channel_id=<channel_id>

Response

json
{
  "success": true,
  "message": "",
  "status_code": 200,
  "trace_id": "aedebbe4-1abb-43a7-ac99-c569e375ecf1",
  "errors": [],
  "items": [
    {
      "name": "helorobo_demo",
      "components": [
        {
          "type": "HEADER",
          "format": "IMAGE",
          "example": {
            "header_handle": [
              "<image_url>"
            ]
          }
        },
        {
          "type": "BODY",
          "text": "Hello, Dear {{1}}. {{2}} How are you?",
          "example": {
            "body_text": [["example_param_1", "example_param_2"]]
          }
        }
      ],
      "language": "tr",
      "status": "<message_template_status>",
      "category": "<message_template_category>",
      "id": "<messsage_template_id>"
    }
  ]
}

🔒 Message Template Detail

Returns the previously created message template detail.

GET

/api/v1/message-templates/<message_template_id>?channel_id=<channel_id>

Response

json
{
  "success": true,
  "message": "",
  "status_code": 200,
  "trace_id": "73b323b6-32bc-4746-b97e-6f67a6504dfa",
  "errors": [],
  "data": {
    "message_template": {
      "name": "helorobo_demo",
      "components": [
        {
          "type": "HEADER",
          "format": "IMAGE",
          "example": {
            "header_handle": [
              "<image_url>"
            ]
          }
        },
        {
          "type": "BODY",
          "text": "Hello, Dear {{1}}",
          "example": {
            "body_text": [["example_param_1"]]
          }
        }
      ],
      "language": "tr",
      "status": "<message_template_status>",
      "category": "<message_template_category>",
      "id": "<messsage_template_id>"
  }
}

🔒 Delete Message Template

Deletes the messages template with given id.

DELETE

/api/v1/message-templates/<message_template_id>

Response

json
{
    "success": true,
    "message": "",
    "status_code": 200,
    "trace_id": "8e2a0464-0873-40a3-a206-a2bf2d8bdf6d",
    "errors": []
}

🔒 Languages

Lists the languages supported by the Message Template. You will use value key when creating message template

GET

/api/v1/message-templates/languages

Response

json
{
  "success": true,
  "message": "",
  "status_code": 200,
  "trace_id": "e6e95c31-64ff-489b-8a68-eb8c1142df39",
  "errors": [],
  "data": {
    "languages": [
      {
        "value": "tr",
        "title": "Turkish"
      },
      {
        "value": "en",
        "title": "English"
      },
      {
        "value": "ar",
        "title": "عربي"
      },
      {
        "value": "ru",
        "title": "Russian"
      }
    ]
  }
}

🔒 Categories

GET

/api/v1/message-templates/categories

Response

json
{
  "success": true,
  "message": "",
  "status_code": 200,
  "trace_id": "53316e7b-0183-4bb8-8696-e01e2bb84659",
  "errors": [],
  "data": {
    "categories": [
      {
        "icon": "marketing",
        "value": "MARKETING",
        "title": "Pazarlama"
      }
    ]
  }
}