Penjelasan komponen :
Token id yang tergenerate
Channel id dari channel yang Anda gunakan
Metode pengiriman yang akan Anda gunakan. Saat ini ada 2 mode pengiriman, yaitu : pengiriman langsung (now) dan pengiriman terjadwal (scheduled).
Possible value: Now, Scheduled
Tanggal dan waktu yang dijadwalkan untuk mengirim broadcast.
Format field: "yyyy-mm-dd hh:mm:sss"
Ya, saat mode pengiriman adalah 'Scheduled'
Id template yang ingin Anda gunakan untuk broadcast Anda.
Konten dari pesan broadcast Anda.
Catatan : Untuk Channel Line jumlah konten maksimal yang dapat dikirim dalam satu broadcast adalah 5.
Send Broadcast Text
https://[server]/dolphin/apiv1/graph/broadcast
Authorization: Bearer [generatedToken]
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
https://[server]/dolphin/apiv1/graph/broadcast
Authorization : Bearer [generatedToken]
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
https://[server]/dolphin/apiv1/graph/broadcast
Authorization : Bearer [generatedToken]
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.
Authorization : Bearer [generatedToken]
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
Authorization : Bearer [generatedToken]
Broadcast id: [broadcast 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
}