Skip to main content

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
FIELDTYPE ALLOWEDMANDATORYDESCRIPTION
signatureSHA 256 HashYESEncrypted (Username+Password+Time), time refers to time field
timeString
(Unix timestamp)
YESCurrent Request Time (Unix Timestamp)
Example: Friday, November 1, 2024, 5:47:43 PM GMT+07:00 becomes “1730458063”
typeN (Numeric)YES1 (Send Primary Backup), 2 (Single channel / Send All)
usernameAN (Alpha Numeric)YESUsername Division
ref_idAN (Alpha Numeric) (≤50)YESUnique Id generated by client (lowercase)
subjectANS (Alpha Numeric Space) (< 100)YESSending Message Subject
sender_idANS (Alpha Numeric Space)YESSender Name (provided by sprint)
budget_codeANS (Alpha Numeric Space)NOAdditional information, maximum 180 character
channelJSON ObjectYESDescribe the channels used for sending messages
Channel: SMS, Email, Line, Telegram, Facebook, WhatsApp
smsJSON ObjectYESDescribes the message content and delivery configuration for the SMS channel
messageTextYESMessage to be sent
Sample:
YTH. Bapak/Ibu……
msisdnN (Numeric), Plus (+)YESMobile phone number, with 0, 62 or +
backup_onAN (Alpha Numeric)NOFormat: status1;status2
Mapping:
1 – Unsent
2 – Undelivered
3 – Pending
4 – Failed
Sample:
1;3
backup_expAN (Alpha Numeric)NOExpire in minutes.
Except pending, set 0.
Format: expire1;expire2
Sample:
0;10
use_backup_senderBooleanNOUsed to back up messages via SMS with credit deduction
default “false” → Message backup is not enabled
true → Message backup is active
telegramJSON ObjectYESDescribes the message content and delivery configuration for the Telegram channel
messageTextYESBody (non-HTML format)
chat_idAN (Alpha Numeric)YESSocial id / metadata id
attachmentTextNOPath 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_onAN (Alpha Numeric)NOFormat: status1; status2
Mapping:
1 – Unsent
3 – Pending
4 – Failed
Sample:
1;4
backup_expAN (Alpha Numeric)NOExpire 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": ""
}
}
}