Clockwork SMS API
Documentation
Everything you need to know

Send SMS via HTTP

The HTTP interface to send text messages can be accessed using GET or POST. All parameters must be URL Encoded and sent as UTF-8 text.

https://api.clockworksms.com/http/send.aspx

Parameters

To send a message you need to pass the following parameters.

Key

Your API key, available by logging in (with your username and password) to Clockwork.

To

Up to 50 comma separated numbers. Each number should start with an international country code without any leading zeros or plus symbols. For example, our UK office would be 441625588620.

Content

The message you want to send. Mobile networks only support characters listed in the GSM character set, but for consistency all characters must be UTF-8 encoded when sending through the API.

Optional Parameters

You don’t need to send these parameters, but it might make things a little nicer.

From

The text or phone number displayed when a text message is received on a phone. This can be either a 12 digit number or 11 characters long. You can set a default by logging in to Clockwork. If you’re sending with a text from address and your message isn’t delivered try again but change to sending from a telephone number - some international networks place restrictions on the from addresses they’ll accept. Due to US telecomunications rules you’re unable to set the from address when sending to the USA - the text will always come from 43704.

Long

Set this to 1 and we’ll stick together multiple messages giving you up to 459 characters, rather than the standard 160 (each recipient will cost up to 3 message credits).

API Responses

If the send was sucessful you’ll get a message ID back for each phone number:

Response

To: 441234567890 ID: AB_12345

If something goes wrong and none of your messages were sent you’ll get:

Error

Invalid Username Or Password

For an invalid mobile number:

Error

To: zzz Error 10: Invalid 'To' Parameter

Examples

Successfully sending the message “Hello World” to mobile number 441234567890:

Request

https://api.clockworksms.com/http/send.aspx?key=KEY&to=441234567890&content=Hello+World

Response

To: 441234567890 ID: AB_12345

Sending the message “Hello World” to mobile number 441234567890 and invalid number zzz:

Request

https://api.clockworksms.com/http/send.aspx?key=KEY&to=441234567890,zzz&content=Hello+World

Response

To: 441234567890 ID: AB_12345 To: zzz Error 10: Invalid 'To' Parameter

Code Wrappers

  • C# wrapper
  • Java wrapper
  • Node.js Wrapper
  • PHP Wrapper
  • Python Wrapper
  • Ruby gem
  • VB.NET wrapper

Email Interface

  • Send SMS via email

HTTP Interface

  • Check your credit via HTTP
  • SMS Delivery Receipts via HTTP
  • Receive SMS via HTTP
  • Send SMS via HTTP

XML Interface

  • Check your credit using XML
  • SMS Delivery Receipts in XML
  • Receive SMS in XML
  • Send SMS using XML

Reference

  • API Error Codes
  • Delivery States
  • GSM Character set