Create Template

Creating a Whatsapp Template.

Request

POST https://wa.antgst.com/v1/whatsapp/templates

Content-Type

circle-info

application/json

Header Parameters

Authorization

Bearer token for API authentication. This should be a valid access token obtained through the appropriate OAuth flow or system user token.

Request Body

Field

Type

Required(*)

Description

wabaId

String

true

Whatsapp Business Account ID.

name

String

true

Template Name(regexp = ^[a-z0-9_]+$,[max:64]).

language

String

true

Language code of the template.

category

String

true

Template category. PENDING APPROVED REJECTED

messageSendTtlSeconds

int

false

If we are unable to deliver a message for an amount of time that exceeds its time-to-live, we will stop retrying and drop the message. By default, messages that use an authentication template have a default TTL of 10 minutes, and messages that use a utility or marketing template have a default TTL of 30 days. Set its value between 30 and 900 seconds (i.e., 30 seconds to 15 minutes) for authentication templates, or 30 and 43200 seconds (i.e., 30 seconds to 12 hours) for utility templates, or 43200 and 2592000 seconds (i.e., 12 hours to 30 days) for marketing templates. Alternatively, you can set this value to -1, which will set a custom TTL of 30 days for either type of template. We encourage you to set a time-to-live for all of your authentication templates, preferably equal to or less than your code expiration time, to ensure your customers only get a message when a code is still usable.

add_security_recommendation

boolean

false

Optional. Applies only to AUTHENTICATION templates. Set to true if you want the template to include the string, For your security, do not share this code. Set to false to exclude the string.

code_expiration_minutes

int

false

Optional. Applies only to AUTHENTICATION templates. Indicates number of minutes the password or code is valid. If omitted, the code expiration warning will not be displayed in the delivered message. Minimum 1, maximum 90.

bodyText

String

Required when creating MARKETING and UTILITY templates.

Optional. Applies only to MARKETING and UTILITY templates. There can be at most 1 variable in bodyText And the variable sign is {{1}}. Like Use code {{1}} to get first purchase!

variable

String

Required when creating MARKETING and UTILITY templates.

variable are used in text. Provide sample values for those variables in bodyText.

headerText

String

false

Optional. Applies only to MARKETING and UTILITY templates. headerText are optional text that appear at the top of template messages.

footerText

String

false

Optional. Applies only to MARKETING and UTILITY templates. footerText are optional text-only text that appear immediately after the bodyText.

Request Example:

Response Example:

Response parameter description:

Field

Description

officialTemplateId

Official template ID assigned by WhatsApp. This ID is used to identify the template in WhatsApp's system.

wabaId

Whatsapp Business Account ID.

name

The name of a WhatsApp template.

category

Template category. PENDING APPROVED REJECTED

status

The status of a WhatsApp template.

+ PENDING: Indicates that the template is under template review.

+ REJECTED: The template has been rejected during review process.

+ APPROVED: The template is approved, and you may begin sending it to customers.

+ PAUSED: The template has been paused due to recurring negative feedback from customers. Message templates with this status cannot be sent to customers. See Template Pausingarrow-up-right.

+ DISABLED: The template has been disabled due to recurring negative feedback from customers or for violating one or more of our policies. Message templates with this status cannot be sent to customers.

+ FLAGGED: The template has received negative feedback and is at risk of being disabled.

+ LIMIT_EXCEEDED: WhatsApp Business account templates have reached their template limits.See also Template restrictionsarrow-up-right + IN_APPEAL: The template is in appeal. See also Template Appealsarrow-up-right.

+ PENDING_DELETION: The template is deleted.

language

Language code of the template.

qualityScore

Quality rating of WhatsApp template.One of GREEN YELLOW UNKNOWN .See also Template Quality Ratingarrow-up-right.

+ GREEN: High quality.

+ YELLOW: Medium quality.

+ RED: Low quality.

+ UNKNOWN: Unknown quality. GREEN YELLOW RED UNKNOWN

whatsappError

When creating a template for rejection Whatsapp returns the rejection reason.

createTime

Template create time. Follows the ISO 8601 international standard for representing date and time.

updateTime

Template update time. Follows the ISO 8601 international standard for representing date and time.

Last updated