Integration Steps
- 1
Set Up Your Environment
Make sure you have PHP with the cURL extension enabled on your server.
- 2
Get Your API Key
Sign in to your dashboard and copy the API key shown in the sidebar.
YOUR_API_KEY - 3
Implement the API Call
Use the code examples below to integrate the API in your application.
API Endpoints
SMS OTP
POST
https://blacksms.in/smsWhatsApp OTP
POST
https://blacksms.in/wasmsQuick SMS (GET / POST)
GET / POST
https://blacksms.in/quick-smsBulk SMS Campaign
POST
https://blacksms.in/endpoints/v1/bulk-smsRequest Format
1. OTP Send API (SMS & WhatsApp)
Headers
| Header | Type | Value | Required |
|---|---|---|---|
| Authorization | String | Your API key | Yes |
| Content-Type | String | application/json | Yes |
Body parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| sender_id | String | Your approved sender ID | Yes |
| variables_values | String | The OTP value to send (4-6 digits) | Yes |
| numbers | String | Recipient's 10-digit mobile number | Yes |
| route | Integer | The route to use (1 to 9) | No (default: 1) |
2. Bulk SMS Campaign API
Headers
| Header | Type | Value | Required |
|---|---|---|---|
| Authorization | String | Your API key | Yes |
| Content-Type | String | application/json | Yes |
Body parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| title | String | Campaign reference title (e.g. "Promo broadcast") | Yes |
| message | String | Message content (max 160 GSM chars / 70 Unicode chars) | Yes |
| contacts | Array | Array 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"
}