Authentication
Authentication information for connecting to OKROUTE SMS platform must be requested from the owner of OKROUTE SMS platform for each new interconnection.
Credentials must be sent with each API request otherwise the user will be rejected as non-authorized.
Request Methods
Users can make requests to the API using either the GET or POST methods. GET requests are typically used for retrieving data, while POST requests are used for submitting data to be processed. The API endpoint URL is provided by the system owner and follows a specific format:
- http(s)://<IP_address>:<port>/api?
- Example URLs
- https://<domainname>:8002/api?
http://1.1.1.1:8001/api?
GET request to HTTPs port
curl -X GET 'https://<domainname>:8002/api? username=<username> &password=<password> &ani=<ani> &dnis=<dnis> &message=<message> &command=submit &serviceType=<serviceType> &longMessageMode=<longMessageMode>'
import requests url = 'https://<domainname>:8002/api' params = { 'username': '<username>', 'password': '<password>', 'ani': '<ani>', 'dnis': '<dnis>', 'message': '<message>', 'command': 'submit', 'serviceType': '<serviceType>', 'longMessageMode': '<longMessageMode>' } response = requests.get(url, params=params) print(response.text)
<?php $url = 'https://<domainname>:8002/api'; $params = [ 'username' => '<username>', 'password' => '<password>', 'ani' => '<ani>', 'dnis' => '<dnis>', 'message' => '<message>', 'command' => 'submit', 'serviceType' => '<serviceType>', 'longMessageMode' => '<longMessageMode>' ]; $ch = curl_init($url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
require ‘net/http’
url = URI (“https://domainname:8002/api?username=<username>&password=<password>&ani=<ani>&dnis=<dnis>&message=<message>&command=submit&serviceType=<serviceType>&longMessageMode=<longMessageMode>“)
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
POST request to HTTP port
Credentials are part of the link
curl -X POST \ -H 'Content-Type: application/json' \ -d '{"ani":"ani","dnis":"dnis","message":"test"}' \ 'http://1.1.1.1:8001/api?command=submit&username=username&password=password'
import requests
url = ‘http://1.1.1.1:8001/api?command=submit&username=username&password=password’
data = {“ani”: “ani”, “dnis”: “dnis”, “message”: “test”}
headers = {‘Content-Type’: ‘application/json’}
response = requests.post(url, json=data, headers=headers)
print (response.text)
<?php $url = 'http://1.1.1.1:8001/api?command=submit&username=username&password=password'; $data = array("ani" => "ani", "dnis" => "dnis", "message" => "test"); $options = array( 'http' => array( 'header' => "Content-Type: application/json\r\n", 'method' => 'POST', 'content' => json_encode($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); echo $result; ?>
require ‘net/http’
require ‘uri’
require ‘json’
uri = URI.parse(‘http://1.1.1.1:8001/api?command=submit&username=username&password=password’)
header = {‘Content-Type’: ‘application/json’}
data = {“ani” => “ani”, “dnis” => “dnis”, “message” => “test”}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = data.to_json
response = http.request(request)
puts response.body
POST request to HTTP port
Credentials are part of the JSON body
curl -H 'Content-Type: application/json' \ -X POST \ -d '{"username":"username","password":"password","command":"submit","ani":"ani","dnis":"dnis","message":"test"}' \ 'http://1.1.1.1:8001/api?'
import requests
url = ‘http://1.1.1.1:8001/api?’
data = {
“username”: “username”,
“password”: “password”,
“command”: “submit”,
“ani”: “ani”,
“dnis”: “dnis”,
“message”: “test”
}
headers = {‘Content-Type’: ‘application/json’}
response = requests.post(url, json=data, headers=headers)
print (response.text)
<?php $url = 'http://1.1.1.1:8001/api?'; $data = array( "username" => "username", "password" => "password", "command" => "submit", "ani" => "ani", "dnis" => "dnis", "message" => "test" ); $options = array( 'http' => array( 'header' => "Content-Type: application/json\r\n", 'method' => 'POST', 'content' => json_encode($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); echo $result; ?>
require ‘net/http’
require ‘uri’
require ‘json’
uri = URI.parse(‘http://1.1.1.1:8001/api?)
header = {‘Content-Type’: ‘application/json’}
data = {
“username” => “username”,
“password” => “password”,
“command” => “submit”,
“ani” => “ani”,
“dnis” => “dnis”,
“message” => “test”
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = data.to_json
response = http.request(request)
puts response.body
HTTPs API Features
SMS Submission and Delivery Status
The HTTPs API facilitates the submission of SMS messages and allows users to inquire about the delivery status of these messages. This functionality provides a comprehensive solution for managing SMS communication through the OKROUTE SMS platform.
Authentication
Securing access to the OKROUTE SMS platform, the HTTPs API mandates authentication through login/password credentials obtained from the platform owner. The inclusion of these credentials in every API request is obligatory, serving as the gateway to establishing a secure connection.
Dynamic Methods and Endpoints
Embracing unparalleled flexibility, our HTTPs API empowers you with a range of options for seamless integration. Whether it’s sending requests through the versatile GET or POST method, or ensuring security with HTTPs, our API supports your diverse needs.
GET STARTED TODAY
Would you like to work with us? Get in touch and let's get the ball rolling.
START MESSAGING TODAY