Submit WhatsApp Direct Send Sample
POST https://chatapps.8x8.com/api/v1/whatsapp/subaccounts/:subAccountId/channels/:channelId/directSend/sample
This endpoint is used to submit a sample of a WhatsApp Direct Send message to Meta for review and classification.
Direct Send auto-creates WhatsApp templates on the fly and matches incoming messages against them. Submitting sample messages will ensure that the messages you send through Direct Send are accurately classified and transformed into templates that are useful for your use cases.
The response indicates whether the sample was processed successfully and the category Meta assigned to it. Possible categories are UTILITY, MARKETING, and AUTHENTICATION.
Samples can be of two types:
-
text— a plain text body. -
interactive— an interactive message with a call-to-action URL (cta_url) or reply buttons (button).
Request
Path Parameters
Sub-account identifier
Channel identifier
Bodyrequired
Sample message to submit to Meta for review.
- For
cta_url,namemust becta_urlandparametersis required. - For
button,buttonsis required. - Array [
- ]
Sample type. Must be either text or interactive.
Possible values: [text, interactive]
interactive
text object
Required when type is text.
The text body of the sample message. Must not be empty.
Hello! This is a sample message.
interactive object
Required when type is interactive.
Interactive type. Must be either cta_url (call-to-action URL) or button (reply buttons).
Possible values: [cta_url, button]
cta_url
header object
Optional header for the interactive message.
Header type. Only text is supported.
Possible values: [text]
text
Header text. Must not exceed 60 characters.
Possible values: <= 60 characters
Welcome
body objectrequired
Body of the interactive message.
Body text. Must not be empty and must not exceed 1024 characters.
Possible values: <= 1024 characters
Tap the button below to visit our store.
footer object
Optional footer for the interactive message.
Footer text. Must not exceed 60 characters.
Possible values: <= 60 characters
Powered by 8x8
action objectrequired
Action object. The required fields depend on the interactive.type:
Required when interactive.type is cta_url. Must be cta_url.
Possible values: [cta_url]
cta_url
parameters object
Required when interactive.type is cta_url.
Text displayed on the call-to-action button. Must not be empty.
Visit store
Destination URL for the call-to-action. Must be a valid http or https URL.
https://example.com/store
buttons object[]
Required when interactive.type is button. Must contain at most 10 reply buttons.
Possible values: <= 10
Button type. Only reply is supported.
Possible values: [reply]
reply
reply objectrequired
Unique identifier for the button. Must not be empty.
btn-yes
Button label. Must not be empty and must not exceed 20 characters.
Possible values: <= 20 characters
Yes
Sample submitted successfully
Schema
Indicates whether the sample was accepted by Meta.
true
Category assigned by Meta to the submitted sample.
Possible values: [UTILITY, MARKETING, AUTHENTICATION]
UTILITY
{
"success":true,
"category":"UTILITY"
}
Sample accepted and categorized
{
"success":true,
"category":"UTILITY"
}
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"
}
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/submit-whatsapp-direct-send-sample · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments