GSM API
Start sending messages using the API Key (provided in the profile section of your account) and the URL provided by the admin.
Send Broadcast
Endpoint
POST https://wa20.nuke.co.in/webhook/api/addbroadcastgsm.php
Authentication
Send a JWT in one of these ways:
| Method | Example |
|---|---|
| Header | Authorization: Bearer <jwt_token> |
| Cookie | auth_token=<jwt_token> |
Alternatively, you can pass username directly in the request body — if present, it's used instead of the JWT.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | No* | Your account username. Only needed if not sending a JWT. *One of username or a valid JWT is required. |
broadcast_name | string | Yes | Any label for this broadcast (max 100 characters, gets trimmed if longer). |
brodcast_service | string | Yes | Route/service to send through — used as the SMS route (e.g. sms_credits). (Note: this parameter name is spelled without the "a" — keep it as-is, it's not a typo you need to fix on your end.) |
contacts | array | Yes | Phone numbers with country code. Non-digit characters (+, spaces, -) are stripped automatically. |
message | string | Yes | The SMS text to send. |
providermessageid | string | No | Optional custom ID for this request. Accepts providermessageid, provider_message_id, or providerMessageId. If not given, one is auto-generated as GSMCAMP_YYYYMMDD_XXXXXX. |
Example Request
POST https://{{url}}/webhook/api/addbroadcastgsm.php
Authorization: Bearer eyJhbGciOi...
Content-Type: application/json
{
"broadcast_name": "anything",
"brodcast_service": "sms_credits",
"contacts": ["919912345678", "918812345678"],
"message": "message_test"
}
cURL Example
curl -X POST "https://{{url}}/webhook/api/addbroadcastgsm.php" \
-H "Authorization: Bearer eyJhbGciOi..." \
-H "Content-Type: application/json" \
-d '{
"broadcast_name": "anything",
"brodcast_service": "sms_credits",
"contacts": ["919912345678", "918812345678"],
"message": "message_test"
}'
Example Response — 200 OK
{
"request_id": "GSMCAMP_20260711_138476",
"status": "PP1",
"message": "Success",
"url": "1",
"username": "yourusername",
"Credits": 4
}
Note:
statusin the actual response is"PP1"(the internal in-progress code), not"Queued"as shown in older examples — update any client code that checks for"Queued"to check for"PP1"instead.
Response Fields
| Field | Description |
|---|---|
request_id | Unique ID for this broadcast — either your providermessageid or an auto-generated GSMCAMP_... ID. Use this to track delivery later. |
status | Current status of the request. PP1 = accepted and queued for sending. |
message | "Success" if the request was accepted. |
url | Static value, always "1". |
username | The username the broadcast was sent under. |
Credits | Total credits deducted for this broadcast (per-message cost × number of contacts). |
How Credits Are Calculated
Cost depends on message length and whether the message contains Unicode characters (e.g. emojis, non-English scripts).
Plain (GSM 7-bit) messages:
| Message Length | Credits per contact |
|---|---|
| Up to 160 chars | 1 |
| 161–306 chars | 2 |
| 307–459 chars | 3 |
| 460–612 chars | 4 |
| Over 612 chars | Rejected — "Message is too long" |
Unicode messages:
| Message Length | Credits per contact |
|---|---|
| Up to 70 chars | 1 |
| 71–133 chars | 2 |
| 134–199 chars | 3 |
| 200–265 chars | 4 |
| 266–331 chars | 5 |
| Over 331 chars | Rejected — "Message is too long" |
Total deduction = credits per contact × number of valid contacts.
If your available gsm_credits balance is lower than the total required, the request is rejected with a 400 and both your available and required credit counts are shown in the error message.
Validation Rules
- Each contact number must be 9 to 30 digits after stripping non-numeric characters. Anything outside this range fails the entire request with a
400. broadcast_name,brodcast_service,contacts, andmessagemust all be present and non-empty.- Requests are rate-limited to 10 per minute per username + IP combination. Exceeding this returns a
429.
Error Responses
| Status | Message | Reason |
|---|---|---|
| 405 | Method not allowed | Request method is not POST. |
| 401 | Invalid Authorization token | No valid JWT and no username in body. |
| 429 | Too many requests. Please try again later. | More than 10 requests in 60 seconds from the same username/IP. |
| 400 | broadcast_name, brodcast_service, contacts, and message are required | One or more required fields missing. |
| 400 | Each contact number must be between 9 and 30 digits | A contact number is too short or too long after cleanup. |
| 400 | Message is too long | Message exceeds the max length for its encoding type (see credit table above). |
| 400 | Insufficient credits. Available: X, Required: Y | Not enough gsm_credits balance to cover the broadcast. |
| 500 | Database connection failed / various insert/prepare errors | Server/database error. |
GET/HTTP API
https://{{url}}/v5/api/sms_get.php?username=username&password=123456&message=Hello&number=91123456
(Unchanged — no updated backend code was provided for this endpoint.)
For reporting setup, webhook. Check the link to setup the webhook https://autobotchat.readme.io/reference/report-webhook
