Send SMS

Use this API Method to send a new SMS to your users.

Send Sms

post

Create a new sms

Authorizations
Body
previewstring · enumOptional

Preview the sms information

Example: yesPossible values:
mobile_numbersstring[] | nullableOptionalExample: ["60121234567","60131234567","60141234567","60151234567","60161234567","60171234567","60181234567"]
messagestring | nullableOptionalExample: Hello world
sender_idstring | nullableOptionalExample: DUCKSMS
scheduled_atstring | nullableOptionalExample: 2022-12-06T15:19
callback_urlstring | nullableOptionalExample: https://webhook.site/2a88e4b4-56f7-46ee-b3a4-2f05d8b8456e
Responses
200
Sms preview
application/json
post
POST /api/v1/sms/send HTTP/1.1
Host: ducksms.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 289

{
  "preview": "yes",
  "mobile_numbers": [
    "60121234567",
    "60131234567",
    "60141234567",
    "60151234567",
    "60161234567",
    "60171234567",
    "60181234567"
  ],
  "message": "Hello world",
  "sender_id": "DUCKSMS",
  "scheduled_at": "2022-12-06T15:19",
  "callback_url": "https://webhook.site/2a88e4b4-56f7-46ee-b3a4-2f05d8b8456e"
}
{
  "status": 200,
  "message": "Preview data return successfully",
  "data": {
    "scheduled_at": false,
    "sender_id": {
      "name": "DUCKSMS"
    },
    "mobile_number": [
      {
        "number": 60131234567
      },
      {
        "number": 60131234562
      }
    ],
    "credit": {
      "charge_per_sms": 1,
      "charge_per_number": 1,
      "charge": 1,
      "balance": 986762,
      "after": 986761
    },
    "message": {
      "type": "ascii",
      "total": 1,
      "length": 31,
      "message": "RM0 DUCKSMS: Hello World, Good morning!"
    },
    "callback_url": "https://webhook.site/2a88e4b4-56f7-46ee-b3a4-2f05d8b8456e",
    "contains_special_characters": false
  }
}

To schedule a SMS, just pass a parameter scheduled_at with datetime as a value.

List of parameters

Field
Description
Example Value
Required

preview

Preview a SMS information before confirm sent Accepted value:

yes / no
yes

yes

mobile_numbers

List array of mobile numbers to be sent

[
60121234567,
60131234567,
60141234567
]

yes

message

Message content

Hello world

yes

sender_id

Sender ID to use for sending the SMS If no Sender ID parameter, default Sender ID will be used. To create new Sender ID, you use API Method Sender ID or create from the Web Consol (Section: Sender ID) directly.

DUCKSMS

no

scheduled_at

Schedule a SMS

2022-12-06T15:19

no

callback_url

Receive a message delivery report to your callback url

https://webhook.site/2a88e4b4-56f7-46ee-b3a4-2f05d8b8456e

no

Last updated