Path, method and authentication


POST /api/sms
Host: https://sms-scheduler.com
Content-Type: application/json; charset=utf-8
Authorization: usename:password | Basic (base64)
All request made to SMS Scheduler API :
  • Use the following path : https://sms-scheduler.com/api/sms
  • Use POST method in JSON.
  • Need authentication with the email and password you used to logged in on our website.

Create SMS (to one or multiple phone numbers)

REQUEST


{
  "action": "create",
  "message": "My message",
  "delivery_date": 1573250000,
  "sender": "123",
  "phone_numbers": ["+330101010101", "+330202020202", "+490303030303", "0404-040-404"]
}
message (String - required) : Content of your message.
delivery_date (Int - required) : Timestamp for the 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.
sender (String - required) : The sender ID available on "Senders" page in SMS Scheduler when you are logged in.
phone_numbers (Array or String - required) : The 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.

RESPONSE


{
  "success": {
    "sms_id": 123456,
    "phone_numbers": ["+33601010101", "+33602020202", "+496303030303"]
  },
  "error": "Invalid phone_number",
  "invalid_phone_number": ["0404-040-404"]
}
success (Array) : If present, the SMS with the phone numbers inside have been created and are ready for sending.
  • sms_id (Int) : Unique ID representing the message. You should store it in your database in order to delete or update the message or to check if the corresponding SMS have been successfully sent.
  • phone_numbers (Array) : All phone numbers the message will be send to.
error (String) : If present, describe the error that occur when trying to create one or multiple SMS.
invalid_phone_number (Array) : If present, describe the phone numbers that were not properly formatted. No SMS will be created and send for this numbers.

Delete SMS

REQUEST


{
"action": "delete",
"sms_id": 123456
}
sms_id (Int - required) : The unique ID you received when the message was created.

RESPONSE


// example if success :
{
  "success": {
    "deleted": 3
  }
}
// example if failed :
{
  "error": "Wrong or invalid sms_id"
}
success (Array) : If present, the SMS that correspond to the message unique ID have been deleted successfully.
  • deleted (Int) : Number of SMS deleted.
error (String) : Reason of the error (sms_id variable is wrong).

Get SMS report

REQUEST


{
"action": "report",
"sms_id": 123456
}
sms_id (Int - required) : The unique ID you received when the message was created.

RESPONSE


// example if success :
{
  "success": {
    "sms_id": 123456,
    "report": [
      "Scheduled": [
        "+33601010101",
        "+496303030303"
      ],
      "Cancelled -- Blacklisted contact or phone number": [
        "+33602020202"
      ],
      "Missed -- Invalid phone number": [
        "+33602022356"
      ]
    ]
  }
}

// example if failed :
{
  "error": "Wrong or invalid sms_id"
}

success (Array) : If present, a report is available.
  • sms_id (Int) : Unique ID representing the message
  • report (Array) : List all SMS corresponding to the unique message ID
    • phone_number (String) : The corresponding phone number.
    • status (String) : The status of the sending. Possible values are :
      • Scheduled
      • Pending
      • Sent
      • Received
      • Cancelled -- Missing contact or phone number
      • Cancelled -- Invalid phone number
      • Cancelled -- Missing text message
      • Cancelled -- Invalid text message
      • Cancelled -- Missing sender
      • Cancelled -- Invalid sender
      • Cancelled -- Not enough credits
      • Cancelled -- Blacklisted contact or phone number
      • Cancelled -- End of validity period
      • Cancelled -- Unavailable country
      • Cancelled -- Error
      • Missed -- Invalid phone number
      • Missed -- Blacklisted phone number or blocked by phone carrier
      • Missed -- End of validity period
      • Missed -- Network not available on sending phone
      • Missed -- Sending failed (Unknown reason)
      • Missed -- Error
error (String) : Reason of the error (sms_id variables is wrong).