Create WhatsApp Template

To create a WhatsApp template on behalf of the business, partners must utilize the designated API. When calling the API, it is essential to include both the partner-token and the auth-token in the API header. Once the API is invoked, the template is submitted to Meta for approval.

If the template messages includes photo, video and documents, partners must first upload the media to Meta to obtain a hashed URL, which is then added to the header payload along with required tokens before submitting the template. To know more about the steps visit here.
 

POST 

/wa-templates/create-template


Example Request

curl --location '/wa-templates/create-template' \
--header 'partner-token;' \
--header 'auth-token;' \
--data '{
    "name": "copy_of_order_confirmation",
    "category": "UTILITY",
    "language": "en_US",
    "template_type": "text",
    "components": [
        {
            "type": "BODY",
            "text": "Thank you for your order, {{1}}! Your confirmation number is {{2}}. If you have any questions, please use the buttons below to contact support. Thank you for being a customer!",
            "example": {
                "body_text": [
                    [
                        "Pablo",
                        "860198-230332"
                    ]
                ]
            }
        },
        {
            "type": "BUTTONS",
            "buttons": [
                {
                    "type": "PHONE_NUMBER",
                    "text": "Call",
                    "phone_number": "919638421195"
                },
                {
                    "type": "URL",
                    "text": "Contact Support",
                    "url": "https://www.luckyshrub.com/support"
                }
            ]
        }
    ]
}'


Example Response

{
  "status": 201,
  "success": true,
  "message": "success",
  "payload": {
    "components": [
      {
        "type": "BODY",
        "text": "Thank you for your order, {{1}}! Your confirmation number is {{2}}. If you have any questions, please use the buttons below to contact support. Thank you for being a customer!",
        "example": {
          "body_text": [
            [
              "Pablo",
              "860198-230332"
            ]
          ]
        }
      },
      {
        "type": "BUTTONS",
        "buttons": [
          {
            "type": "PHONE_NUMBER",
            "text": "Call",
            "phone_number": "919638421195"
          },
          {
            "type": "URL",
            "text": "Contact Support",
            "url": "https://www.luckyshrub.com/support"
          }
        ]
      }
    ],
    "description": "Thank you for your order, {{1}}! Your confirmation number is {{2}}. If you have any questions, please use the buttons below to contact support. Thank you for being a customer!"
  }
}