Get WhatsApp templates
GET https://chatapps.8x8.com/api/v1/accounts/:accountId/channels/:channelId/templates
This endpoint is used to get your registered WhatsApp message template and their approval status.
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
Schema
- Array [
- Array [
- Array [
- ]
- ]
- ]
templates object[]
Channel ID
ec36a867-3dd4-e911-814a-02d85f55fce8
Channel User-friendly name
Possible values: <= 36 characters
My WhatsApp Instance
Template name
Possible values: <= 200 characters
test1
Template languate code
Possible values: <= 5 characters
en_US
User-friendly language name
English (US)
components object[]
Template components
Component type
Possible values: [HEADER, BODY, FOOTER, BUTTONS]
BODY
Component type. Required for HEADER component type.
Possible values: [Text, Image, 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
example object
Example data provided for the template
Header text examples
Body text examples
Header images, docs or videos examples
template category enumeration
UTILITY
User-friendly category name
Utility
Template status enumeration
APPROVED
User-friendly status name
Approved
Template creation timestamp
2019-08-26T04:50:47.38Z
Template last update timestamp
2019-09-26T04:50:47.38Z
{
"templates":[
{
"channelId":"ec36a867-3dd4-e911-814a-02d85f55fce8",
"channelName":"My WhatsApp Instance",
"templateName":"test1",
"language":"en_US",
"languageName":"English (US)",
"components":[
{
"type":"BODY",
"format":"Image",
"text":"You can pickup your delivery at {{1}}",
"buttons":[
{
"type":"PHONE_NUMBER",
"text":"string",
"phoneNumber":"string",
"country":"US",
"url":"https://website.com/{{1}}",
"example":[
"string"
],
"flowId":"859504979861628",
"flowAction":"navigate",
"navigateScreen":"RECOMMEND",
"ttlMinutes":1440
}
],
"example":{
"headerText":[
"string"
],
"bodyText":[
"string"
],
"headerHandle":[
"string"
]
}
}
],
"category":"UTILITY",
"categoryName":"Utility",
"status":"APPROVED",
"statusName":"Approved",
"createdAt":"2019-08-26T04:50:47.38Z",
"updatedAt":"2019-09-26T04:50:47.38Z"
}
]
}
{
"templates":[
{
"channelId":"ec36a867-3dd4-e911-814a-02d85f55fce8",
"channelName":"My WhatsApp instance",
"templateName":"ticket_created",
"language":"en",
"languageName":"English",
"components":[
{
"type":"BODY",
"text":"Hi, your booking have been confirmed. Here is your new booking information {{1}}"
}
],
"category":"UTILITY",
"categoryName":"Utility",
"status":"APPROVED",
"statusName":"Approved",
"createdAt":"2019-11-19T07:51:38.09Z",
"updatedAt":"2019-11-28T02:16:42.82Z"
},
{
"channelId":"ec36a867-3dd4-e911-814a-02d85f55fce8",
"channelName":"My WhatsApp instance",
"templateName":"ticket_closed",
"language":"en",
"languageName":"English",
"components":[
{
"type":"HEADER",
"format":"Image"
},
{
"type":"BODY",
"text":"Your ticket {{1}} was closed."
},
{
"type":"FOOTER",
"text":"Support Team"
}
],
"category":"UTILITY",
"categoryName":"Utility",
"status":"APPROVED",
"statusName":"Approved",
"createdAt":"2019-11-14T07:17:57.16Z",
"updatedAt":"2019-11-28T02:16:42.82Z"
}
]
}
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"
}
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/get-whatsapp-templates · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments