• Call Us: 0800 954 5305
  • Login

Simple, Powerful,
Scalable SMS API

Integrate FastSMS features into your own software

using your preferred programming language.

Get instant access to everything you need to start integrating SMS
functionality into your software including 25 free credits for testing.

Always free developer documentation and support

Using our application protocol interface (API) developers can integrate all FastSMS features into any project. We’ll provide you our API documentation even before you sign up for your free account. We’re also happy to have our developers answer any questions you have so you can get started quickly and easily.
We support all languages (PHP, .NET, C#, Java, Python, Ruby etc) and new SDKs are being added to our documentation all the time.

<?php

// see more details here: https://wiki.fastsms.co.uk/?javascript#api-key
$apiKey = ‘your api key’;

/**
* Send SMS
*
* @param string $from
* @param string $message
* @param string|array $destination
* @param string $apiKey
* @return string|bool
*/
function sendSMS($from, $message, $destination, $apiKey)
{
    $postData = [
        ‘from’ => $from,
        ‘message’ => $message,
        ‘numbers’ => is_array($destination) ? $destination : [$destination],
        ‘characterSet’ => ‘auto’
    ];
    $requestOptions = [
        ‘http’ => [
            ‘method’ => ‘POST’,
            ‘header’ => “Authorization: $apiKey\r\n” .
                       “Content-type: application/json\r\n”,
            ‘content’ => json_encode($postData),
            ‘ignore_errors’ => true
        ]
    ];

    $requestContext = stream_context_create($requestOptions);

    // Open the file using the HTTP headers and content set above
    return file_get_contents(‘https://secureapi.fastsms.co.uk/campaign’, false, $requestContext);
}

$response = sendSMS(‘Your Source Address’, ‘Message Body’, ‘Phone number or multiple numbers in array’, $apiKey);

echo $response;

using System;
using System.Net.Http;
using System.Net.Http.Headers;
namespace FastSMS_DemoCode
{
    class SMSMessage
    {
        public string from { get; set; }
        public string message { get; set; }
        public string[] numbers { get; set; }
        public string characterSet { get; set; }
    }

    class Program
    {
        private static readonly HttpClient client = new HttpClient();

        static void Main(string[] args)
        {
            string[] destinationNumbers = { “Phone”, “numbers”, “in”, “array” };
            // see more details here: https://wiki.fastsms.co.uk/#api-key
            Console.WriteLine(sendSMS(“Your Source Address”, “Message Body”, destinationNumbers, “your api key”));
        }

        public static string sendSMS(string from, string message, string[] numbers, string apiKey)
        {
            client.BaseAddress = new Uri(“https://secureapi.fastsms.co.uk/”);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Add(“Authorization”, apiKey);
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(“application/json”));

SMSMessage messageObject = new SMSMessage

            {
                from = from,
                message = message,
                numbers = numbers,
                characterSet = “auto”
            };

            HttpResponseMessage response = client.PostAsJsonAsync(“campaign”, messageObject).Result;

            if (System.Net.HttpStatusCode.Forbidden.Equals(response.StatusCode)) {
               response.EnsureSuccessStatusCode();
            }

            return response.Content.ReadAsStringAsync().Result;
       }
    }
}

SMS API Features

Access powerful fastsms features from within your own application using HTTP, XML or SMTP

2 cog icons

Send SMS via API

Send text messages up to 456 characters long from your app via HTTP, XML or SMTP

Inbound SMS via API

Get inbound messages direct into your app using automatic HTTP POST forwarding

Manage Users

Create sub-users on the fly with their own credits, contact information & settings

Manage Contacts

Keep your data clean by syncing your fastsms contacts with your own application

Custom Reports

Retrieve the data from reports for specific users to check usage, message content & more

Message Status

Check the status of a specific sent message to see if it was delivered

SMS API

API Sandbox

Check your parameters and debug the code in your application
API loopback

Loopback Account

Test your code for free using a loopback account - just ask for one
SMS support

Expert Support

Get direct access to our in house developers for support on the API