Penjelasan komponen :
Send Broadcast Text
Body :
{
"name":"your-broadcast-name",
"channel":"channel-used-for-broadcast",
"sendingMode":"sending-mode",
"scheduledDate":"2021-01-01 23:30:334",
"content" : [
{
"type" : "text",
"message": "First broadcast"
}
]
}
Response : 200
{
"status": "success",
"data": {
"id": "[broadcast-id]"
},
"message": "Successfully make Broadcast Item",
"hasMore": false,
"nextIndex": 0,
"prevIndex": 0,
"totalResults": 0
}
Send Broadcast Image
Body :
{
"name":"your-broadcast-name",
"channel":"channel-used-for-broadcast",
"sendingMode":"sending-mode",
"scheduledDate":"2021-01-01 23:30:334",
"content" : [
{
"type": "image",
"url": "your-url-for-video", | url https, format jpg/png
},
]
}
Response : 200
{
"status": "success",
"data": {
"id": "[broadcast-id]"
},
"message": "Successfully make Broadcast Item",
"hasMore": false,
"nextIndex": 0,
"prevIndex": 0,
"totalResults": 0
}
Send Broadcast Video
Body :
{
"name":"your-broadcast-name",
"channel":"channel-used-for-broadcast",
"sendingMode":"sending-mode",
"scheduledDate":"2021-01-01 23:30:334",
"content" : [
{
"type": "video",
"url": "your-url-for-video", | url https, format mp4
"thumbnailUrl" : "your-url-for-thumbnail"
}
]
}
Response : 200
{
"status": "success",
"data": {
"id": "[broadcast-id]"
},
"message": "Successfully make Broadcast Item",
"hasMore": false,
"nextIndex": 0,
"prevIndex": 0,
"totalResults": 0
}
Create Multiple Broadcast
Multiple broadcast memungkinkan Anda membuat lebih dari satu broadcast sekaligus.
Body :
[
*code untuk request broadcast pertama
{
"name":"your-broadcast-name",
"channel":"channel-used-for-broadcast",
"sendingMode":"sending-mode" Values: "Now" | "Scheduled"
"scheduledDate":"2021-01-01 23:30:334", | *Required saat sendingMode adalah Scheduled
"content" : [
{
"type" : "text",
"message": "First broadcast"
}
]
},
*code untuk request broadcast kedua
{
"name":"your-broadcast-name",
"channel":"channel-used-for-broadcast",
"sendingMode":"sending-mode" Values: "Now" | "Scheduled"
"scheduledDate":"2021-01-01 23:30:334", | *Required saat sendingMode adalah Scheduled
"content" : [
{
"type" : "text",
"message": "Second broadcast"
}
]
}
]
Response
Response status : 200
{
"status": "success",
"data": [
{
"id": "[id]",
"message": "Successfully make Broadcast Item",
"status": "success"
},
{
"id": "[id]",
"message": "Successfully make Broadcast Item",
"status": "success"
}
],
"hasMore": false,
"nextIndex": 0,
"prevIndex": 0,
"totalResults": 0
}
Get Broadcast detail by ID
Response
Response status : 200
{
"status": "success",
"data": {
"id": "your-broadcast-id",
"spell": [
"New Notification",
"{\"header\":[],\"body\":[{\"type\":\"static\",\"key\":\"{{1}}\",\"value\":\"{value}\"},{\"type\":\"static\",\"key\":\"{{2}}\",\"value\":\"{value}\"}]}"
],
"owner": "owner-id",
"createdDate": 1614657234000,
"createdBy": "created-by-id",
"modifiedDate": 1614657340548,
"modifiedBy": "system",
"templateId": "template-id",
"actionDate": 1614657339000,
"name": "New Notification",
"message": "{\"header\":[],\"body\":[{\"type\":\"static\",\"key\":\"{{1}}\",\"value\":\"{value}\"},{\"type\":\"static\",\"key\":\"{{2}}\",\"value\":\"{value}\"}]}",
"recipient": [
"{\"type\":\"contact\",\"id\":\"{recipient-id}\",\"phone\":\"{phone-number}\",\"selected\":true}"
],
"status": "Sent",
"channel": "your-channel-id",
"channelType": "your-channel-type",
"sendingMode": "Now",
"scheduledDate": 1614657339000,
"scheduledTime": "10:55"
},
"hasMore": false,
"nextIndex": 0,
"prevIndex": 0,
"totalResults": 0
}