Ducksms
BlogWhatsapp Support
  • Welcome
  • Web Console
    • Bahasa
      • Gambaran Keseluruhan
      • Pendaftaran
      • Log Masuk
        • Log masuk ke Web Console
        • Lupa kata laluan
      • Papan pemuka
      • Id pengirim
        • Gambaran keseluruhan
        • Mencipta ID penghantar
      • SMS
        • Penghantaran SMS
        • SMS berjadual
        • Laporan penghantaran
        • Insight
      • Templat
      • Kredit
        • Tambah nilai
        • Sejarah
        • Kaedah Pembayaran
      • Kumpulan
        • Pelanggan
      • Tools
        • Smart Link
        • Bulk Contact Import
      • Akaun
        • Profil
        • Tukar password
        • Log keluar
      • Tapisan
      • Token API
        • Gambaran
        • Batalkan Token API
    • English
  • Developer
    • API Documentation
      • Overview
      • Quick Start
      • Authentication
      • API Reference
        • SMS
          • Send SMS
          • Schedule
            • Schedule List
            • Cancel Schedule
        • Sender ID
          • List Sender ID
          • Create Sender ID
          • Update Sender ID
          • Delete Sender ID
        • Credit
          • Balance
          • Credit History
        • Delivery Report (Webhook)
    • SDK (Github)
Powered by GitBook
On this page
  1. Developer
  2. API Documentation
  3. API Reference
  4. SMS

Send SMS

PreviousSMSNextSchedule

Last updated 2 years ago

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

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

mobile_numbers

List array of mobile numbers to be sent

yes

message

Message content

yes

sender_id

no

scheduled_at

Schedule a SMS

no

callback_url

Receive a message delivery report to your callback url

no

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 or create from the directly.

yes / no
yes
[
60121234567,
60131234567,
60141234567
]
Hello world
DUCKSMS
2022-12-06T15:19
https://webhook.site/2a88e4b4-56f7-46ee-b3a4-2f05d8b8456e
API Method Sender ID
Web Consol (Section: Sender ID)

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
201
Sms created
application/json
400
Invalid request
application/json
401
Unauthenticated
application/json
422
Validation errors
application/json
500
Server error
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
  }
}