Send Primary Backup
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
Sandeza also has a Primary Backup messaging feature. If a message doesn’t receive the expected delivery status, Sandeza will automatically resend it using a different channel as a backup. This section describes the request parameters and provides JSON request examples for send a message using the Primary Backup feature in Sandeza, where the primary channel is SMS and the backup channel is email.
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 |
Sample JSON Request
{
"signature": "<encrypted SHA 256: username+password+time>",
"time": "<current timestamp (Unix Timestamp)>",
"type": "1",
"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 primary",
"msisdn": "62858xxxxxxxx ",
"backup_on": "1;2;3",
"backup_exp": "0;0;10",
"use_backup_sender": "true"
},
"telegram": {
"message": "tes sandeza backup",
"chat_id": "39673xxxx",
"attachment": "",
"backup_on": "",
"backup_exp": ""
}
}
}