Send Line Notification message batch

POST https://chatapps.8x8.com/api/v1/subaccounts/:subAccountId/lon/batch
  • This endpoint is used to send Messaging Apps messages by batches (1 request for multiple messages) with personalized contents/properties.
  • It is ideal to send any kind of massive personalized announcement.
  • Using this API, it is possible to send up to 1,000 messages per request.

Request

Path Parameters

    subAccountId stringrequired

    Possible values: >= 3 characters and <= 50 characters, Value must match regular expression ^[A-Za-z0-9\-._&]{3,50}$

    You must replace {subAccountId} with the subaccountid that you want to use. By default this is generated once you signed up with a new account at https://connect.8x8.com.

Body

Messaging Apps API: request model for send batch of Line Notification messages

    clientBatchIdstring

    Customer batch ID. This value will be returned in DR "clientBatchId" field

    Possible values: <= 100 characters

    Example: my-batch-123

    messages object[]required

    non-generic information to compose message. Will be combined with "template" properties to compose final message. At least user information should be provided.

    Possible values: <= 10000

  • Array [
  • user objectrequired

    User information

    msisdnstring

    Mobile phone number (MSISDN) to send the message to. International phone number format with '+ sign prefered. In addition we support national (local) phone numbers, please set country field to use it.

    Example: +6500000000
    countrystring

    Default country code (like 'sg', 'uk') for national phone numbers format. You don't need it if msisdn in E.164 format (with '+' sign at the beginning)

    Possible values: <= 2 characters

    Example: SG
    clientMessageIdstring

    Client managed id for the message : your own unique reference

    Possible values: <= 50 characters

    Example: abc-123

    content objectrequired

    Content of the Line Notification message

    titlestring

    Message title

    Example: Event reminder
    companystring<uri>

    Company name

    Example: 8x8
    iconstring

    Message icon

    Possible values: [userPlus, chatEllipsis, phone, note, gear, bell, checkCircle, slashCircle, search, link, wallet, store, mapMarker, idCard, utensils, medicalKit, train, planeDeparture, questionCircle, infoCircle, boxCheck, calendarCheck, calendar, file, envelope, usdCircle, thbCircle, usdCircleSend, thbCircleSend, invoice, couponStar, coupon, creditCard, starCard, shoppingBag, megaphone, shieldCheck, history]

    emphasis object

    Emphasis component data

    labelstring

    Label

    Example: Event name
    contentstring

    Content

    Example: 8x8 Conference

    list object[]

    Template list items

  • Array [
  • labelstring

    Label

    Example: Date
    contentstring

    Content

    Example: Tue 26/09/2023
  • ]
  • greetingstring

    Greeting message

    Example: Can't wait to see you there!
    explanationstring

    Explanation

    Example: We would like to remind you about your reservation for tomorrow event

    actions object[]

    Template action list

  • Array [
  • titlestring

    Title

    Example: See direction
    urlstring

    Url

    Example: https://www.google.com/maps
  • ]
  • dlrCallbackUrlstring<uri>

    Override default DR callback URL for the message

    smsFallback object

    textstring

    SMS fallback message text

    sourcestring

    Source number (SenderId) - "From" field for SMS. Max length 16 chars.

    Possible values: <= 16 characters

    Example: Info
    encodingEncoding (string)

    Encoding for the text of the message. "AUTO", "GSM7" and "UCS2"

    Possible values: [AUTO, GSM7, UCS2]

    Example: AUTO
  • ]
  • includeMessagesInResponseboolean

    If 'True', then information about every message will be returned in API response

    Default value: false
    Example: true

Success response

Schema

    batchIdstring<uuid>required

    Batch ID, generated by 8x8

    Example: cf3cbbf5-3e2d-ea11-815d-020897df5459
    clientBatchIdstring

    Client batch ID from request

    Possible values: <= 100 characters

    acceptedCountintegerrequired

    Amount of accepted messages from batch

    Possible values: >= 0 and <= 10000

    rejectedCountintegerrequired

    Amount of rejected messages from batch

    Possible values: >= 0 and <= 10000

    messages object[]

    Message details. Will be include in response if request includeMessagesInResponse field set to true

  • Array [
  • status objectrequired

    Delivery status of the message. Status contains the following information.

    statestring

    General status of the message. Possible values are

    • unknown: Status is not known. This is an exceptional/intermediate status.
    • queued: The request is accepted and queued for processing
    • failed: The request has been rejected by the api and will not be processed.
    • sent: The message has been sent to the operator and we have not received an acknowledgment yet.
    • delivered: Message has been delivered to destination and we have received confirmation from the operator.
    • undelivered: We have received a delivery receipt from the operator that the message was not delivered.
    • read: Message was delivered and read.
    • ok: Operation was successful
    • error: An error occurred during operation
    Example: delivered
    detailstring
    • delivered_to_operator: The message has been delivered to the operator. Associated with delivered state
    • delivered_to_recipient: The message has been delivered to the recipient. Associated with delivered state.
    • rejected_by_operator: The message has been rejected by the operator. Associated with undelivered status.
    • undelivered_to_recipient: The message has been delivered but rejected by the target device. Associated with undelivered state.
    Example: delivered_to_carrier
    errorCodeinteger

    Error code for the operation

    errorMessagestring

    Description of the error.

    Example: Invalid message length
    timestampstring<date-time>

    Date and time when the status was observed expressed in ISO 8601 format.

    Example: 2020-06-17T04:17:21.06Z
    umidstring<uuid>required

    Unique message id (guid) generated by 8x8 CPaaS platform upon message submission

    user objectrequired

    User information

    msisdnstring

    Mobile phone number (MSISDN) to send the message to. International phone number format with '+ sign prefered. In addition we support national (local) phone numbers, please set country field to use it.

    Example: +6500000000
    countrystring

    Default country code (like 'sg', 'uk') for national phone numbers format. You don't need it if msisdn in E.164 format (with '+' sign at the beginning)

    Possible values: <= 2 characters

    Example: SG
    clientMessageIdstring

    Client managed id for the message: your own unique reference

  • ]
{
"batchId":"cf3cbbf5-3e2d-ea11-815d-020897df5459",
"clientBatchId":"string",
"acceptedCount":0,
"rejectedCount":0,
"messages":[
{
"status":{
"state":"delivered",
"detail":"delivered_to_carrier",
"errorCode":0,
"errorMessage":"Invalid message length",
"timestamp":"2020-06-17T04:17:21.06Z"
},
"umid":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"user":{
"msisdn":"+6500000000",
"country":"SG"
},
"clientMessageId":"string"
}
]
}
{
"batchId":"cf3cbbf5-3e2d-ea11-815d-020897df5459",
"clientBatchId":"aaa_batch",
"acceptedCount":1,
"rejectedCount":1,
"messages":[
{
"umid":"d03cbbf5-3e2d-ea11-815d-020897df5459",
"user":{
"msisdn":"+6500000000"
},
"clientMessageId":"aaa-1",
"status":{
"state":"queued",
"timestamp":"2020-01-04T08:19:45.99Z"
}
},
{
"umid":"15bb8ad1-d06e-418c-8dc7-ac8a00ffeb70",
"user":{
"msisdn":"+65000001"
},
"clientMessageId":"aaa-2",
"status":{
"state":"rejected",
"timestamp":"2020-01-04T08:19:45.99Z",
"errorCode":3038,
"errorMessage":"Template not found for provided name and language"
}
}
]
}

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

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/send-lon-messages · 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