Documentation de l'API pour envoyer des SMS

Server and authentication
All request made to SMS Scheduler API :
  • Use the following base path : https://sms-scheduler.com/api/v1
  • Send and receive data in JSON format
  • Need authentication with a bearer token in the Authorization header. The token can be generated (and regenerated) in your account page

Host: https://sms-scheduler.com/api/v1
Content-Type: application/json; charset=utf-8
Authorization: Bearer [YourApiKey]
                        
POST/smsCreate an SMS (to one or multiple phone numbers)

REQUEST

Request body

TypeNameRequiredDescription
stringmessage_texttrueThe content of the message
booleanmessage_stopfalseIf set to true, STOP mention will be added to the end of the message (default to false)
stringdelivery_datetrueThe date the message will be send to. If the date is equal or inferior to the current date, the SMS will be sent right away
integersender_idtrueThe sender ID available on "Senders" page in SMS Scheduler when you are logged in
arrayphone_numberstrueThe phone numbers you want to send the message to with the country prefix and without spaces or hyphens (ex : +33123456789). It can be a String for a single number or an Array for multiple numbers.
{
    "message_text": "Hello world",
    "message_stop": false,
    "delivery_date": "2020-12-25 12:45:59",
    "sender_id": 123,
    "phone_numbers": [
        "+33612345678",
        "+33202020202",
        "+49303030303"
    ]
}

RESPONSES

200 OK

TypeNameDescription
object
integermessage_idThe message id
objectsms_idsList of sms ids indexed by phone numbers
{
    "message_id": 123456,
    "sms_ids": {
        "+33612345678": 123456,
        "+33202020202": 123457,
        "+49303030303": 123458
    }
}

400 Bad Request

TypeNameDescription
object
objecterrorsList of error messages indexed by field names
{
    "errors": {
        "message_stop": [
            "The field \"message_stop\" must be a value of type \"boolean\""
        ],
        "phone_numbers": [
            "The field \"phone_numbers\" must be a list of type \"string\"",
            "The following phone number is invalid: +123456789"
        ]
    }
}

401 Unauthorized

GET/sms/{id}Get sending report of a particular SMS

REQUEST

Parameters

TypeNameRequiredDescription
integeridtrueThe id of the SMS

RESPONSES

200 OK

TypeNameDescription
object
stringphone_numberThe recipient's phone number
integerstatusThe sending status of the SMS
integer10Scheduled
integer11Pending
integer12Sent
integer13Received
integer19Cancelled - Sender not validated
integer20Cancelled - Missing contact or phone number
integer21Cancelled - Missing text message
integer22Cancelled - Invalid phone number
integer23Cancelled - Missing sender
integer24Cancelled - Invalid sender
integer25Cancelled - Not enough credits
integer26Cancelled - Blacklisted contact or phone number
integer27Cancelled - End of validity period
integer28Cancelled - Unavailable country
integer29Cancelled - Error
integer30Missed - Invalid phone number
integer31Missed - Blacklisted phone number or blocked by phone carrier
integer32Missed - End of validity period
integer33Missed - Network not available on sending phone
integer38Missed - Sending failed (Unknown reason)
integer39Missed - Error
integer40Postponed - Network error (code 40)
integer41Postponed - Network error (code 41)
{
    "phone_number": "+33612345678",
    "status": 13
}

401 Unauthorized

404 Not Found

DELETE/sms/{id}Delete a SMS by its ID

REQUEST

Parameters

TypeNameRequiredDescription
integeridtrueThe id of the SMS

RESPONSES

200 OK

TypeNameDescription
object
booleansuccessTrue if the SMS has been deleted
{
    "success": true
}

401 Unauthorized

404 Not Found

GET/message/{id}Get sending report of all SMS sent with a particular message

REQUEST

Parameters

TypeNameRequiredDescription
integeridtrueThe id of the message

RESPONSES

200 OK

TypeNameDescription
array
object
integeridThe unique ID of the corresponding SMS
stringphone_numberThe recipient's phone number
integerstatusThe sending status of the SMS
integer10Scheduled
integer11Pending
integer12Sent
integer13Received
integer19Cancelled - Sender not validated
integer20Cancelled - Missing contact or phone number
integer21Cancelled - Missing text message
integer22Cancelled - Invalid phone number
integer23Cancelled - Missing sender
integer24Cancelled - Invalid sender
integer25Cancelled - Not enough credits
integer26Cancelled - Blacklisted contact or phone number
integer27Cancelled - End of validity period
integer28Cancelled - Unavailable country
integer29Cancelled - Error
integer30Missed - Invalid phone number
integer31Missed - Blacklisted phone number or blocked by phone carrier
integer32Missed - End of validity period
integer33Missed - Network not available on sending phone
integer38Missed - Sending failed (Unknown reason)
integer39Missed - Error
integer40Postponed - Network error (code 40)
integer41Postponed - Network error (code 41)
[
    {
        "id": 123456,
        "phone_number": "+33612345678",
        "status": 13
    }
]

401 Unauthorized

404 Not Found

DELETE/message/{id}Delete multiple SMS by their message ID

REQUEST

Parameters

TypeNameRequiredDescription
integeridtrueThe id of the message

RESPONSES

200 OK

TypeNameDescription
object
integersuccessThe number of SMS deleted
{
    "success": 3
}

401 Unauthorized

404 Not Found