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

Quick Start

PreviousOverviewNextAuthentication

Last updated 2 years ago

Getting Started

Before you begin, please make sure you already have a Ducksms API Token, or .

Using your Ducksms API TOKEN, available from the page, you can now send an SMS message using the available API Methods with a simple code.

Example using codes below to get a credit balance:

Replace the {API TOKEN} with your token

curl --request GET
--url https://ducksms.com/api/v1/credits/balance
--header 'Authorization: Bearer {API TOKEN}'
--header 'Content-Type: application/json'
--header 'accept: application/json'
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ducksms.com/api/v1/credits/balance', [
  'headers' => [
    'accept' => 'application/json',
    'content-type' => 'application/x-www-form-urlencoded',
    'Authorization' => 'Bearer {API TOKEN}'
  ],
]);

echo $response->getBody();
const request = require('request');

request({
  url: 'https://ducksms.com/api/v1/credits/balance',
  headers: {
     'accept': 'application/json',
     'content-type': 'application/x-www-form-urlencoded',
     'Authorization': 'Bearer {API TOKEN}'
  },
  rejectUnauthorized: false
}, function(err, res) {
      if(err) {
        console.error(err);
      } else {
        console.log(res.body);
      }

});
import requests

url = "https://ducksms.com/api/v1/credits/balance"

payload = "api_key=xxx"
headers = {
    "accept": "application/json",
    "content-type": "application/x-www-form-urlencoded",
    "Authorization": "Bearer {API TOKEN}"
}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://ducksms.com/api/v1/credits/balance")
  .post(body)
  .addHeader("accept", "application/json")
  .addHeader("content-type", "application/x-www-form-urlencoded")
  .addHeader("Authorization", "Bearer {API_TOKEN}")
  .build()

Response response = client.newCall(request).execute();

signup for a Ducksms account here
Web Console