SIM HOSTING API VERSION 2.
O
Developers can use the following APIs to connect to simhostng
from their applications.
GET API KEY
https://simhostng.com/api/apikey
Post OR Get methods
Parameters:
username
password
WALLET BALANCE
http://simhostng.com/api/bal
Get or Post Parameters
apikey
SENDING SMS
https://simhostng.com/api/sms
Post Parameters:
apikey: API key
server: Server Id
sim: 1 2, 3, 4. Default is 1
number: Recipient Separate Multiple number with comma
message: Message: Text Message
ref: Unique Reference number (if empty the system will
generate one for you)
url: Response Callback URL
JSON DATA RESPONSE
data": [
{
"ref": "45",
"response": "ok",
"Date": "05-04-2019, 6:54 pm"
},
RESPONSE
OK = Success
Invalid Api key
Empty number
Empty Message
Inactive Server
SPC BULK SMS COMPONETS
https://simhostng.com/api/smsx?apikey=apikey&server=serverid&number=@@
recipient@@& message=@@message@@
Response
OK = Success
USSD POST
https://simhostng.com/api/ussd
Post Parameters:
apikey: API key
server: Server Id
sim: 1 , 2, 3, 4 Default is 1
number: ussd to dial *555#
ref: Unique Reference number (if empty the system will
generate one for you)
url: Response Callback URL
JSON DATA RESPONSE
data": [
{
"ref": "45",
"response "Ok",
"date": "05-04-2019, 6:54 pm"
},
RESPONSE
OK = Success
Invalid Api key
Empty number
Empty apikey
Inactive Server
INBOX FORWARDING
We forward received sms to your script using your default Inbox
Push url used during server setup
sim = The number that received the message (to, recipient)
keyword = Message keyword
sender = The number that sent the message (from, phone)
message = Text message
ref: Reference number
date = Date
Below is a simple php code to receive the sms reply from your sim
or keyword.
http://demo.com/recieve.php
<?php
$keyword= $_POST['keyword'];
$server= $_POST['server'];
$sim= $_POST['sim];
$sender= $_POST['sender'];
$message= $_POST['message'];
$ref = $_POST['ref'];
$date= $_POST['date'];
?>
RESPONSE PUSH / CALLBACK
Parameters:
response: Response from ussd or sms
ref: Your Reference
type: sms OR ussd
Below is a simple php code to receive the response from your sim
after ussd or sms.
http://demo.com/response.php
<?php
$type= $_POST['type'];
$ref= $_POST['ref'];
$response= $_POST['response];
?>
USSD REPORT
https://simhostng.com/api/dussd
Parameters:
apikey: User api key
ref: Reference Id generated per post request
data": [
{
"ref": "45",
"Server": "UXTMES",
"Network": "9MOBILE",
"Sim": "09080008483",
"Number": "*232",
"RESPONSE": "your main account balance is 456",
"Date": "05-04-2019, 6:54 pm"
},
SMS DELIVERY REPORT
https://simhostng.com/api/dsms
Parameters:
apikey: User Api key
ref: Reference Number
"data": [
{
"ref": "45",
"Server": "UXTMES",
"Network": "9MOBILE",
"Sim": "09080008483",
"Number": "131",
"Message": "Hello thank You",
"Response": "Sent",
"Date": "04-03-2018, 6:29 pm"
},
USSD OR SMS RESPONSE IN PLAIN TEXT
http://simhostng.com/api/response
Accept Get or Post:
Parameters
apikey
ref
type (SMS OR USSD)
Plain Link
http://simhostng.com/api/response/apikey/ussd/ref
E.g:
https://simhostng.com/api/response/8sissksjssjshshs864ssls/ussd/
45
Response:
Your main account balance is 456
PHP SCRIPT TO SEND SMS
function cpost($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);
}
$svalues = [
'apikey' => ’8dfgdddddddddddddd’,
'server' => ’HSMDSNSDND’,
'sim' => ‘1’,
'message' => ’Hello Dear, I want to know’,
'ref' => ‘137283727373’,
'number' => ’09080008483’,
'url' => ’https://myservr.com/callback’,
];
$sendsms = post(‘https://simhostng.com/api/sms‘, $svalues);
PHP SCRIPT TO PROCESS USSD SMS
function cpost($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);
}
$uvalues = [
'apikey' => ’8dfgdddddddddddddd’,
'server' => ’HSMDSNSDND’,
'sim' => ‘1’,
'number' => ’*556#’,
'ref' => ‘137283727373’,
'url' => ’https://myservr.com/callback’,
];
$runussd = post(‘https://simhostng.com/api/ussd‘, $uvalues);
THANK YOU
www.simhostng.com, www.simhostIng.com.ng
09080008483, info@simhostng.com