Maskyoo
SMS Gateway API
Version 1.8
Updated: 20 May 2024
This document contains proprietary and confidential material of Maskyoo Ltd.
Any unauthorized reproduction, use, or disclosure of this material, or any part
thereof, is strictly prohibited.
This document is solely for the use of Maskyoo employees and authorized
Maskyoo customers. © 2016 Maskyoo Ltd. All rights reserved.
2
Overview
Maskyoo SMS gateway provides several APIs to allow developers to integrate functionality of send and received SMS
messages into their systems.
System Architecture
Customer server
Make HTTP/XML request client.
Maskyoo SMS gateway
Telecom providers
SMS gateway
SMS Deliver & Launch
SMS deliver to end user mobile
Maskyoo Firewall
Internet
Public network
3
Some Points to be Checked
You should ensure that the following actions are performed on your side
You have an active Maskyoo service Account.
If not, please feel free to contact us, and we will provide
you with an account
ASCII Encoding Reference
Replacement of special characters will be carried out
according to standard of url encode character-setin HTML5
of UTF-8.
HTTP protocol support
Check if the connection to the internet is established via a
TCP/IP port 80 or via the HTTP protocol(firewall rules).
Connect to the Internet
Your server has connection to the internet
Max characters in an SMS
The maximum incomingmessage length is 600 characters.
XML parse support
The programming language you are using to write your app
fully supports XML parse.
The XML format should be in UTF-8 Unicode. This allows
support for a set of languages, including Hebrew.
Fire up your business SMS
connection
REST Web service API
RESTful API uses simple query parameters via URLs. If
you can put together a Web page with a form, backed
by a scripting language (e.g. PHP), you already have
what you need to send SMS.
SOAP Web service API
SOAP-API allows you to integrate your Application to
the Maskyoo SMS gateway using the SOAP protocol.
SOAP exchanges XML based messages over HTTP(S).
Mail To SMS
Our SMS Gateway works by simply accepting
emails, then converting them to an SMS
compatible format, which in turn pushes the
message to its intended recipients.
Receive SMS API
Receive inbound SMS messages on Maskyoo
SMS phone numbers.
Add contacts via API service
RESTful API allow you to add and modify contacts and
their details
API send multiple sms in bulk
RESTful API send out multiple SMSs in one batch, backed by
a scripting language (e.g. PHP), when you already have what
you need to send multiple SMSs.
5
REST Web service API -Send SMS (send)
service=send_sms&username=user@email.com&password=123123&message=Hello%20World&dest=0501234567&sender=0501234567&sendtime=01/01/2020%2012:00&callback_url=http://yoursite.com/page.php Type Variables explained Required /
optional Note
service String Service name Required Should be send_sms
token String Identification token Required Available on Account settings page
dest String Destination phone number for the SMS Required To send to multiple recipients you should
separate the destination using comma delimited
message String Text message to send Required Add short URL ex: [[ex_url-https://yoursite.com[[
sender String Sender number or name Required
The sender can contain:
- A valid phone number
- A speed dial service number (star and 4 digits)
- A name (Latin characters, 11 Characters max.)
sendtime String You can schedule to send SMS at any time
in the future Optional The schedule time format is
‘dd/mm/yyyy HH:MM'
callback_url String You can set up callback URLs or Email to get
the delivery status of the message Optional See Callback Variables table
API Input Variables
Notes: This service requires registration of requesting server IP on the account settings page.
6
REST Web service API - Send SMS (examples)
Php
<?php
$msg = urlencode("Hello world sms");
$destination = "0521234567,0537654321";//One or Multiple comma
separated
$sender = "0531234567";
$token = “xxxxx…";
$url = "https://sms.deals/api/ws.php?service=send_sms”;
$url .= “&message=".$msg."&dest=".$destination."&sender=".$sender;
$url .= "&token=".$token;
$options = array('http' => array('method' => 'GET',
'header' => 'Authorization: Bearer '.$token));
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
?>
.NET C#
using System;
using System.IO;
using System.Net;
using System.Text;
namespace Examples.System.Net {
public class WebRequestGetExample {
public static void Main () {
string url_query_string = "https://sms.deals/api/ws.php?" +
"service=send_sms&+ "message=Hello world sms&"+
"dest=0521234567, 0537654321&+ "sender=0531234567";
WebRequest request = WebRequest.Create (url_query_string);
string bearerToken = xxxxxx";
request.Headers["Authorization"] = "Bearer " + bearerToken;
WebResponse response = request.GetResponse ();
Console.WriteLine (((HttpWebResponse)response).StatusDescription);
Stream dataStream = response.GetResponseStream ();
StreamReader reader = new StreamReader (dataStream);
string responseFromServer = reader.ReadToEnd ();
Console.WriteLine (responseFromServer);
reader.Close ();
response.Close ();
}
}
}
Notes: This service requires registration of requesting server IP on the account settings page.
7
Output
<?xml version="1.0" encoding="UTF-8"?>
<SMS_Service>
<service>
send_sms
<service/>
<Message>1231230</Message>
<Source>0541234567</Source>
<sms_recipients>
<sms_0>
<Message_id>183804870</Message_id>
<Destination> 0521234567</Destination>
<Status>Message in Action</Status>
<Send_time>2014-05-24 15:10:38</Send_time>
</sms_0>
<sms_1>
<Message_id>183804880</Message_id>
<Destination>0537654321</Destination>
<Status>Message in Action</Status>
<Send_time>2014-05-24 15:10:38</Send_time>
</sms_1>
</sms_recipients>
<Total_sms>2</Total_sms>
<Total_Charge>2</Total_Charge>
</SMS_Service>
REST Web service API - Send SMS (response)
Variable
name
Var
iable
Type Variables explained
Message_id Integer A unique identifier provided by the SMS
gateway to sign its messages
Message String Message to send
Source String Sender number or name
Destination String Destination phone number for the SMS
Send_time Time Date and time the request is logged
Total_sms Integer The amount of SMS you are currently sending
Total_Charge Integer The amount of SMS credit you are charged
8
REST Web service API -Send SMS (Callback Variables table)
Status Description
Success
Message
sent to destination
operator
successfully
Recipient
"Afllalo" Blocked
Destination
Blocked for
incoming
SMS
Destination
MT block
Destination
Blocked for
incoming
SMS
System
Error
System
Error
Missing
Message body
Message
empty
Invalid
Destination
Invalid
Destination
Expired
Message
validity period has
expired.
blacklist
Message
not sent, destination is
in
blacklist
Variable
name
Var
iable
Type Variables explained
from String Sender number or name
to String Destination phone number for
the SMS
status String Status option see (Callback
Variables table)
Message_id Integer
A unique identifier provided by
the SMS gateway to sign its
messages
Output Callback Variables
9
REST Web service API - Send multiple sms in bulk (send)
Variable name Variable Type Variables explained Required /
optional Note
service String Service name Required Should be send_sms
token String Identification token Required Available on Account settings page
dest String Destination phone number for the SMS Required To send to multiple recipients you should separate
the destination using comma delimited
message String Text message to send Required Add short URL ex: [[ex_url-https://yoursite.com[[
sender String Sender number or name Required
The sender can contain:
- A valid phone number
- A speed dial service number (star and 4 digits)
- A name (Latin characters, 11 Characters max.)
sendtime String You can schedule to send SMS at any time in
the future Optional The schedule time format is
‘dd/mm/yyyy HH:MM'
callback_url String You can set up callback URLs or Email to get
the delivery status of the message Optional See Callback Variables table
API Input Variables
Notes: This service requires registration of requesting server IP on the account settings page.
10
REST Web service API - Send multiple sms in bulk (send)
https://sms.deals/api/ws_json_bulk.php?
Notes: This service requires registration of requesting server IP on the account settings page.
JSON Content
[
{
"service": "send_sms",
token:xxxxxxx…”,
"dest": "0501234567",
"sender": "0541231231",
"sendtime": "01/01/2020 12:00",
"callback_url":
"http://yoursite.com/page.php", "message":
"Hello world User example 1"
},
{
"service": "send_sms",
"token": "xxxxxxx",
"dest": "0521231232",
"sender": "0541231232",
"message": "Hello world User example 2"
}
]
11
REST Web service API - Send multiple sms in bulk (send)
Curl
curl --location --request POST
"https://sms.deals/api/ws_json_bulk.php" \
--header "Content-Type: application/json" \
--header Authorization: Bearer xxxxxx…“ \
--data "[
{
\"service\": \"send_sms\",
\"dest\": \"0521231231\",
\"sender\": \"0521231221\",
\"message\": \"Hello world User example 1\"
},
{
\"service\": \"send_sms\",
\"dest\": \"0541231221\",
\"sender\": \"0541231231\",
\"message\": \"Hello world User example 2\"
}
]"
Php
$curl = curl_init();
$json = array(
array(
'service' => 'send_sms, 'dest' => '0521231231',
'sender' => '0541231231', 'message' => 'Hello world User example 1'
),
array(
'service' => 'send_sms', 'dest' => '0521231232',
'sender' => '0541231232', 'message' => 'Hello world User example 2'
)
);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://sms.deals/api/ws_json_bulk.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($json),
CURLOPT_HTTPHEADER=> array(
"Authorization: Bearer " . $token
)
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Notes: This service requires registration of requesting server IP on the account settings page.
12
Output
[
{
"service": "send_sms",
"status": "Message in Action",
"message_id": 212131221,
"message": "test",
"sender": "0521231231",
"dest": "0521231232",
"sendtime": "2022-09-05 18:48:37",
"total_charge": 1
},
{
"service": "send_sms",
"status": "Error - 403 Forbidden",
"description": "Mandatory fields missing:
token",
"message": "test",
"dest": "0531231231",
"sender": "0531231241"
}
]
REST Web Service API - Send multiple SMSs in bulk (send)
Variable
name
Var
iable
Type Variables explained
Message String Message to send
Source String Sender number or name
token String Account identification token
Message_id Integer Aunique identifier provided by the SMS gateway
to sign its messages
Destination String Destination phone number for the SMS
Send_time Time Date and time the request is logged
Total_sms Integer The amount of SMSs you are currently sending
Total_Charge Integer The amount of SMSs credit you are charged
Notes: This service requires registration of requesting server IP on the account settings page.
13
REST Web service API
Send multiple sms in bulk Callback Variables table
Output Callback Variables
Status Description
Success
Message
sent to destination
operator
successfully
Recipient
"Afllalo" Blocked
Destination
blocked for
incoming
SMS
Destination
MT block
Destination
blocked for
incoming
SMS
System
Error
System
error
Missing
message body
Message
empty
Invalid
destination
Invalid
destination
Expired
Message
validity period has
expired.
blacklist
Message
not sent, destination is
in
blacklist
Variable
name
Var
iable
Type Variables explained
from String Sender number or name
to String Destination phone number for
the SMS
status String Status option see (Callback
Variables table)
Message_id Integer
A unique identifier provided
by the SMS gateway to sign its
messages
Notes: This service requires registration of requesting server IP on the account settings page.
14
SOAP Web service API-Send SMS (send)
Document page https://www.sms.deals/api/ws_soap.php
WSDL link https://www.sms.deals/api/ws_soap.php?WSDL
Php
<?php
// Nusoap library 'nusoap.php' should be available
require_once('nusoap.php');
$wsdl = "https://www.sms.deals/api/ws_soap.php?WSDL";
$soap = new soapclient($wsdl,"wsdl");
$proxy = $soap->getProxy();
$message = "msg";
$dest = "0501234567";
$sender = "0501987654";
$sendtime = "";
$user = "xxx@yyy.co.il";
$pass = "password";
$callback_url = "";
.NET C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApplication1.sms_deals;
$result = $proxy->send_sms($message,$dest,$sender,$sendtime,$user,$pass,
$callback_url);
echo($result);
?>
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private void button1_Click(object sender, EventArgs e){
var sms = new sms_deals.SoapSRV();
string message = sms.send_sms("msg", "0501234567", "0501987654", "",
"[email protected]", "password", "", "", "");
MessageBox.Show(message);
}
}
}
SOAP Web service API
SOAP-API allows you to integrate your application to
the Maskyoo SMS gateway using the SOAP protocol.
SOAP exchanges XML based messages over HTTP(S).
Notes: This service requires registration of requesting server IP on the account settings page.
15
Mail to SMS -Send SMS (send)
This option is closed by default !
If you need this option please contact our support and we will allow access to your account by:
The domain name of the mail sender (From)
The email address of the sender (From)
Mail To SMS
Our SMS Gateway works by simply accepting
emails, then converting them to an SMS
compatible format, which in turn pushes the
message to its intended recipients.
To:
Message destination(s),
followed by @sms.deals
Subject :
Account identification Token
(on Settings page)
Body:
SMS message
16
Receive SMS API
When you buy an SMS-enabled phone number, you can associate that phone
number with a URL or Email.
When someone sends a text message to that phone number, we make an HTTP
request to your URL with the body of the message and the sender's phone number.
Receive SMS API
Receive inbound SMS messages on Maskyoo
SMS phone numbers.
http://www.yoursite.com/yourpage.php?from=XXXXXXX&to=XXXXXXX&msg=XXXXXXXXXXXXXXXXXXX&time=2016-04-25%2010:00:00
API Input Variable
Variable name Variable
Type Variables explained
from
String Who sent the SMS (phone number)
to
String Destination phone number for the SMS
msg
String Text message to send
time
String Date and time the request is logged
In format Y-m-d H:i:s
17
REST Web service API - Add contact
https://sms.deals/api/ws.php?service=add_contact&token=xxxxxxx...&sms_phone=05012345
67&name=contact_name&company=contact_company&phone=0501234567&email=contact@email.com&fax=031234567&b
irthday=01/01/80&anniversary=01/01/80&gender=male&Mailing_address=addess_name
Variable name Type Description Required / Optional Note
service String Service name Required Should be add_contact
sms_phone String Contact phone number for the SMS Required Required for update contact
name String Contact name Optional UTF-8 format max 50 characters
company String Contact company name Optional UTF-8 format max 50 characters
phone String User’s additional phone number Optional
email String User’s email Required
fax String User’s fax Optional
birthday String User’s birthday Optional Date formatted DD/MM/YYYY'
Token String Account Identification token Required Available on Account settings
page
API Input Variable
Notes: This service requires registration of requesting server IP on the account settings page.
18
REST Web service API - Add contact
Variable name Type Description Required /
Optional Note
anniversary String Service name Optional Date format as
‘DD/MM/YYYY'
gender String User’s gender Optional male/female
Mailing_address String User’s address Optional UTF-8 format max (50) characters
website String User’s website Optional Web site URL
mailing_city String User’s city name Optional UTF-8 format max (50) characters
new_mobile_number String User’s updated sms phone Optional Needed for update users SMS phone
user_fieldX String Contact’s Custom fields Optional X may be 1,2 or 3 accordingly
tag_names String List of account tags associated with this Contact Optional Delimited by semicolons (;)
API Input Variable (continue)
19
REST Web service API Add contact (examples)
Php
<?php
$company = urlencode("name of company");
$sms_phone ="0521234567";
$email = "[email protected]";
$token = "xxxxxx...";
$url = "https://sms.deals/api/ws.php?";
$url .= "service=".add_contact;
$url .= "&sms_phone=".$sms_phone;
$url .= "&company=".$company;
$url .= "&email=".$sender;
$options = array(
'http' => array('method' => 'GET',
'header' => 'Authorization: Bearer '.$token));
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo($return);
?>
.NET C#
using System; using System.IO;
using System.Net;
usingSystem.Text;
namespace Examples.System.Net
{
public class WebRequestGetExample
{
public static void Main ()
{
string url_query_string = "https://sms.deals/api/ws.php?" + "service=add_contact&"+
"sms_phone=0521234567&"+ "company=compony name&"+
"email="[email protected].il&"+ "token=xxxxxx...";
WebRequest request = WebRequest.Create (url_query_string);
string bearerToken = xxxxxx";
request.Headers["Authorization"] = "Bearer " + bearerToken;
request.Credentials = CredentialCache.DefaultCredentials; WebResponse
response = request.GetResponse ();
Console.WriteLine (((HttpWebResponse)response).StatusDescription); Stream
dataStream = response.GetResponseStream ();
StreamReader reader = new StreamReader (dataStream); string
responseFromServer = reader.ReadToEnd (); Console.WriteLine
(responseFromServer);
reader.Close (); response.Close ();
}
}
}
Notes: This service requires registration of requesting server IP on the account settings page.
20
REST Web service API Add Sender Text
https://www.sms.deals/api/ws.php?service=add_sender_text&token=xxxxxx...&sender=test
Variable name Variable
Type Variables explained Required /
optional Note
service String Service name Required Should be add_sender_text
token String Account identification token Required
sender String The sender text you wish to add Required
Must be with Latin letter first - a-z/A-Z
Can contain both a-z/A-Z, 0-9, _or
Length between 3 to 11 characters
API Input Variable
Php
<?php
$token=xxxxxx…”;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL =>
"https://sms.deals/api/ws.php?service=add_sender_text&sender=test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING=> "utf-8",
CURLOPT_FOLLOWLOCATION=>true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . $token
)
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
.NET C#
using System; using System.IO; using
System.Net; usingSystem.Text;
namespace Examples.System.Net {
public class WebRequestGetExample {
public static void Main () {
string url_query_string = "https://sms.deals/api/ws.php?service= add_sender_text"+
&sender=text"+ &token=xxxxxx...";
WebRequest request = WebRequest.Create (url_query_string);
string bearerToken = xxxxxx";
request.Headers["Authorization"] = "Bearer " + bearerToken;
request.Credentials = CredentialCache.DefaultCredentials;
WebResponse response = request.GetResponse ();
Console.WriteLine (((HttpWebResponse)response).StatusDescription); Stream
dataStream = response.GetResponseStream ();
StreamReader reader = new StreamReader (dataStream); string
responseFromServer = reader.ReadToEnd (); Console.WriteLine
(responseFromServer);
reader.Close (); response.Close ();
} } }
Notes: This service requires registration of requesting server IP on the account settings page.
21
REST Web service API Add Sender Phone step1
https://www.sms.deals/api/ws.php?service=add_sender_phone_step1&token=xxxxxx...&sender=0501234567&otp_type=sms
Variable name Variable
Type Variables explained Required/
optional Note
service String Service name Required Should be add_sender_phone_step1
token String Account identification token Required
sender integer The sender phone number you wish to add Required
Must be a valid phone number with no dash ()
or Speed dial service number (asterisk and 4
digits)
otp_type String Type of Phone number confirmation Required
Should be sms or call
or distributor (when account has distributor
permission license)
API Input Variable
Php
<?php
$token = "xxxxxx";
$params =
array("service"=>"add_sender_phone_step1",
"sender"=>"0501234567","otp_type"=>"sms");
$curl = curl_init();
curl_setopt_array($curl,
array(
CURLOPT_URL =>
"https://www.sms.deals/api/ws.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "UTF-8",
CURLOPT_MAXREDIRS =>10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS=>json_encode($params),
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . $token
)
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
.NET C#
using System; using RestSharp;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
var client = new
RestClient("https://www.sms.deals/api/ws.php?service=add_sender_phone_step1
&sender=0501234567&otp_type=sms");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
string bearerToken = xxxxxx";
request.AddHeader(" Authorization ", " Bearer " + bearerToken ");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
}
}
}
Notes: This service requires registration of requesting server IP on the account settings page.
22
REST Web service API Add Sender Phone step2
https://www.sms.deals/api/ws.php?service=add_sender_phone_step2&sender=0501234567&otp_key=111111&sender_description=Main Sender
Variable name Variable
Type Variables explained Required /
optional Note
service String Service name Required Should be add_sender_phone_step2
sender integer The sender phone number you wish to add Required Must be the same phone number as in
step 1
otp_key integer The code received by sms or call Required Should be 6 digits code
sender_description String Free text field to describe the sender Optional Can be in English and/or Hebrew
token String Account identification token Required
API Input Variable
Php .NET C#
using System;
using RestSharp;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
var client = new
RestClient("https://www.sms.deals/api/ws.php?service=add_sender_phone_step2
&sender=0501234567&otp_type=sms");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
string bearerToken = xxxxxx";
request.AddHeader(" Authorization ", " Bearer " + bearerToken ");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
}
}
}
Notes: This service requires registration of requesting server IP on the account settings page.
<?php
$token = "xxxxxx";
$params = array("service"=>"add_sender_phone_step2",
"sender"=>"0501234567","otp_type"=>"sms",
"sender_description"=>"Main%20Sender");
$curl = curl_init();
curl_setopt_array($curl,
array(
CURLOPT_URL => "https://www.sms.deals/api/ws.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "UTF-8",
CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($params),
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . $token
)
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
23
REST Web service API Get Sender List
https://www.sms.deals/api/ws.php?service=get_sender_list&token=xxxxxx...&search=test
Variable name Variable
Type Variables explained Required /
optional Note
service String Service name Required Should be get_sender_list
token String Account identification token Required
search String Search sender with the value inputted Optional Can be numbers and Latin letters
API Input Variable
Php .NET C#
using System;
using RestSharp;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
var client = new
RestClient("https://www.sms.deals/api/ws.php?service=get_sender_list
&search=search_text");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
string bearerToken = xxxxxx";
request.AddHeader(" Authorization ", " Bearer " + bearerToken ");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
}
}
}
Notes: This service requires registration of requesting server IP on the account settings page.
<?php
$token = "xxxxxx";
$params = array("service"=>"get_sender_list",
"search"=>"search_string");
$curl = curl_init();
curl_setopt_array($curl,
array(
CURLOPT_URL => "https://www.sms.deals/api/ws.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "UTF-8",
CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($params),
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . $token
)
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
24
REST Web service API Get Credit
https://sms.deals/api/ws.php?service=get_credit&token=xxxxxx...
Variable name Variable
Type Variables explained Required /
optional Note
service String Service name Required Should be get_credit
token String Account identification token Required
API Input Variable
Php .NET C#
using System;
using RestSharp;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
var client = new
RestClient("https://www.sms.deals/api/ws.php?service=get_credit);
client.Timeout = -1;
var request = new RestRequest(Method.POST);
string bearerToken = xxxxxx";
request.AddHeader(" Authorization ", " Bearer " + bearerToken ");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
}
}
}
<?php
$token = "xxxxxx";
$params = array("service"=>"get_credit");
$curl = curl_init();
curl_setopt_array($curl,
array(
CURLOPT_URL => "https://www.sms.deals/api/ws.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "UTF-8",
CURLOPT_MAXREDIRS => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($params),
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . $token
)
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Notes: This service requires registration of requesting server IP on the account settings page.
25
Output
<?xml version="1.0" encoding="UTF-8"?>
<SMS_Service>
<service>get_credit</service>
<username>example@user.com</username>
<status>Success</status>
<account_credit>-1</account_credit>
</SMS_Service>
REST Web service API Get Credit (response)
Variable
name
Var
Type Variables explained
Service String get_credit
Username String Account username
Status String Success/Error
Account_credit Integer The amount of credit in the account (-1 = unlimited)
THANKS FOR USING
THE MASKYOO SMS GATEWAY API
Maskit 22, Herzliya, Israel
+972-77-6670000
sales@maskyoo.co.il
Contact us:
facebook.com/Maskyoo
@maskyoo
Follow us on: