Send All Channel
This API is used to send messages from the client system to the end user through various supported channels ( SMS, Email, Line, Telegram, Facebook Messenger and WhatsApp )
Endpoint
URL : {Base URL Send}/json/send/cgw
Method : POST
In addition to using a single channel, Sandeza also has a feature that allows you to send messages to all the channels available in Sandeza at once. This section describes the request parameters and provides JSON request examples for send a message using a single channel on Sandeza.
Description Parameter Request
FIELD | TYPE ALLOWED | MANDATORY | DESCRIPTION |
---|---|---|---|
signature | SHA 256 Hash | YES | Encrypted (Username+Password+Time), time refers to time field |
time | String (Unix timestamp) | YES | Current Request Time (Unix Timestamp) Example: Friday, November 1, 2024, 5:47:43 PM GMT+07:00 becomes “1730458063” |
type | N (Numeric) | YES | 1 (Send Primary Backup), 2 (Single channel / Send All) |
username | AN (Alpha Numeric) | YES | Username Division |
ref_id | AN (Alpha Numeric) (≤50) | YES | Unique Id generated by client (lowercase) |
subject | ANS (Alpha Numeric Space) (< 100) | YES | Sending Message Subject |
sender_id | ANS (Alpha Numeric Space) | YES | Sender Name (provided by sprint) |
budget_code | ANS (Alpha Numeric Space) | NO | Additional information, maximum 180 character |
channel | JSON Object | YES | Describe the channels used for sending messages Channel: SMS, Email, Line, Telegram, Facebook, WhatsApp |
sms | JSON Object | YES | Describes the message content and delivery configuration for the SMS channel |
message | Text | YES | Message to be sent Sample: YTH. Bapak/Ibu…… |
msisdn | N (Numeric), Plus (+) | YES | Mobile phone number, with 0, 62 or + |
backup_on | AN (Alpha Numeric) | NO | Format: status1;status2 Mapping: 1 – Unsent 2 – Undelivered 3 – Pending 4 – Failed Sample: 1;3 |
backup_exp | AN (Alpha Numeric) | NO | Expire in minutes. Except pending, set 0. Format: expire1;expire2 Sample: 0;10 |
use_backup_sender | Boolean | NO | Used to back up messages via SMS with credit deduction default “false” → Message backup is not enabled true → Message backup is active |
telegram | JSON Object | YES | Describes the message content and delivery configuration for the Telegram channel |
message | Text | YES | Body (non-HTML format) |
chat_id | AN (Alpha Numeric) | YES | Social id / metadata id |
attachment | Text | NO | Path Format: https://Path/filename Note: https protocol is a must File Extension: Line: jpg, png Telegram: jpg, png, pdf, mp4 Facebook: jpg, png, xls, xlsx, pdf, ppt, pptx, doc, docx, wav, mp4, txt Max File Size: 5MB/file Separator: “;” Sample: https://www.domain.com/test.pdf; https://www.domain.com/test2.pdf |
backup_on | AN (Alpha Numeric) | NO | Format: status1; status2 Mapping: 1 – Unsent 3 – Pending 4 – Failed Sample: 1;4 |
backup_exp | AN (Alpha Numeric) | NO | Expire in minutes. Except pending, set 0. Format: expire1; expire2 Sample: 0;0 |
JSON Object | YES | Describes the message content and delivery configuration for the Email channel | |
message | Text | NO | If not using a template, you can write free text. Static with template: This value can empty Dynamic with template: Dynamic Values Separator: “:” dan “;" Sample: nama:Sprint;alamat:Jl. Fatmawati |
Valid Email Format | YES | Must be a valid email format | |
attachment | Text | NO | Path Format: https://Path/filename Note: https protocol is a must File Extension: Email: jpg, png, xls, xlsx, pdf, ppt, pptx, doc, docx, wav, mp4, txt Max Size: 5MB/file Separator: “;” Sample: https://www.domain.com/test.pdf; https://www.domain.com/test2.pdf |
template_id | AN (Alpha Numeric) | NO | Id template generated from sandeza web Template_id mandatory, If the email is sent using a template Then param message follows dynamic parameters |
backup_on | AN (Alpha Numeric) | NO | Format: status1; status2 Mapping: 1 – Unsent 2 – Undelivered 3 – Pending 5 – Spam 6 – Bounced 7 – Blacklist Sample: 1;3 |
backup_exp | AN (Alpha Numeric) | NO | Expire in minutes. Except pending, set 0. Format: expire1; expire2 Sample: 0;5 |
line | JSON Object | YES | Describes the message content and delivery configuration for the Line channel |
message | Text | YES | Body (non-HTML format) |
chat_id | AN (Alpha Numeric) | YES | Social id / metadata id |
attachment | Text | NO | Path Format: https://Path/filename Note: https protocol is a must File Extension: Line: jpg, png Telegram: jpg, png, pdf, mp4 Facebook: jpg, png, xls, xlsx, pdf, ppt, pptx, doc, docx, wav, mp4, txt Max File Size: 5MB/file Separator: “;” Sample: https://www.domain.com/test.pdf; https://www.domain.com/test2.pdf |
backup_on | AN (Alpha Numeric) | NO | Format: status1; status2 Mapping: 1 – Unsent 3 – Pending 4 – Failed Sample: 1;4 |
backup_exp | AN (Alpha Numeric) | NO | Expire in minutes. Except pending, set 0. Format: expire1; expire2 Sample: 0;0 |
JSON Object | YES | Describes the message content and delivery configuration for the WhatsApp channel | |
message | Text | NO | Static with template: This value can empty |
msisdn | N (Numeric), Plus (+) | YES | Mobile phone number, with 0, 62 or + |
attachment | Text | NO | Path Format: https://Path/filename Note: https protocol is a must File Extension: WhatsApp: jpg, png, xls, xlsx, pdf, ppt, pptx, doc, docx, wav, mp4, txt Max Size: 5MB/file Separator: “;” Sample: https://www.domain.com/test.pdf; https://www.domain.com/test2.pdf |
template_id | AN (Alpha Numeric) | YES | Template Id registered |
backup_on | AN (Alpha Numeric) | NO | Format: status1; status2 Mapping: 1 – Unsent 2 – Undelivered 3 – Pending 4 – Failed 9 – Delivered Sample: 2;3 |
backup_exp | AN (Alpha Numeric) | NO | Expire in minutes. Except pending, set 0. Format: expire1; expire2 Sample: 0;10 |
Sample JSON Request
{
"signature": "<encrypted SHA 256 : username+password+time>",
"time": "<current timestamp (Unix Timestamp)>",
"type": "2",
"username": "<value from sprint>",
"ref_id": "<generated by client>",
"subject": "example subject",
"sender_id": "<value from sprint>",
"budget_code": "<generated by client>",
"channel": {
"sms": {
"message": "tes sandeza send all",
"msisdn": "62858xxxxxxxx ",
"backup_on": "",
"backup_exp": "",
"use_backup_sender": "false"
},
"telegram": {
"message": "tes sandeza send all",
"chat_id": "39673xxxx",
"attachment": "https://media.sandeza.id/Marketing/sandeza.png",
"backup_on": "",
"backup_exp": ""
},
"email": {
"message": "tes sandeza send all",
"email": "admin@sprintasia.co.id",
"attachment": "",
"template_id": "",
"backup_on": "",
"backup_exp": ""
},
"line": {
"message": "tes sandeza send all",
"chat_id": "U4a5d496a17259bde9788507064xxxxxx",
"attachment": "https://media.sandeza.id/Marketing/Sandeza.pdf",
"backup_on": "",
"backup_exp": ""
},
"whatsapp": {
"message": "",
"msisdn": "62858xxxxxxxx ",
"attachment": "",
"template_id": "thankyou_chatbot",
"backup_on": "",
"backup_exp": ""
}
}
}