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

    subAccountId stringrequired

    Sub-account identifier

    channelId stringrequired

    Channel identifier

Bodyrequired

Sample message to submit to Meta for review.

    typestringrequired

    Sample type. Must be either text or interactive.

    Possible values: [text, interactive]

    Example: interactive

    text object

    Required when type is text.

    bodystringrequired

    The text body of the sample message. Must not be empty.

    Example: Hello! This is a sample message.

    interactive object

    Required when type is interactive.

    typestringrequired

    Interactive type. Must be either cta_url (call-to-action URL) or button (reply buttons).

    Possible values: [cta_url, button]

    Example: cta_url

    header object

    Optional header for the interactive message.

    typestringrequired

    Header type. Only text is supported.

    Possible values: [text]

    Example: text
    textstringrequired

    Header text. Must not exceed 60 characters.

    Possible values: <= 60 characters

    Example: Welcome

    body objectrequired

    Body of the interactive message.

    textstringrequired

    Body text. Must not be empty and must not exceed 1024 characters.

    Possible values: <= 1024 characters

    Example: Tap the button below to visit our store.

    footer object

    Optional footer for the interactive message.

    textstringrequired

    Footer text. Must not exceed 60 characters.

    Possible values: <= 60 characters

    Example: Powered by 8x8

    action objectrequired

    Action object. The required fields depend on the interactive.type:

    • For cta_url, name must be cta_url and parameters is required.
    • For button, buttons is required.
    namestring

    Required when interactive.type is cta_url. Must be cta_url.

    Possible values: [cta_url]

    Example: cta_url

    parameters object

    Required when interactive.type is cta_url.

    display_textstringrequired

    Text displayed on the call-to-action button. Must not be empty.

    Example: Visit store
    urlstring<uri>required

    Destination URL for the call-to-action. Must be a valid http or https URL.

    Example: https://example.com/store

    buttons object[]

    Required when interactive.type is button. Must contain at most 10 reply buttons.

    Possible values: <= 10

  • Array [
  • typestringrequired

    Button type. Only reply is supported.

    Possible values: [reply]

    Example: reply

    reply objectrequired

    idstringrequired

    Unique identifier for the button. Must not be empty.

    Example: btn-yes
    titlestringrequired

    Button label. Must not be empty and must not exceed 20 characters.

    Possible values: <= 20 characters

    Example: Yes
  • ]

Sample submitted successfully

Schema

    successboolean

    Indicates whether the sample was accepted by Meta.

    Example: true
    categorystring

    Category assigned by Meta to the submitted sample.

    Possible values: [UTILITY, MARKETING, AUTHENTICATION]

    Example: UTILITY
{
"success":true,
"category":"UTILITY"
}

Sample accepted and categorized

{
"success":true,
"category":"UTILITY"
}

Bad request error 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":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

    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"
}

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/submit-whatsapp-direct-send-sample · 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