Add WhatsApp template
POST https://chatapps.8x8.com/api/v1/accounts/:accountId/channels/:channelId/templates
This endpoint is used to register new WhatsApp message template.
Please note that special html entities should be unescaped.
WhatsApp Message Templates are message formats for common reusable messages a business may want to send. Businesses must use Message Templates for sending notifications to customers. Any message sent outside the 24h customer service window, needs to be a template message, to be delivered. Advertising, marketing, or promotional messages are not permitted.
Request
Path Parameters
Possible values: >= 32 characters and <= 36 characters, Value must match regular expression ^[0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}$
You must replace {accountId} with the accountid that you want to use.
Channel identifier
Body
- Array [
- Array [
- ]
- Array [
- Array [
- ]
- ]
- ]
Template language code
en_US
Template name
ticket_update_en_US
Template category.
Templates containing a VOICE_CALL button are only allowed in MARKETING or UTILITY categories.
UTILITY
components object[]required
Registered template components
Component type
Possible values: [HEADER, BODY, FOOTER, BUTTONS, CAROUSEL, CALL_PERMISSION_REQUEST]
BODY
Component type.
Required for HEADER component type.
Note: Gifs are currently only available for Marketing Messages API for WhatsApp.
Possible values: [Text, Image, Gif, Video, Document, Location]
Image
Component text. Required for BODY and FOOTER types
You can pickup your delivery at {{1}}
buttons object[]
Button type
Possible values: [PHONE_NUMBER, URL, QUICK_REPLY, OTP, COPY_CODE, FLOW, VOICE_CALL]
The text to be displayed on the button (except VOICE_CALL, where it is optional).
Possible values: non-empty and <= 20 characters
Required for type "PHONE_NUMBER".
The phone number that will be called on clicking the button.
Optional country code of phone number (ISO 3166-1 alpha-2). Required if the phone number in the national format.
Possible values: >= 2 characters and <= 2 characters
US
Required for type "URL".
The URL that will be visited on clicking the button Variables can be used to create dynamic links.
https://website.com/{{1}}
To help WhatsApp moderators during the review and approval process, you can include example data. This can help WhatsApp understand what kind of message you plan to send and showcase the customer experience.
For example, you could include an image that could represent a customer's profile picture to personalize the experience.
Make sure these are examples and do not include any confidential or personal information.
Required for type "FLOW".
The ID of the WhatsApp Flow to launch when the button is clicked.
859504979861628
Optional for type "FLOW".
The action to perform when launching the flow. Defaults to "navigate" if not provided.
Possible values: [navigate, data_exchange]
navigate
navigate
Optional for type "FLOW".
The screen ID to navigate to when launching the flow. Used when flowAction is "navigate". Defaults to "FIRST_ENTRY_SCREEN" if not provided.
FIRST_ENTRY_SCREEN
RECOMMEND
Optional property for type "VOICE_CALL" only.
The time-to-live in minutes for the voice call button. If provided, must be between 1440 mins (1 day) and 43200 mins (30 days), inclusive.
Possible values: >= 1440 and <= 43200
1440
To help WhatsApp moderators during the review and approval process, you can include example data. This can help WhatsApp understand what kind of message you plan to send and showcase the customer experience.
For example, you could include an image that could represent a customer's profile picture to personalize the experience.
Make sure these are examples and do not include any confidential or personal information.
Only for BODY component with AUTHENTICATION template category
Only for FOOTER component with AUTHENTICATION template category
5
cards object[]
Required only for CAROUSEL type. You can create up to 10 cards.
Component type
Possible values: [HEADER, BODY, BUTTONS]
BODY
Component type. Required for HEADER component type.
Possible values: [Image, Video]
Image
Component text. Required for BODY and FOOTER types
You can pickup your delivery at {{1}}
buttons object[]
Button type
Possible values: [PHONE_NUMBER, URL, QUICK_REPLY, OTP, COPY_CODE]
The text to be displayed on the button.
Possible values: non-empty and <= 20 characters
Required for type "PHONE_NUMBER".
The phone number that will be called on clicking the button.
Optional country code of phone number (ISO 3166-1 alpha-2). Required if the phone number in the national format.
Possible values: >= 2 characters and <= 2 characters
US
Required for type "URL".
The URL that will be visited on clicking the button Variables can be used to create dynamic links.
https://website.com/{{1}}
To help WhatsApp moderators during the review and approval process, you can include example data. This can help WhatsApp understand what kind of message you plan to send and showcase the customer experience.
For example, you could include an image that could represent a customer's profile picture to personalize the experience.
Make sure these are examples and do not include any confidential or personal information.
To help WhatsApp moderators during the review and approval process, you can include example data. This can help WhatsApp understand what kind of message you plan to send and showcase the customer experience.
For example, you could include an image that could represent a customer's profile picture to personalize the experience.
Make sure these are examples and do not include any confidential or personal information.
set to true to allow whatsapp to automatically assign a category. If omitted, the template may be rejected due to mis-categorization.
true
false
Custom time-to-live (TTL) for message delivery in seconds. If a message cannot be delivered within this time, it will be dropped.
Valid ranges: Authentication templates (30-900 seconds or -1 for 30 days), Utility templates (30-43200 seconds or -1 for 30 days), Marketing templates (43200-2592000 seconds).
Default TTL: Authentication=10 minutes (600 seconds), Utility/Marketing=30 days.
300
Schema
{}
Bad request error response
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1002,
"message":"Invalid MSISDN format (not E.164 international number)",
"errorId":"b4478860-b76c-e811-814e-022a35cc1c71",
"timestamp":"2018-08-04T09:25:40.9235752+00:00"
}
Request was not authenticated response
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1200,
"message":"Request was not authenticated properly",
"errorId":"db9dced4-3534-4d86-9d18-6b448af0d621",
"timestamp":"2018-08-02T09:42:38.8988997+00:00"
}
Template name cannot be reused within 30 days of deletion
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":3060,
"message":"New Indonesian content can't be added while the existing Indonesian content is being deleted. Try again in 4 weeks or consider creating a new message template.",
"errorId":"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"timestamp":"2024-02-16T10:30:00.00Z"
}
Internal server error
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":2000,
"message":"Internal server error",
"errorId":"db9dced4-3534-4d86-9d18-6b448af0d621",
"timestamp":"2018-07-02T09:42:38.8988997+00:00"
}
Source: https://developer.8x8.com/connect/reference/add-whatsapp-template · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments