Send your first SMS message

In a few simple steps, we will explain how to send an SMS using Routee Messaging API.

1. Routee account

To get started you'll need a Routee account

[2]: "Routee platform"

2. Authentication

Following, your Application ID and Application Secret have to be encoded in base64 like this:

Combine the application id and secret into a string applicationid:applicationsecret
Encode the resulting string using base64

You can get your default application id and secret from the applications' menu of Routee platform

Now you can get a valid access token by sending the encoded string to the Authentication Resource.


Authentication Guide

For more details and examples check this guide

3. Phone Number format

The message will be sent only to a valid phone number, written in international format e.g. +3069xxxxxxxx. You have to use the E.164 number formatting. E.164 numbers are internationally standardized to a 15-digit maximum length.

4. Request

Now, you are ready to create an HTTP POST request to messaging API.

Resource reference here

Your Header should contain authorization and content type:

Authorization:Bearer {access_token}

Request body contains the message text (body), the sender (from) and the recipient (to).

An example request is shown below:

curl --request POST \
  --url \
  --header 'authorization: Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4'\
  --header 'content-type: application/json' \
  --header 'Expect:' \
  --data '{ "body": "A new game has been posted to the MindPuzzle. Check it out","to" : "+30697ΧΧΧΧΧΧΧ","from": "amdTelecom"}'
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \"body\": \"A new game has been posted to the MindPuzzle. Check it out\",\"to\" : \"+30697ΧΧΧΧΧΧΧ\",\"from\": \"amdTelecom\"}");
Request request = new Request.Builder()
  .addHeader("authorization", "Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4")
  .addHeader("content-type", "application/json")

Response response = client.newCall(request).execute();
var client = new RestClient("");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4");
request.AddParameter("application/json", "{ \"body\": \"A new game has been posted to the MindPuzzle. Check it out\",\"to\" : \"+30697ΧΧΧΧΧΧΧ\",\"from\": \"amdTelecom\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "",
  CURLOPT_POSTFIELDS => "{ \"body\": \"A new game has been posted to the MindPuzzle. Check it out\",\"to\" : \"+30697ΧΧΧΧΧΧΧ\",\"from\": \"amdTelecom\"}",
    "authorization: Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4",
    "content-type: application/json"

$response = curl_exec($curl);
$err = curl_error($curl);


if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
import http.client

conn = http.client.HTTPSConnection("")

payload = "{ \"body\": \"A new game has been posted to the MindPuzzle. Check it out\",\"to\" : \"+30697ΧΧΧΧΧΧΧ\",\"from\": \"amdTelecom\"}"

headers = {
    'authorization': "Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4",
    'content-type': "application/json"

conn.request("POST", "/sms", payload, headers)

res = conn.getresponse()
data =

require 'uri'
require 'net/http'

url = URI("")

http =, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request =
request["authorization"] = 'Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4'
request["content-type"] = 'application/json'
request.body = "{ \"body\": \"A new game has been posted to the MindPuzzle. Check it out\",\"to\" : \"+30697ΧΧΧΧΧΧΧ\",\"from\": \"amdTelecom\"}"

response = http.request(request)
puts response.read_body
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "",
  "method": "POST",
  "headers": {
    "authorization": "Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4",
    "content-type": "application/json"
  "processData": false,
  "data": "{ \"body\": \"A new game has been posted to the MindPuzzle. Check it out\",\"to\" : \"+30697ΧΧΧΧΧΧΧ\",\"from\": \"amdTelecom\"}"

$.ajax(settings).done(function (response) {
#import <Foundation/Foundation.h>

NSDictionary *headers = @{ @"authorization": @"Bearer 12dc9fe4-7df4-4786-8d7a-a46d307687f4",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"body": @"A new game has been posted to the MindPuzzle. Check it out",
                              @"to": @"+30697ΧΧΧΧΧΧΧ",
                              @"from": @"amdTelecom",

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@""]
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
[dataTask resume];

That's it! You should receive an SMS in a few moments.

Resource Reference here


Character Transcoding

If you need to automatically transcode unicode characters (Greek, French, Spanish etc) just enable the enforce transcoding option found on here under the application you used to authenticate.



All tokens that are issued from Routee's authorization server are valid for 1 hour. This allows better security for your HTTP calls. That means that once you get an HTTP response with a status code of 401, from any Routee API resource, you should issue a new token and repeat your previous request with the new token.

To issue a new token, you follow the same procedure of exchanging your application credentials through the authorization server.


Non-Expiring Tokens

If by any reason you want a non-expirable token then you should create a new application on or and at the dropdown Token Expiration Settings select the option Unlimited. When you exchange the new application ID & Secret with the oAuth resource the receiving token will never expire.