Skip to Content

Send SMS

POST/subscriber-management/actions/send-smsService & Plan ManagementOpenAPI

Sends an SMS message to one or more SIMs.

Auth Scope
urn:grt:gemm
Content-Type
application/json
Base URL
https://gemmapi2.granitenet.com/v2/api/gemm/v1

Uses and Requirements

Response Behavior

The Send SMS API responds either synchronously or asynchronously, depending on the number of SIMs and the SIM’s carrier:

RequestResponse
1 SIM on carrier WEBNG, POD19IOT, POD19ABIR, TMO or TMOCCSynchronous. The SMS is sent immediately and the response contains the result.
1 SIM on carrier VZW (Verizon)Asynchronous. The response contains only a transactionID. The result is sent later in a callback.
2 to 1,000 SIMs (any supported carrier)Asynchronous. The response contains only a transactionID. One callback is sent for each SIM, all with the same transactionID.

Validation

  • All requests: each ICCID must be 19 or 20 characters (numeric, with F allowed as the 20th character), ICCIDs must be unique, and the message must be 1 to 140 characters. If any check fails, Mobility rejects the whole request with HTTP 400.
  • Single SIM: the SIM must also belong to your account, be in Activated status, be on a supported carrier, and have no other request in progress. Mobility checks these before it sends the SMS.
  • Bulk SIMs: Mobility checks the status and carrier of each SIM during processing. A SIM that fails these checks is reported as a failure in its callback. The other SIMs are still processed.

HTTP Status Codes

StatusWhen
200Single SIM on WEBNG, POD19IOT, POD19ABIR, TMO or TMOCC: the SMS was sent and the response contains a transactionID and result.status success. Single SIM on VZW, or 2 to 1,000 SIMs: the request was accepted and only a transactionID was returned. The result for each SIM is sent later in a callback. A synchronous single-SIM request also returns 200 with the carrier gateway's own response (result.status failure) when the gateway call itself returned an error status, so check result.status.
400Validation failed (an ICCID that is not 19-20 characters, duplicate ICCIDs, more than 1,000 SIMs, or a message that is missing or longer than 140 characters). For a single SIM, also when the SIM was not found, is not Activated, is on an unsupported carrier or already has a request in progress, or when a synchronous carrier rejected the SMS (the body is then the carrier gateway's response, not the standard error format).
401The bearer token is missing, invalid or expired, or you do not have access to the account in the macnum header.
403Send SMS is not enabled for your account, or your token's role does not allow this action. For a single SIM, also when the SIM belongs to an account you do not have access to or that is not under the account in the macnum header.
429Too many requests were sent in a short period. Wait briefly and retry.
500An unexpected server error occurred.
503The system is under scheduled maintenance. Retry after the maintenance window.
504A dependent service did not respond in time. Retry the request.

Headers

HeaderValue
AuthorizationBearer access-token
Content-Typeapplication/json
macnumMacnum of the top level account for your organization.

Request Body Parameters

ParameterTypeRequiredDescription
simsarray of simInfo objectsYesUp to 1,000 SIMs to send the message to, specified by simInfo objects.
simInfoobjectYesSIM information.
iccidstringYes19-20 digits. An F is allowed as the 20th character.
messagestringYesThe message that you want to send, 1 to 140 characters.

Request Examples

Responses

Synchronous Success Response (200 OK)

Response Fields

ParameterTypeDescription
transactionIDstringA unique string that identifies the request.
resultobjectAn object containing the result status.
statusstringResult status: success or failure.
messagestringResult message.

Asynchronous Immediate Success Response (200 OK)

Response Fields

ParameterTypeDescription
transactionIDstringA unique string that associates the request with the results sent in callbacks.
Mobility sends a separate callback for each SIM that matched the request, showing whether the operation succeeded for that SIM and containing any requested information. All callbacks for the request have the same transactionID.

Callback Success Response

Callback Response Fields

ParameterTypeDescription
requestTypestringName of the requested action. For Send SMS, the value is SendSms.
transactionIDstringA unique string that associates the request with the results sent in callbacks. Mobility sends a separate callback for each SIM that matched the request, showing whether the operation succeeded for that SIM and containing any requested information. All callbacks for the request have the same transactionID.
simInfoobjectSIM information.
iccidstring19-20 digits.
msisdnstring10 digits.
resultobjectAn object containing the result status.
statusstringResult status: success or failure.
messagestringResult message.
errorsobjectA list of error objects, if any.
errorCodestringError code.
errorMessagestringError message.
callbackCountintegerThe number of times this callback message has been sent.
maxCallbackThresholdintegerThe maximum number of times this callback message will be sent if it is not correctly acknowledged.

Failure Responses

Immediate Error Message

Error Response Fields

ParameterTypeDescription
resultobjectAn object containing the result status.
statusstringResult status: success or failure.
errorsobjectA list of error objects, if any.
errorCodestringError code.
errorMessagestringError message.

Single SIM, Carrier Error

For a single SIM on a synchronous carrier (WEBNG, POD19IOT, POD19ABIR, TMO or TMOCC), a carrier-side rejection returns the carrier gateway’s own response instead of the format above. Check result.status rather than relying on the HTTP status alone — the response is HTTP 200 when the gateway call itself returned an error status, and HTTP 400 when the gateway responded successfully but with result.status failure.

Error Response Fields

ParameterTypeDescription
carrierKeystringThe unique identifier of the SIM's carrier.
requestTypestringName of the requested action. For Send SMS, the value is SendSms.
transactionDateTimestringThe timestamp when the transaction was initiated.
transactionKeystringA unique identifier for tracking the request and response.
resultobjectAn object containing the result status.
statusstringResult status: success or failure.
messagesarray of objectsAdditional information about the result.
codestringSuccess or Failure.
gatewayMessagestringThe gateway message that shows whether the request completed or failed.
carrierMessagestringThe message returned by the carrier, when one is available.

Example Failure Callback: Verizon or Bulk SIMs

Error Response Fields

ParameterTypeDescription
requestTypestringName of the requested action. For Send SMS, the value is SendSms.
transactionIDstringThe transactionID returned in the immediate response. All callbacks for a request have the same transactionID.
simInfoobjectSIM information.
iccidstring19-20 digits.
msisdnstring10 digits.
resultobjectAn object containing the result status.
statusstringResult status: failure.
errorsarray of objectsA list of error objects.
errorCodestringError code.
errorMessagestringError message.
callbackCountintegerThe number of times this callback message has been sent.
maxCallbackThresholdintegerThe maximum number of times this callback message will be sent if it is not correctly acknowledged.

Code Examples

Last updated on