[BETA] Send Single SMS with Compliance checking
Path
POSThttps://api.b3networks.com/v1/smsmarketing/messages
Authentication
All request must include x-credential-api-key
header. See Getting Started
Request Body: application/json
Name | Required | Type | Description |
dest | yes | string | The recipient number of the SMS. Phone numbers
should start with a "+" and country code
(E.164 format).
Example : "+6511111111" |
msg | yes | string | Contents of the SMS message. |
senderName | yes | string | This is the sender name that the recipient of your SMS will see. |
senderEmail | yes | string | This is the user’s email that is registered in system, it will be used to calculate the usage budget of that user. |
Optional request body attributes for organization with Global DNC activated
Name | Required | Type | Default | Description |
filterConsent | no | boolean | true | SMS destination will be filtered with Consent whitelist/blacklist. |
filterDnc | no | boolean | true | SMS destination will be filtered with Global PDPC DNC database. This only apply for Singapore destination. |
bypassReason | no | string | "" | bypassReason field only required when both filterDnc and filterConsent properties are false, and Global DNC app activated. |
Response: application/json
Status: 200 (OK)
Name | Type | Description |
txnRef | string | Txn id for this sms request Example:"86832607-1748-4547-9671-8e1708b91bb" |
Status: 400 (Bad request)
Name | Type | Description |
code | string | Possible error codesms.sameDestAsSender : SMS to the destination must not be the same as your sender number.sms.msgTooBig : msg property is too big sms.destNotSupported : SMS to this destination is currently not supported.sms.invalidSenderName : senderName param is invalidsms.blockedByDnc : Destination is blocked by PDPC DNCsms.blockedByConsent : Destination is blocked by Consent Black listsms.blockedDueToExpiredSubscription : Your account does not have valid subscription to send SMS |
Status: 500 (Error)
Name | Type | Description |
code | string | Possible error codes
sms.internalServerError
sms.cannotConnect2Pdpc |
Example
Send sms (Global DNC app not activated)
curl -X POST \ https://api.b3networks.com/v1/smsmarketing/messages \ -H 'x-credential-api-key=<API KEY>' -H 'content-type: application/json' \ -d '{ "msg": "Test SMS", "dest": "+65xxxxxxxx", "senderName": "YOUR_REGISTERED_SENDER_NAME", "senderEmail": "johny@gmail.com" }'
Send sms with compliance check (Global DNC app activated)
curl -X POST \ 'https://api.b3networks.com/smsmarketing/private/v1/messages?apiKey=' \ -H 'content-type: application/json' \ -d '{ "msg": "Test SMS", "dest": "+65xxxxxxxx", "senderName": "YOUR_REGISTERED_SENDER_NAME", "filterConsent": true, "filterDnc": true, "senderEmail": "johny@gmail.com" }
Send sms that bypass compliance checking (Global DNC app activated)
curl -X POST \ 'https://api.b3networks.com/smsmarketing/private/v1/messages?apiKey=' \ -H 'content-type: application/json' \ -d '{ "msg": "Test SMS", "dest": "+65xxxxxxxx", "senderName": "YOUR_REGISTERED_SENDER_NAME", "filterConsent": false, "filterDnc": false, "bypassReason": "Not for marketing purpose", "senderEmail": "johny@gmail.com" }'