GSM SMS API

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:

MethodExample
HeaderAuthorization: Bearer <jwt_token>
Cookieauth_token=<jwt_token>

Alternatively, you can pass username directly in the request body — if present, it's used instead of the JWT.

Body Parameters

ParameterTypeRequiredDescription
usernamestringNo*Your account username. Only needed if not sending a JWT. *One of username or a valid JWT is required.
broadcast_namestringYesAny label for this broadcast (max 100 characters, gets trimmed if longer).
brodcast_servicestringYesRoute/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.)
contactsarrayYesPhone numbers with country code. Non-digit characters (+, spaces, -) are stripped automatically.
messagestringYesThe SMS text to send.
providermessageidstringNoOptional 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: status in 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

FieldDescription
request_idUnique ID for this broadcast — either your providermessageid or an auto-generated GSMCAMP_... ID. Use this to track delivery later.
statusCurrent status of the request. PP1 = accepted and queued for sending.
message"Success" if the request was accepted.
urlStatic value, always "1".
usernameThe username the broadcast was sent under.
CreditsTotal 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 LengthCredits per contact
Up to 160 chars1
161–306 chars2
307–459 chars3
460–612 chars4
Over 612 charsRejected — "Message is too long"

Unicode messages:

Message LengthCredits per contact
Up to 70 chars1
71–133 chars2
134–199 chars3
200–265 chars4
266–331 chars5
Over 331 charsRejected — "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, and message must 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

StatusMessageReason
405Method not allowedRequest method is not POST.
401Invalid Authorization tokenNo valid JWT and no username in body.
429Too many requests. Please try again later.More than 10 requests in 60 seconds from the same username/IP.
400broadcast_name, brodcast_service, contacts, and message are requiredOne or more required fields missing.
400Each contact number must be between 9 and 30 digitsA contact number is too short or too long after cleanup.
400Message is too longMessage exceeds the max length for its encoding type (see credit table above).
400Insufficient credits. Available: X, Required: YNot enough gsm_credits balance to cover the broadcast.
500Database connection failed / various insert/prepare errorsServer/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