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

    accountId stringrequired

    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.

    channelId stringrequired

    Channel identifier

Schema

    templates object[]

  • Array [
  • channelIdstring<uuid>

    Channel ID

    Example: ec36a867-3dd4-e911-814a-02d85f55fce8
    channelNamestring

    Channel User-friendly name

    Possible values: <= 36 characters

    Example: My WhatsApp Instance
    templateNamestring

    Template name

    Possible values: <= 200 characters

    Example: test1
    languagestring

    Template languate code

    Possible values: <= 5 characters

    Example: en_US
    languageNamestring

    User-friendly language name

    Example: English (US)

    components object[]

    Template components

  • Array [
  • typestringrequired

    Component type

    Possible values: [HEADER, BODY, FOOTER, BUTTONS]

    Default value: BODY
    formatstring

    Component type. Required for HEADER component type.

    Possible values: [Text, Image, Video, Document, Location]

    Example: Image
    textstring

    Component text. Required for BODY and FOOTER types

    Example: You can pickup your delivery at {{1}}

    buttons object[]

  • Array [
  • typestringrequired

    Button type

    Possible values: [PHONE_NUMBER, URL, QUICK_REPLY, OTP, COPY_CODE, FLOW, VOICE_CALL]

    textstringrequired

    The text to be displayed on the button (except VOICE_CALL, where it is optional).

    Possible values: non-empty and <= 20 characters

    phoneNumberstring

    Required for type "PHONE_NUMBER".

    The phone number that will be called on clicking the button.

    countrystring

    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

    Example: US
    urlstring<uri>

    Required for type "URL".

    The URL that will be visited on clicking the button Variables can be used to create dynamic links.

    Example: https://website.com/{{1}}
    examplestring[]

    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.

    flowIdstring

    Required for type "FLOW".

    The ID of the WhatsApp Flow to launch when the button is clicked.

    Example: 859504979861628
    flowActionstring

    Optional for type "FLOW".

    The action to perform when launching the flow. Defaults to "navigate" if not provided.

    Possible values: [navigate, data_exchange]

    Default value: navigate
    Example: navigate
    navigateScreenstring

    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.

    Default value: FIRST_ENTRY_SCREEN
    Example: RECOMMEND
    ttlMinutesinteger

    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

    Example: 1440
  • ]
  • example object

    Example data provided for the template

    headerTextstring[]

    Header text examples

    bodyTextstring[]

    Body text examples

    headerHandlestring[]

    Header images, docs or videos examples

  • ]
  • categorystring

    template category enumeration

    Example: UTILITY
    categoryNamestring

    User-friendly category name

    Example: Utility
    statusstring

    Template status enumeration

    Example: APPROVED
    statusNamestring

    User-friendly status name

    Example: Approved
    createdAtstring<date-time>

    Template creation timestamp

    Example: 2019-08-26T04:50:47.38Z
    updatedAtstring<date-time>

    Template last update timestamp

    Example: 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

    codeintegerrequired

    Error code

    messagestring

    Error description

    errorIdstring<uuid>required

    Unique id of error. You can use it as reference when sending enquiries to 8x8 support

    timestampstring<date-time>required

    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

    codeintegerrequired

    Error code

    messagestring

    Error description

    errorIdstring<uuid>required

    Unique id of error. You can use it as reference when sending enquiries to 8x8 support

    timestampstring<date-time>required

    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.

Was this article helpful?
or
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.

Didn't find what you were looking for?

Submit a request