Developer Documentation

BLACK API Documentation

Complete guide to integrate OTP, WhatsApp OTP and Bulk SMS campaigns with your application — REST endpoints, ready-to-run snippets and response formats.

4
Endpoints
3
Languages
JSON
Responses

Integration Steps

  1. 1

    Set Up Your Environment

    Make sure you have PHP with the cURL extension enabled on your server.

  2. 2

    Get Your API Key

    Sign in to your dashboard and copy the API key shown in the sidebar.

    YOUR_API_KEY
  3. 3

    Implement the API Call

    Use the code examples below to integrate the API in your application.

API Endpoints

SMS OTP

POSThttps://blacksms.in/sms

WhatsApp OTP

POSThttps://blacksms.in/wasms

Quick SMS (GET / POST)

GET / POSThttps://blacksms.in/quick-sms

Bulk SMS Campaign

POSThttps://blacksms.in/endpoints/v1/bulk-sms

Request Format

1. OTP Send API (SMS & WhatsApp)

Headers

HeaderTypeValueRequired
AuthorizationStringYour API keyYes
Content-TypeStringapplication/jsonYes

Body parameters

ParameterTypeDescriptionRequired
sender_idStringYour approved sender IDYes
variables_valuesStringThe OTP value to send (4-6 digits)Yes
numbersStringRecipient's 10-digit mobile numberYes
routeIntegerThe route to use (1 to 9)No (default: 1)

2. Bulk SMS Campaign API

Headers

HeaderTypeValueRequired
AuthorizationStringYour API keyYes
Content-TypeStringapplication/jsonYes

Body parameters

ParameterTypeDescriptionRequired
titleStringCampaign reference title (e.g. "Promo broadcast")Yes
messageStringMessage content (max 160 GSM chars / 70 Unicode chars)Yes
contactsArrayArray of valid 10-digit mobile numbers, e.g. ["9876543210","9123456789"]Yes

Code Examples

OTP Sending API

curl -X POST https://blacksms.in/sms \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sender_id": "YOUR_SENDER_ID", "variables_values": "123456", "numbers": "9876543210", "route": 1}'

Bulk SMS Campaign API

curl -X POST https://blacksms.in/endpoints/v1/bulk-sms \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "Promo Campaign", "message": "Check out our services!", "contacts": ["9876543210", "9123456789"]}'

Response Format

1. OTP Sending API Response

Success

{ "status": 1, "message": "OTP Sent" }

Error

{ "status": 0, "message": "Error description details" }

2. Bulk SMS Campaign API Response

Success

{
  "success": true,
  "message": "Bulk SMS Campaign created successfully.",
  "campaign_id": 12,
  "provider_campaign_id": "98124",
  "total_contacts": 2,
  "sms_parts": 1,
  "total_cost": 0.40,
  "tracking_url": "https://blacksms.in/bulk-sms/campaign/12",
  "invalid_ignored": 0,
  "invalid_list": []
}

Error

{
  "success": false,
  "message": "Error description details"
}