Hi, world!

Releans Docs

Dig into our API reference documentation. You're covered with everything from SDKs in your favorite languages to sample apps for web, and mobile applications.

  • SMS API Operational
  • SMPP Servers Operational
  • RCS API Operational
  • WhatsApp API Operational

Quick start with Releans API.

First, sign up for a Releans account if you don't already have one, and make a note of your API key on the dashboard API page.

Three steps to do the integration

  1. Create an account or Login
  2. Register a new Sender ID from Releans Dashboard
  3. Generate your API Key.

Good to know the parameters before

Parameter Type Description
sender
Required
string Sender (from) to send the message Ex. Releans
Sender ID must be registered in your account. You can register your company name as Sender ID from New Sender form in the dashboard
mobile
Required
mobile number Format mobile number with a + and a country code, (E.164 format). e.g, a US number would have the format +14155550101. A UK number would have the format +447700900123.
content
Required
string Your Message text. Each SMS message can hold a maximum of 160 characters including spaces, the maximum number of characters you can write down is 1377 (around 8 SMS).

Send SMS in PHP

Send SMS in PHP Projects, Quick integration with Releans gateway API.

$curl = curl_init();

$from = "Sender_ID";
$to = "+447700900123";
$message = "Hello from Releans API";

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.releans.com/v2/message",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "sender=$from&mobile=$to&content=$message",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer YOUR_API_KEY"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.releans.com/v2/message');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR_API_KEY'
));
$request->addPostParameter(array(
  'sender' => 'Sender_ID',
  'mobile' => '+447700900123',
  'content' => 'Hello from Releans API'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.releans.com/v2/message');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append(new http\QueryString(array(
  'sender' => 'Sender_ID',
  'mobile' => '+447700900123',
  'content' => 'Hello from Releans API')));$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Authorization' => 'Bearer YOUR_API_KEY'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

Send SMS in C#

Send SMS in C# Projects, Quick integration with Releans gateway API.

private async Task GetAPIReponse()
{
  Dictionary fields = new Dictionary();
  fields.Add("sender", "Sender_ID");
  fields.Add("mobile", "+447700900123");
  fields.Add("content", "Hello from Releans API");

  var serializer = new JavaScriptSerializer();
  var serializedResult = serializer.Serialize(fields);
  var data = new StringContent(serializedResult, Encoding.UTF8, "application/json");

  var httpclient = new HttpClient();
  httpclient.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
  var response = await httpclient.PostAsync("https://api.releans.com/v2/message", data);
  string page = response.Content.ReadAsStringAsync().Result;

  return page;
}
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.releans.com/v2/message');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR_API_KEY'
));
$request->addPostParameter(array(
  'sender' => 'Sender_ID',
  'mobile' => '+447700900123',
  'content' => 'Hello from Releans API'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.releans.com/v2/message');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append(new http\QueryString(array(
  'sender' => 'Sender_ID',
  'mobile' => '+447700900123',
  'content' => 'Hello from Releans API')));$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Authorization' => 'Bearer YOUR_API_KEY'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

Send SMS in Python

Send SMS in Python Projects, Quick integration with Releans gateway API.

import http.client
import mimetypes

conn = http.client.HTTPSConnection("api.releans.com")
payload = 'sender=Sender_ID&mobile=+447700900123&content=Hello from Releans API'
headers = {
  'Authorization': 'Bearer YOUR_API_KEY'
}
conn.request("POST", "/v2/message", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests

url = "https://api.releans.com/v2/message"

payload = 'sender=Sender_ID&mobile=+447700900123&content=Hello from Releans API'
headers = {
  'Authorization': 'Bearer YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

Send SMS in NodeJS

Send SMS in NodeJS Projects, Quick integration with Releans gateway API.

var https = require('follow-redirects').https;
var fs = require('fs');

var qs = require('querystring');

var options = {
  'method': 'POST',
  'hostname': 'api.releans.com',
  'path': '/v2/message',
  'headers': {
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData = qs.stringify({
  'sender': 'Sender_ID',
  'mobile': '+447700900123',
  'content': 'Hello from Releans API'
});

req.write(postData);

req.end();
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.releans.com/v2/message',
  'headers': {
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  form: {
    'sender': 'Sender_ID',
    'mobile': '+447700900123',
    'content': 'Hello from Releans API'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
var unirest = require('unirest');
var req = unirest('POST', 'https://api.releans.com/v2/message')
  .headers({
    'Authorization': 'Bearer YOUR_API_KEY'
  })
  .send('sender=Sender_ID')
  .send('mobile=+447700900123')
  .send('content=Hello from Releans API')
  .end(function (res) {
    if (res.error) throw new Error(res.error);
    console.log(res.raw_body);
  });

Send SMS in Java

Send SMS in Java Projects, Quick integration with Releans gateway API.

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "sender=Sender_ID&mobile=+447700900123&content=Hello from Releans API");
Request request = new Request.Builder()
  .url("https://api.releans.com/v2/message")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_KEY")
  .build();
Response response = client.newCall(request).execute();
Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.post("https://api.releans.com/v2/message")
  .header("Authorization", "Bearer YOUR_API_KEY")
  .field("sender", "Sender_ID")
  .field("mobile", "+447700900123")
  .field("content", "Hello from Releans API")
  .asString();

Send SMS in Swift

Send SMS in Swift Applications, Quick integration with Releans gateway API.

import Foundation

var semaphore = DispatchSemaphore (value: 0)

let parameters = "sender=Sender_ID&mobile=+447700900123&content=Hello from Releans API"
let postData =  parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.releans.com/v2/message")!,timeoutInterval: Double.infinity)
request.addValue("Bearer YOUR_API_KEY", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()