SMS API


SMS API

A simple, reliable service for sending SMS messages worldwide.

Add SMS message sending into your algorithms and business procedures, and get an instant, global communication method.

 

Use cases

SMS appointments and reminders

By sending appointment reminders via SMS, you can ensure that customers follow your schedule. Running an organisation that receives visitors by appointment? Avoid oversights and delays with SMS reminders.

REMINDER: You have an appointment on 15/09/23, 11:00 at St Mark’s Hospital.

Marketing SMS campaigns

With the high read rates offered by SMS communication, you can improve ROI for communication campaigns, announce events, and much more. Manage your contact file in one click with bulk sending, plus immediate or scheduled sending options.

Happy birthday, Eric! You get double loyalty points on your birthday.

Transactional SMS messages

Stay in touch with your customers, automatically inform your recipients when a package is sent, and manage your teams' tasks via SMS. You can also send reminders and alerts with acknowledgement of receipt.

Parcel 13618678 must be picked up before 05/11/23 at your chosen Collection Point in Walthamstow.

SMS Alert - SMS Monitoring

Monitor the status of devices, servers, and more. With our SMS API, you can turn any internet-connected object into an object that communicates via SMS.

The surveillance alarm was triggered on 04/08/2022 at 14:48 in Zone C, BUILDING 3.

Advantages:

REST API

Icons/concept/Pen Created with Sketch.

Custom sender

Icons/concept/Cloud/Cloud Eye Created with Sketch.

Receipt acknowledgment

Delayed SMS

Icons/concept/Envelop/Envelop Created with Sketch.

200,000 SMS messages

Icons/concept/Gear/Gear Arrow Created with Sketch.

High deliverability, redundant routing

Icons/concept/Hands/Hand World Created with Sketch.

Global coverage with more than 600 operators

Everything you need to know about sending SMS messages within applications

Send your first SMS

POST https://api.ovh.com/1.0/sms/sms-aa1-1/jobs
{
  "message": "Test message",
  "receivers": ["+33601020304"],
  "senderForResponse": true
}

The recipient will receive an SMS from a short number, and the contents will be "Test message".
The API will return the number of credits used, valid and invalid recipients, and the SMS IDs so you can track their statuses.

 

Schedule sending an SMS

POST https://api.ovh.com/1.0/sms/sms-aa1-1/jobs
{
  "message": "Test message",
  "receivers": ["+33601020304"],
  "differedPeriod": 120,
  "senderForResponse": true
}

With OVHcloud, you can schedule an SMS to be sent at a later date.


The “differedPeriod” field can be used to delay sending by 120 minutes.

 

Track SMS sending

The SMS status can be retrieved via the “deliveryReceipt” field:

GET https://api.ovh.com/1.0/sms/sms-aa1-1/outgoing/123456

The "deliveryReceipt" field can contain the following values:

  • 0 → Sending
  • 1 → Sent
  • 2 → Rejected or Expired
  • 4 → Pending on the recipient's operator network
  • 8 → Sent to the recipient's operator's network
  • 16 → Not distributable

Additional information is available with the “ptt” field:

The "ptt" field will return a code, the description of which is available via the call to the method:

https://api.ovh.com/1.0/sms/ptts
{
  "ptt":  4
}

Receive notifications when an SMS status changes

Via a HTTP call, OVHcloud can notify you in real time about the status change for an SMS.

To set the URL you want to be called:

PUT https://api.ovh.com/1.0/sms/sms-aa1-1                        {                            "callBack": "http://www.mywebsite.com/callbackSmsOvh.php"                        }                    

Once the configuration is complete, each time an SMS status changes, the URL will be called with the following settings:

  • Id → The SMS ID
  • dlr → The deliveryReceipt status
  • ptt → The ptt status
  • date → The date on which the status was updated
  • sender → The SMS sender
  • receiver → The number of the SMS recipient

Top up your SMS account manually

You can generate a purchase order via the OVHcloud API:

POST https://api.ovh.com/1.0/order/sms/sms-aa1-1/credits                        {                            "quantity":     100                        }                    

Top up your account automatically below a set threshold

OVHcloud offers the option of topping up your account automatically when drop below a set threshold of credits.


A purchase order is generated and paid automatically on your OVHcloud customer account, then settled.


To set up an automatic top-up of 100 credits when you have less than 10 credits on your account:

PUT https://api.ovh.com/1.0/sms/sms-aa1-1                        {                            "automaticRecreditAmount":              100,                            "creditThresholdForAutomaticRecredit":  10,                        }                    

Find out the price of sending SMS messages to a specific destination

To find out the cost of your SMS sending in advance, you can make the following call:

GET https://api.ovh.com/1.0//sms/sms-aa1-1/seeOffers)                        {                            "countryDestination": "fr",                            "countryCurrencyPrice": "fr",                            "quantity": 1000,                        }                    

This call will return a structure that gives you the price of 1,000 SMS messages, in the currency of the destination country (e.g., € for France).

Send an SMS campaign to a high number of recipients

To optimise bulk sending, you can pre-load recipients in a CSV file.

To create a recipient file, use the following method:

POST https://api.ovh.com/1.0/sms/sms-aa1-1/receivers                        {                            "csvUrl":       "http://mywebsite.com/my_recipients.csv",                            "description":  "My customer list",                            "slotId":       1                        }                    

At a minimum, the file must contain a “number” column with the number of recipients. You can define other columns that can be used to replace variables in your sending. File example:

number;name;age                        +44702123456;Smith;47                        +44798765432;Martin;36                        +44703456321;Brown;39                    

To send an SMS to all recipients in this file, simply use the following call:

POST https://api.ovh.com/1.0/sms/sms-aa1-1/jobs                        {                            "message":              "Dear Mr. #NAME#. You are #AGE# years old.",                            "receiversSlotId":      1,                            "senderForResponse":    true                            "tag": "MyCampaign"                        }                    

With this call, the three recipients will receive a custom message.
For example, Mr. Smith will receive the message “Hello Mr. Smith, it’s your birthday!”.

Also, by adding the “tag” parameter, you can search for SMS messages that correspond to this sending method:

GET https://api.ovh.com/1.0//sms/sms-aa1-1/outgoing)                            {                                "tag": "MyCampaign"                            }                    

Please note that the method will not send you the IDs of SMS messages in this mode. Sending will be asynchronous.

PHP SDK for sending SMS messages