SMS API

A simple, reliable service for sending SMS messages worldwide. You can integrate SMS sending into your algorithms and business procedures, to get all the benefits of the most instant, global communication method.

Use cases

SMS appointments and reminders

Sending appointment reminders via SMS is a reliable way to make sure that your schedule runs smoothly. If you are an establishment that books appointments with members of the public, and ensure that customers attend their meetings by sending SMS reminders.

Advantages

  • REST API
  • Custom sender
  • Acknowledgement of receipt
  • Deferred SMS
  • 200,000 SMS messages
  • High deliverability, redundant routes
  • Global coverage with 600 operators

Everything you need to know about sending SMS messages within applications

Send your first SMS

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.

Customise your SMS sender

With the OVH SMS service, you can customise your senders (11 alpha-numeric characters maximum).
To prevent identity theft, senders need to be validated.


1 To declare a new sender:

2 Manual validation is then triggered.
To find the validation status, refer to the "status" field:

GET https://api.ovh.com/1.0/sms/sms-aa1-1/senders/SMS inc.
                    


3 The "status" field may contain the following values:

  • waitingValidation: Pending validation
  • refused: Validation refused (the reason will be visible in the "comment" field)
  • enable: Enabled (your sender is now usable)
  • disable: Disabled (the recipient is temporarily disabled and can be re-enabled at any time)

Once your sender has been validated, you can send an SMS with this sender.



Schedule sending an SMS

With OVH, you can schedule an SMS to send on a future date.

In the "differedPeriod" fiels, you can delay sending by 120 minutes. This means the SMS will be sent two hours later.

Track SMS sending

You can check the SMS status in 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: Delivered
  • 2: Rejected or Expired
  • 4: Pending on the recipient's operator network
  • 8: Sent to the recipient's operator network
  • 16: Undeliverable


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

With OVH, you can receive real-time notifications for SMS status changes via a HTTP call.

To set the URL you want to be called:


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: PTT status
  • date: Date that the status was updated
  • sender: the sender of the SMS
  • receiver: The SMS recipient's number
Top up your SMS account manually

You can generate a purchase order via the OVH 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

Don't want to worry about how much credit you have left?

OVH 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 OVH 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,
}
                    
Send an SMS campaign to several recipients

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

To create a recipient file, use the following method:


The file should contain — at minimum — a "number" column containing the recipients' mobile numbers.
You can define other columns that can be used to replace variables in your sending.

File example:




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



With this call, the three recipients will receive a custom message.
For example, Mr Dupont will receive the message "Hello, Mr Dupont. You are 47 years old."

By adding the "tag" parameter, you can also search SMS messages corresponding to this sending with the method:



Please note that the method https://api.ovh.com/1.0/sms/sms-aa1-1/jobs will not give you the IDs of SMS messages in this mode. The sending will be carried out asynchronously.

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

To find out how much it will cost to send your messages, you can call the following method:

This call will return a structure enabling you to find out the price of sending 1,000 SMS messages to France, in the currency used in France (€).

PHP SDK for sending SMS messages