logo
enes

Step 2 - Send an SMS

Last update: 7 days ago by Irais Aguirre

With the token obtained in the previous step, make a POST to the messaging endpoint, including the Bearer token in the

Authorization
header.


URLhttps://gateway.broadcastermobile.com/services/messaging
METHODPOST
HEADERSContent-Type: application/json
Authorization: Bearer [access_token]

Body

{
"msisdn": [numeric][required],
"dial": [string][required],
"message": [String][required],
"country": [string][recommended],
"carrier": [String][optional],
"mask": [String][optional],
"dataCoding": [String][optional],
"dlr": [Boolean][optional],
"schedule": [String][optional][format: ISO-8601],
"tag": [String][optional],
"msgClass": [numeric][optional],
"optionals": [String][optional]
}

ParametersDescriptionRequired
msisdnDestination phone number in international format, without the + sign. E.g.: 5215512345678.Yes
dialShortcode or source number. Digits only. E.g.: "5217000".Yes
messageText of the SMS to send.Yes
countryISO 3166-1 alpha-2 country code. E.g.: "MX", "CO", "PE". Send it whenever you can: it speeds up carrier resolution and reduces -40 errors.Recommended
carrierName of the destination carrier. If omitted, the system detects it automatically.No
maskAlphanumeric sender mask. Requires the capability to be enabled on your account.No
dataCodingMessage encoding. Omit this field for automatic Unicode detection.No
dlrtrue to request a delivery report. Default: false. See Delivery report (DLR).No
scheduleScheduled send date/time in ISO 8601 format. Must be a future date.No
tagFree-form label to identify the send in your reports.No
msgClassMessage class. Advanced use case.No
optionalsJSON as a string for advanced options (DLR type, RCS fallback, etc.).No

Do not send apiKey in the body. The system ignores it and takes it from the token automatically โ€” you do not need to include it.


Example

{
"msisdn": 5215512345678,
"dial": "5217000",
"message": "Your verification code is: 948271",
"country": "MX"
}

Successful response

{
"code": 0,
"mailingId": 4823910,
"result": "Applied",
"scheduledAt": null
}

FieldTypeDescription
codenumber0 = successful. Negative value = error.
mailingIdnumberUnique ID of the accepted message. Use it to track the send.
resultstring"Applied" when the message was accepted.
scheduledAtstringScheduled date (if you used schedule). null for immediate sends.
messagestringError description (present when code โ‰  0).
hintstringAdditional error detail to help with troubleshooting.

All endpoints return HTTP 200 OK. The actual result of the send is indicated in the body by the code field.


Delivery report (DLR)

If you want to know whether the SMS reached the recipient, enable the delivery report by adding dlr: true and the optionals field with registeredDelivery:

{
"msisdn": 5215512345678,
"dial": "5217000",
"message": "Hi, your order has been shipped",
"country": "MX",
"dlr": true,
"optionals": "{\"registeredDelivery\":1}"
}

DLR rules

  • If you send
    dlr: true
    , the
    optionals
    field must include
    registeredDelivery
    with a valid value.
  • If you include
    registeredDelivery
    in
    optionals
    ,
    dlr
    must be
    true
    .

Valid registeredDelivery values

ValueMeaning
1Notifies only on successful delivery.
5Notifies on delivery or on failure.
11Notifies on any status change.
External API โ€” Previous
Step 1 - Get the Token
Next
Error codes