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
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
- Array [
- Array [
- ]
- Array [
- ]
- ]
Customer batch ID. This value will be returned in DR "clientBatchId" field
Possible values: <= 100 characters
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
user objectrequired
User information
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.
+6500000000
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
SG
Client managed id for the message : your own unique reference
Possible values: <= 50 characters
abc-123
content objectrequired
Content of the Line Notification message
Message title
Event reminder
Company name
8x8
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
Label
Event name
Content
8x8 Conference
list object[]
Template list items
Label
Date
Content
Tue 26/09/2023
Greeting message
Can't wait to see you there!
Explanation
We would like to remind you about your reservation for tomorrow event
actions object[]
Template action list
Title
See direction
Url
https://www.google.com/maps
Override default DR callback URL for the message
smsFallback object
SMS fallback message text
Source number (SenderId) - "From" field for SMS. Max length 16 chars.
Possible values: <= 16 characters
Info
Encoding for the text of the message. "AUTO", "GSM7" and "UCS2"
Possible values: [AUTO, GSM7, UCS2]
AUTO
If 'True', then information about every message will be returned in API response
false
true
Success response
Schema
- Array [
- 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
- 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.
- ]
Batch ID, generated by 8x8
cf3cbbf5-3e2d-ea11-815d-020897df5459
Client batch ID from request
Possible values: <= 100 characters
Amount of accepted messages from batch
Possible values: >= 0 and <= 10000
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
status objectrequired
Delivery status of the message. Status contains the following information.
General status of the message. Possible values are
delivered
delivered_to_carrier
Error code for the operation
Description of the error.
Invalid message length
Date and time when the status was observed expressed in ISO 8601 format.
2020-06-17T04:17:21.06Z
Unique message id (guid) generated by 8x8 CPaaS platform upon message submission
user objectrequired
User information
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.
+6500000000
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
SG
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
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"
}
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/send-lon-messages · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments