NAV
Logo SMSWay
bash php javascript

API Reference

Welcome to the SMSWay API reference. The SMSWay API connects your website or application to operators around the world. With our API you can integrate SMS. Our REST Messaging API is designed to be a simple and powerful tool for large scale messaging.

Authentification

Get your token to make requests to the API.

Get token

The token is required for all requests made to the REST API. With your token, you can make every request to the API server. It's your entry ticket ! Tokens are available for 15 days. To use this API you need a client ID and a client secret which can be created in your account, under the API section (https://smsway.mobi/app/user/api).

Example request:

curl -X POST "https://api.smsway.mobi/api/auth" \
-H "Accept: application/json" \
-H 'Cache-Control: no-cache' \
    -d "client_id"="{{ CLIENT_ID }}" \
    -d "client_secret"="{{ CLIENT_SECRET }}" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json'
);

$curl = curl_init("https://api.smsway.mobi/api/auth");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'client_id' => '{{ CLIENT_ID }}',
        'client_secret' => '{{ CLIENT_SECRET }}',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/auth",
    "method": "POST",
    "data": {
        "client_id": {{ CLIENT_ID }},
        "client_secret": "{{ CLIENT_SECRET }}"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjE1YTA2ZjYwMjNlZTM3NDk5MGM3NWI2MjU1YWFiZDM1M2IxZDE5OGEyOWRjZTYxZDNhZjE1YTgzOTBkNWVjYTA5NWUzMWQyM2NiOTRmOTBhIn0.eyJhdWQiOiI2IiwianRpIjoiMTVhMDZmNjAyM2VlMzc0OTkwYzc1YjYyNTVhYWJkMzUzYjFkMTk4YTI5ZGNlNjFkM2FmMTVhODM5MGQ1ZWNhMDk1ZTMxZDIzY2I5NGY5MGEiLCJpYXQiOjE1MTczMDU3OTIsIm5iZiI6MTUxNzMwNTc5MiwiZXhwIjoxNTQ4ODQxNzkyLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.vPWr-hgb69Jxg55atUK3i58ZVrGCQOWyZUiOhNZSVHJBB1Kj-lNbrvo0v_wndvdGDjpVCDVjyM6NHXWSUK_GoVTTrX5b0TH1_pieP6DX2HcICOrvqTNTUmGL2tVoTa2gkii6JT8WVWY3jnPtXHoj_Gcs788mKe5bURRzsmpSXLxwoAyH4UvdtJnqoDBSJCEbyp1Cq457rzixIJtnwNQvVUrtj6qWMX25HYL0giR6hKHP5aOBt8kuIVDArRn8RwVl7-YD5mhXYedo_pkRcOoRzKfkns4CTO1QIQFKn8-nW9nyVTRIz0D4Putt4MouYBIO4bBh-X1nogND4OOFVPaIhUlQH-azYWLMER7zyPP78aDfY__2pWPZmVlziEt4gPvayRWpH4e6Mwfb607J7DuGKbBms6EUy2Fj5mh0fdPB3XcHQ1nOngF-BAYy-QVAxAhk7wQM3TrBD1GMkA1x3Z91gWoOTqiXbwc0yCIEtwg9PxA3U42dzWzej3EIYXGIosR8qN0ldkQAM2Ll3e3Fn0F-7NNzVHu8ekHErzQJ1gt-1wo9FM6DvScQp0oI1vHfZNKSev5ulnrmy49-4r0OT5hCQY6co0-lgQdDmFYh5AQQfhF1B9VFVmTgH-uwf3AMeIr5RrYphAh-2ZP2POrvFHV7gF4HSLqy-dtPAeVAowFBcXg",
    "token_type": "bearer",
    "expires_at": {
        "date": "2019-01-30 10:49:52.000000",
        "timezone_type": 3,
        "timezone": "Europe/Brussels"
    }
}

HTTP Request

POST api/auth

Parameters

Parameter Type Status Description
client_id integer required
client_secret string required

Contacts

Manage contacts trough API

Lists of contacts

List all the contacts matching to search criteria.

Example request:

curl -X GET "https://api.smsway.mobi/api/contacts" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "per_page"="201" \
    -d "page"="431983652" \
    -d "list_id"="97" \
    -d "search"="sed" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/contacts");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/contacts",
    "method": "GET",
    "data": {
        "per_page": 201,
        "page": 431983652,
        "list_id": 97,
        "search": "sed"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "current_page": 1,
    "data": [
        {
            "id": 2,
            "number": 32485376955,
            "number_country_code": "BE",
            "lastname": null,
            "firstname": null,
            "email": null,
            "gender": null,
            "date_of_birth": null,
            "zipcode": null,
            "city": null,
            "country": null,
            "additional_data": null,
            "custom_1": null,
            "custom_2": null,
            "custom_3": null,
            "user_id": 1,
            "created_at": "2018-01-29 14:11:19",
            "updated_at": "2018-01-29 14:11:19"
        }
    ],
    "first_page_url": "https://api.smsway.mobi/contacts?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.smsway.mobi/contacts?page=1",
    "next_page_url": null,
    "path": "https://api.smsway.mobi/contacts",
    "per_page": 10,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET api/contacts

HEAD api/contacts

Parameters

Parameter Type Status Description
per_page integer optional Between: 0 and 1000
page integer optional Minimum: 0
list_id integer optional
search string optional Maximum: 1000

Contact detail

Get information data about a contact.

Example request:

curl -X GET "https://api.smsway.mobi/api/contacts/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/contacts/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/contacts/{id}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": {
        "id": 2,
        "number": 32485376955,
        "number_country_code": "BE",
        "lastname": null,
        "firstname": null,
        "email": null,
        "gender": null,
        "date_of_birth": null,
        "zipcode": null,
        "city": null,
        "country": null,
        "additional_data": null,
        "custom_1": null,
        "custom_2": null,
        "custom_3": null,
        "user_id": 1,
        "created_at": "2018-01-29 14:11:19",
        "updated_at": "2018-01-29 14:11:19"
    }
}

HTTP Request

GET api/contacts/{id}

HEAD api/contacts/{id}

Update a contact

Example request:

curl -X POST "https://api.smsway.mobi/api/contacts/{id}" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "number_country_code"="facere" \
    -d "number"="20" \
    -d "lastname"="facere" \
    -d "firstname"="facere" \
    -d "email"="paufderhar@example.com" \
    -d "gender"="f" \
    -d "date_of_birth"="2006-03-06" \
    -d "zipcode"="facere" \
    -d "city"="facere" \
    -d "country"="facere" \
    -d "additional_data"="facere" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/contacts/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'number_country_code' => 'facere',
        'number' => '20',
        'lastname' => 'facere',
        'firstname' => 'facere',
        'email' => 'paufderhar@example.com',
        'gender' => 'f',
        'date_of_birth' => '2006-03-06',
        'zipcode' => 'facere',
        'city' => 'facere',
        'country' => 'facere',
        'additional_data' => 'facere',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/contacts/{id}",
    "method": "POST",
    "data": {
        "number_country_code": "facere",
        "number": 20,
        "lastname": "facere",
        "firstname": "facere",
        "email": "paufderhar@example.com",
        "gender": "f",
        "date_of_birth": "2006-03-06",
        "zipcode": "facere",
        "city": "facere",
        "country": "facere",
        "additional_data": "facere"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/contacts/{id}

Parameters

Parameter Type Status Description
number_country_code string required Must have the size of 2
number string required Between: 6 and 24
lastname string optional Maximum: 100
firstname string optional Maximum: 100
email email optional Maximum: 100
gender string optional m or f
date_of_birth date optional
zipcode string optional Maximum: 8
city string optional Maximum: 40
country string optional Must have the size of 2
additional_data string optional Maximum: 1000

Create a contact

Example request:

curl -X POST "https://api.smsway.mobi/api/contacts" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "number_country_code"="quis" \
    -d "number"="11" \
    -d "lastname"="quis" \
    -d "firstname"="quis" \
    -d "email"="johathan.schmitt@example.net" \
    -d "gender"="m" \
    -d "date_of_birth"="1983-11-25" \
    -d "zipcode"="quis" \
    -d "city"="quis" \
    -d "country"="quis" \
    -d "additional_data"="quis" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/contacts");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'number_country_code' => 'quis',
        'number' => '11',
        'lastname' => 'quis',
        'firstname' => 'quis',
        'email' => 'johathan.schmitt@example.net',
        'gender' => 'm',
        'date_of_birth' => '1983-11-25',
        'zipcode' => 'quis',
        'city' => 'quis',
        'country' => 'quis',
        'additional_data' => 'quis',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/contacts",
    "method": "POST",
    "data": {
        "number_country_code": "quis",
        "number": 11,
        "lastname": "quis",
        "firstname": "quis",
        "email": "johathan.schmitt@example.net",
        "gender": "m",
        "date_of_birth": "1983-11-25",
        "zipcode": "quis",
        "city": "quis",
        "country": "quis",
        "additional_data": "quis"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/contacts

Parameters

Parameter Type Status Description
number_country_code string required Must have the size of 2
number string required Between: 6 and 24
lastname string optional Maximum: 100
firstname string optional Maximum: 100
email email optional Maximum: 100
gender string optional m or f
date_of_birth date optional
zipcode string optional Maximum: 8
city string optional Maximum: 40
country string optional Must have the size of 2
additional_data string optional Maximum: 1000

Delete a contact

Example request:

curl -X DELETE "https://api.smsway.mobi/api/contacts/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/contacts/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/contacts/{id}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/contacts/{id}

Drafts

Manage drafts trough API

Lists of drafts

List all the drafts.

Example request:

curl -X GET "https://api.smsway.mobi/api/drafts" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/drafts");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/drafts",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "current_page": 1,
    "data": [
        {
            "id": 3,
            "user_id": 1,
            "form_data": "{\"recipients\":[{\"id\":\"list:2\",\"name\":\"Alexis\",\"icon\":\"icon dripicons-user-group\"},{\"id\":\"list:2\",\"name\":\"Alexis\",\"icon\":\"icon dripicons-user-group\"}],\"content\":null,\"sender\":null,\"flash\":false,\"skip_duplicates\":true,\"scheduled\":0,\"date\":null,\"test\":null}",
            "created_at": "2017-12-22 09:09:17",
            "updated_at": "2017-12-22 09:10:08"
        }
    ],
    "first_page_url": "https://api.smsway.mobi/drafts?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.smsway.mobi/drafts?page=1",
    "next_page_url": null,
    "path": "https://api.smsway.mobi/drafts",
    "per_page": 20,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET api/drafts

HEAD api/drafts

Get draft

Display one draft.

Example request:

curl -X GET "https://api.smsway.mobi/api/drafts/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/drafts/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/drafts/{id}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": {
        "id": 3,
        "user_id": 1,
        "form_data": "{\"recipients\":[{\"id\":\"list:2\",\"name\":\"Alexis\",\"icon\":\"icon dripicons-user-group\"},{\"id\":\"list:2\",\"name\":\"Alexis\",\"icon\":\"icon dripicons-user-group\"}],\"content\":null,\"sender\":null,\"flash\":false,\"skip_duplicates\":true,\"scheduled\":0,\"date\":null,\"test\":null}",
        "created_at": "2017-12-22 09:09:17",
        "updated_at": "2017-12-22 09:10:08"
    }
}

HTTP Request

GET api/drafts/{id}

HEAD api/drafts/{id}

Delete draft

Delete a draft.

Example request:

curl -X DELETE "https://api.smsway.mobi/api/drafts/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/drafts/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/drafts/{id}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/drafts/{id}

Lists

Manage lists trough API

Get lists

List all the contacts lists.

Example request:

curl -X GET "https://api.smsway.mobi/api/lists" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/lists");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/lists",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "current_page": 1,
    "data": [
        {
            "id": 1,
            "name": "List name",
            "user_id": 1,
            "created_at": "2018-01-30 09:30:49",
            "updated_at": "2018-01-30 09:30:49",
            "total_contacts": 0
        }
    ],
    "first_page_url": "https://api.smsway.mobi/lists?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.smsway.mobi/lists?page=1",
    "next_page_url": null,
    "path": "https://api.smsway.mobi/lists",
    "per_page": 10,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET api/lists

HEAD api/lists

Get list

Get one list data.

Example request:

curl -X GET "https://api.smsway.mobi/api/lists/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/lists/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/lists/{id}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": {
        "id": 1,
        "name": "List name",
        "user_id": 1,
        "created_at": "2018-01-30 09:30:49",
        "updated_at": "2018-01-30 09:30:49",
        "total_contacts": 0
    }
}

HTTP Request

GET api/lists/{id}

HEAD api/lists/{id}

Create a list

Example request:

curl -X POST "https://api.smsway.mobi/api/lists" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "name"="qui" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/lists");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'name' => 'qui',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/lists",
    "method": "POST",
    "data": {
        "name": "qui"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/lists

Parameters

Parameter Type Status Description
name string required Maximum: 40

Update list

Update a contact list.

Example request:

curl -X POST "https://api.smsway.mobi/api/lists/{id}" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "name"="occaecati" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/lists/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'name' => 'occaecati',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/lists/{id}",
    "method": "POST",
    "data": {
        "name": "occaecati"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/lists/{id}

Parameters

Parameter Type Status Description
name string required Maximum: 40

Delete list

Delete a contact list.

Example request:

curl -X DELETE "https://api.smsway.mobi/api/lists/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/lists/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/lists/{id}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/lists/{id}

SMS

Send and manage SMS trough API

Get SMS history

List all the SMS campaigns matching to search criteria.

Example request:

curl -X GET "https://api.smsway.mobi/api/sms" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "per_page"="839" \
    -d "page"="1800259606" \
    -d "planned"="1" \
    -d "content"="quo" \
    -d "status"="WAITING" \
    -d "from_date"="2010-04-23" \
    -d "to_date"="2010-04-23" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/sms");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/sms",
    "method": "GET",
    "data": {
        "per_page": 839,
        "page": 1800259606,
        "planned": "1",
        "content": "quo",
        "status": "WAITING",
        "from_date": "2010-04-23",
        "to_date": "2010-04-23"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "current_page": 1,
    "data": [
        {
            "id": 1772752863720,
            "user_id": 1,
            "content": "Votre code de validation est : 9713",
            "sender": "SMSWay",
            "flash": 0,
            "user_ref": null,
            "gateway": "web",
            "date": "2018-01-27 15:18:00",
            "status": {
                "id": "SENDED",
                "status": "Envoyé",
                "css_class": "success",
                "icon": "icon dripicons-checkmark",
                "position": 3
            },
            "created_at": "2018-01-27 15:18:00",
            "updated_at": "2018-01-27 15:18:00",
            "recipients_total": 1,
            "sent_total": 1,
            "label": "27\/01\/2018 : \"Votre code de validation est : 9713\" vers 1 contact",
            "total_cost": 0.08
        }
    ],
    "first_page_url": "https://api.smsway.mobi/sms?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.smsway.mobi/sms?page=1",
    "next_page_url": null,
    "path": "https://api.smsway.mobi/sms",
    "per_page": 20,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET api/sms

HEAD api/sms

Parameters

Parameter Type Status Description
per_page integer optional Between: 0 and 1000
page integer optional Minimum: 0
planned string optional 0 or 1
content string optional
status string optional ERROR, PROCESSING, SENDED or WAITING
from_date date optional
to_date date optional

Get SMS

Get info about one specific SMS.

Example request:

curl -X GET "https://api.smsway.mobi/api/sms/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/sms/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/sms/{id}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": {
        "id": 1772752863720,
        "user_id": 1,
        "content": "Votre code de validation est : 9713",
        "sender": "SMSWay",
        "flash": 0,
        "user_ref": null,
        "gateway": "web",
        "date": "2018-01-27 15:18:00",
        "status": {
            "id": "SENDED",
            "status": "Envoyé",
            "css_class": "success",
            "icon": "icon dripicons-checkmark",
            "position": 3
        },
        "created_at": "2018-01-27 15:18:00",
        "updated_at": "2018-01-27 15:18:00",
        "recipients_total": 1,
        "sent_total": 1,
        "label": "27\/01\/2018 : \"Votre code de validation est : 9713\" vers 1 contact",
        "total_cost": 0.08
    }
}

HTTP Request

GET api/sms/{id}

HEAD api/sms/{id}

Send SMS

Send new SMS.

Example request:

curl -X POST "https://api.smsway.mobi/api/sms" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "recipients"="tempora" \
    -d "content"="tempora" \
    -d "user_ref"="tempora" \
    -d "skip_duplicates"="0" \
    -d "date"="Wednesday, 31-Jan-18 12:03:34 CET" \
    -d "sender"="tempora" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/sms");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'recipients' => 'tempora',
        'content' => 'tempora',
        'user_ref' => 'tempora',
        'skip_duplicates' => '0',
        'date' => 'Wednesday, 31-Jan-18 12:03:34 CET',
        'sender' => 'tempora',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/sms",
    "method": "POST",
    "data": {
        "recipients": "tempora",
        "content": "tempora",
        "user_ref": "tempora",
        "skip_duplicates": "0",
        "date": "Wednesday, 31-Jan-18 12:03:34 CET",
        "sender": "tempora"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/sms

Parameters

Parameter Type Status Description
recipients string required
content string required Maximum: 1600
user_ref string optional Maximum: 40
skip_duplicates string optional 0 or 1
date date optional Must be a date after: Tuesday, 30-Jan-18 12:03:34 CET
sender string optional Maximum: 11

Status list

Get all SMS status

Example request:

curl -X GET "https://api.smsway.mobi/api/sms/status" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/sms/status");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/sms/status",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

[
    {
        "id": "WAITING",
        "status": "En attente",
        "css_class": "secondary",
        "icon": "icon dripicons-clock",
        "position": 1
    },
    {
        "id": "PROCESSING",
        "status": "En cours d'envoi",
        "css_class": "warning",
        "icon": "icon dripicons-loading",
        "position": 2
    },
    {
        "id": "SENDED",
        "status": "Envoyé",
        "css_class": "success",
        "icon": "icon dripicons-checkmark",
        "position": 3
    },
    {
        "id": "ERROR",
        "status": "Erreur",
        "css_class": "danger",
        "icon": "icon dripicons-wrong",
        "position": 4
    }
]

HTTP Request

GET api/sms/status

HEAD api/sms/status

Emoji list

Get emoji list

Example request:

curl -X GET "https://api.smsway.mobi/api/sms/emoji" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/sms/emoji");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/sms/emoji",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

[
    "☀",
    "☁",
    "★",
    "☎",
    "♠",
    "♣",
    "♥",
    "♦",
    "♫",
    "❄",
    "🍂",
    "🍴",
    "🍔",
    "🍕",
    "🍦",
    "🍷",
    "🍺",
    "❤",
    "🍀",
    "🎂",
    "💐",
    "🚹",
    "🚺",
    "🚭",
    "✉",
    "✏",
    "💡",
    "💣",
    "✂",
    "🛀",
    "⚽",
    "⚠",
    "🚲",
    "🚕",
    "🚗",
    "🚃",
    "✈",
    "🚀",
    "🚢",
    "🚄",
    "🚇",
    "🚉",
    "🚌",
    "🚒",
    "🚓",
    "🚧",
    "🚩",
    "🚪",
    "🚫",
    "🚬",
    "🚶",
    "🚻",
    "🚼",
    "🚽"
]

HTTP Request

GET api/sms/emoji

HEAD api/sms/emoji

Get variables

Get variables of contact that can be customized in the SMS

Example request:

curl -X GET "https://api.smsway.mobi/api/sms/variables" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/sms/variables");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/sms/variables",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

[
    "id",
    "number",
    "number_country_code",
    "lastname",
    "firstname",
    "email",
    "gender",
    "date_of_birth",
    "zipcode",
    "city",
    "country",
    "additional_data",
    "created_at",
    "date",
    "year",
    "hour",
    "date+hour"
]

HTTP Request

GET api/sms/variables

HEAD api/sms/variables

Delete SMS

Delete a planned SMS

Example request:

curl -X DELETE "https://api.smsway.mobi/api/sms/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/sms/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/sms/{id}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/sms/{id}

Senders

Manage senders (originators) trough API

Get senders

List all the senders.

Example request:

curl -X GET "https://api.smsway.mobi/api/senders" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/senders");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/senders",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "current_page": 1,
    "data": [
        {
            "id": 4,
            "user_id": 1,
            "name": "salut",
            "created_at": "2017-12-27 18:19:16",
            "updated_at": "2017-12-27 18:19:16"
        },
        {
            "id": 2,
            "user_id": 1,
            "name": "Test",
            "created_at": "2017-12-22 09:46:45",
            "updated_at": "2017-12-22 09:46:45"
        },
        {
            "id": 3,
            "user_id": 1,
            "name": "Test2",
            "created_at": "2017-12-22 09:47:44",
            "updated_at": "2017-12-22 09:47:44"
        }
    ],
    "first_page_url": "https://api.smsway.mobi/senders?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.smsway.mobi/senders?page=1",
    "next_page_url": null,
    "path": "https://api.smsway.mobi/senders",
    "per_page": 10,
    "prev_page_url": null,
    "to": 3,
    "total": 3
}

HTTP Request

GET api/senders

HEAD api/senders

Get sender

Get data about one specific sender.

Example request:

curl -X GET "https://api.smsway.mobi/api/senders/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/senders/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/senders/{id}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": {
        "id": 2,
        "user_id": 1,
        "name": "Test",
        "created_at": "2017-12-22 09:46:45",
        "updated_at": "2017-12-22 09:46:45"
    }
}

HTTP Request

GET api/senders/{id}

HEAD api/senders/{id}

Delete sender

Delete a sender.

Example request:

curl -X DELETE "https://api.smsway.mobi/api/senders/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/senders/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/senders/{id}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/senders/{id}

Create a sender

Example request:

curl -X POST "https://api.smsway.mobi/api/senders" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "name"="culpa" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/senders");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'name' => 'culpa',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/senders",
    "method": "POST",
    "data": {
        "name": "culpa"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/senders

Parameters

Parameter Type Status Description
name string required Maximum: 11

Update a sender

Update a sender.

Example request:

curl -X POST "https://api.smsway.mobi/api/senders/{id}" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "name"="mollitia" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/senders/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'name' => 'mollitia',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/senders/{id}",
    "method": "POST",
    "data": {
        "name": "mollitia"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/senders/{id}

Parameters

Parameter Type Status Description
name string required Maximum: 11

Stats

Get SMS stats.

Get stats

Get stats about SMS history

Example request:

curl -X GET "https://api.smsway.mobi/api/stats" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "with_history"="0" \
    -d "from_date"="1989-05-16" \
    -d "to_date"="1989-05-16" \
    -d "status"="PROCESSING" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/stats");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/stats",
    "method": "GET",
    "data": {
        "with_history": "0",
        "from_date": "1989-05-16",
        "to_date": "1989-05-16",
        "status": "PROCESSING"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "stats": {
        "sended": {
            "total": 1,
            "percent": 100
        },
        "delivered": {
            "total": 0,
            "percent": "0"
        },
        "clicked": {
            "total": 0,
            "percent": "0"
        },
        "error": {
            "total": 0,
            "percent": "0"
        }
    },
    "request": []
}

HTTP Request

GET api/stats

HEAD api/stats

Parameters

Parameter Type Status Description
with_history string optional 0 or 1
from_date date optional
to_date date optional
status string optional ERROR, PROCESSING, SENDED or WAITING

Templates

Manage templates trough API

Get templates list

List all templates.

Example request:

curl -X GET "https://api.smsway.mobi/api/templates" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/templates");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/templates",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "current_page": 1,
    "data": [
        {
            "id": 2,
            "user_id": 1,
            "content": "Hello {{firstname}}, this is a SMS !",
            "created_at": "2018-01-30 10:35:03",
            "updated_at": "2018-01-30 10:35:03"
        }
    ],
    "first_page_url": "https://api.smsway.mobi/templates?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.smsway.mobi/templates?page=1",
    "next_page_url": null,
    "path": "https://api.smsway.mobi/templates",
    "per_page": 20,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET api/templates

HEAD api/templates

Get template

Get info about one specific template.

Example request:

curl -X GET "https://api.smsway.mobi/api/templates/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/templates/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/templates/{id}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": {
        "id": 2,
        "user_id": 1,
        "content": "Hello {{firstname}}, this is a SMS !",
        "created_at": "2018-01-30 10:35:03",
        "updated_at": "2018-01-30 10:35:03"
    }
}

HTTP Request

GET api/templates/{id}

HEAD api/templates/{id}

Create template

Create a new template.

Example request:

curl -X POST "https://api.smsway.mobi/api/templates" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "content"="doloremque" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/templates");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'content' => 'doloremque',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/templates",
    "method": "POST",
    "data": {
        "content": "doloremque"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/templates

Parameters

Parameter Type Status Description
content string required Maximum: 1600

Update template

Update a existing template.

Example request:

curl -X POST "https://api.smsway.mobi/api/templates/{id}" \
-H "Accept: application/json" \
-H 'Authorization: Bearer {{ YOURTOKEN }}' \
-H 'Cache-Control: no-cache' \
    -d "content"="occaecati" \
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/templates/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'content' => 'occaecati',
    )));
curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/templates/{id}",
    "method": "POST",
    "data": {
        "content": "occaecati"
},
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/templates/{id}

Parameters

Parameter Type Status Description
content string required Maximum: 1600

Delete template

Delete a template.

Example request:

curl -X DELETE "https://api.smsway.mobi/api/templates/{id}" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/templates/{id}");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/templates/{id}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/templates/{id}

User

Manage templates trough API

Get user

Get your account data

Example request:

curl -X GET "https://api.smsway.mobi/api/user" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/user");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/user",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "data": {
        "id": 1,
        "lastname": "de Moffarts",
        "firstname": "Alexis",
        "email": "info@alexisdemoffarts.be",
        "phone": "+32485376955",
        "company": null,
        "street_address": null,
        "zipcode": null,
        "city": null,
        "country": null,
        "vat": null,
        "default_country_code": "BE",
        "alert_credits": 100,
        "alert_total_sms": null,
        "verify_email": 1,
        "verify_phone": 1,
        "verify_phone_code": 9713,
        "email_mail2sms": null,
        "api_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijk5YmMxMDdjZjYyYjAwM2E1OGRiNzEzZmE3NWUwMmYzNzQyZTQwZGQ4MmU4Y2JlYTUzYzczOTViYmRkNDdmZWQ1Yjc5ZmZjMTg0YWI0Y2E5In0.eyJhdWQiOiI2IiwianRpIjoiOTliYzEwN2NmNjJiMDAzYTU4ZGI3MTNmYTc1ZTAyZjM3NDJlNDBkZDgyZThjYmVhNTNjNzM5NWJiZGQ0N2ZlZDViNzlmZmMxODRhYjRjYTkiLCJpYXQiOjE1MTcyOTc5NDMsIm5iZiI6MTUxNzI5Nzk0MywiZXhwIjoxNTQ4ODMzOTQzLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.bVf5oENT2LxMb3tYbSJHPgeVjCnf2kMDnXwea4tJNdWSDNkcf6WOoNi85CdFog-hZjukgbOSbUyRj_kppKjP7UBQINXEGLeBHTBPJSleJadztIeIQHbcolb-fuKQG-4jCjZ_Zh4h-RQ-4OyyAahYmy-l28g8TYwPLuULLgNKdSBHEsd46tgsX5ZjvsFRMarGWUIMz9AI4I1Hb2-KioyIaYdzQ9IRgJDZ5T8VgVnsOtBsJ3IMGjastlxHphcB7rGmQ7np6tE1UTMNKXvG_ViRrVv4GMMb9vSwiP1K8KEhWDOUKoAV0GXlT3RRvypI9b-hNZT41-CFxKHlmpDkqaqEow1vuIvgFPPxi4_9raRazT2yOtBWecnZtOxti8MVgNU91vFt9BbqJX1S6KS3JUd7r9TjkIjJAOnVafqkhAQ-eZfrFfC94cnmAzJJsM8msvf_OPBZEP597bU4eLiswbxVvqyRBM7AGwLNnAIUo8SE1Q61daAVNNc2Nunp1eWDODiy_6OLhvjNneensNpS-neMTVkkx_oyXKVrXX5JjMxF5-0mF9At1sDQgJ4AYpPJxzyMgAU176eN7KBHaGpgHUYMtR8h9BkdG3HG9gF1hpExvx9hmF5mfglGsv1cNSBwc25J5ctTXpceX_iDMys4EUyZ4JfNm8AY46qp4RmeHTyR8qY",
        "stripe_id": null,
        "card_brand": null,
        "card_last_four": null,
        "card_exp_month": null,
        "card_exp_year": null,
        "trial_ends_at": null,
        "admin": 1,
        "active": 1,
        "last_ip": "127.0.0.1",
        "last_login": "2018-01-30 08:39:03",
        "created_at": "2018-01-27 15:17:29",
        "updated_at": "2018-01-30 08:39:03",
        "currency": "EUR",
        "credits": 49.922,
        "validated": true
    }
}

HTTP Request

GET api/user

HEAD api/user

Invoices

Get your invoices list

Example request:

curl -X GET "https://api.smsway.mobi/api/user/invoices" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/user/invoices");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/user/invoices",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "current_page": 1,
    "data": [
        {
            "id": 4,
            "user_id": 1,
            "number": "S-2018-F00002",
            "date": "2018-01-19 14:10:51",
            "paid_with": "Visa",
            "paid_id": "AZ",
            "paid_risk": "normal",
            "status": 1,
            "created_at": "2018-01-19 14:10:51",
            "updated_at": "2018-01-19 14:10:51",
            "total": "€1,210.00"
        },
        {
            "id": 3,
            "user_id": 1,
            "number": "S-2018-F00001",
            "date": "2018-01-19 14:09:35",
            "paid_with": "Visa",
            "paid_id": "AZ",
            "paid_risk": "normal",
            "status": 1,
            "created_at": "2018-01-19 14:09:35",
            "updated_at": "2018-01-19 14:09:35",
            "total": "€1,210.00"
        },
        {
            "id": 2,
            "user_id": 1,
            "number": "S-2018-F00002",
            "date": "2018-01-19 14:08:15",
            "paid_with": "Visa",
            "paid_id": "AZ",
            "paid_risk": "normal",
            "status": 1,
            "created_at": "2018-01-19 14:08:15",
            "updated_at": "2018-01-19 14:08:15",
            "total": "€1,210.00"
        },
        {
            "id": 1,
            "user_id": 1,
            "number": "S-2017-1",
            "date": "2017-12-22 09:20:52",
            "paid_with": null,
            "paid_id": null,
            "paid_risk": null,
            "status": 3,
            "created_at": "2017-12-22 09:20:52",
            "updated_at": "2018-01-17 16:57:49",
            "total": "€121.00"
        }
    ],
    "first_page_url": "https://api.smsway.mobi/user\/invoices?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.smsway.mobi/user\/invoices?page=1",
    "next_page_url": null,
    "path": "https://api.smsway.mobi/user\/invoices",
    "per_page": 10,
    "prev_page_url": null,
    "to": 4,
    "total": 4
}

HTTP Request

GET api/user/invoices

HEAD api/user/invoices

Countries

Get countries list

Example request:

curl -X GET "https://api.smsway.mobi/api/user/countries" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/user/countries");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/user/countries",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "AF": {
        "name": "Afghanistan",
        "code": "AF",
        "phone_code": 93,
        "name_with_phone_code": "(+93) Afghanistan",
        "price": 0.081
    },
    "AX": {
        "name": "Åland Islands",
        "code": "AX",
        "phone_code": "",
        "name_with_phone_code": "(+) Åland Islands",
        "price": 0
    },
    "AL": {
        "name": "Albania",
        "code": "AL",
        "phone_code": 355,
        "name_with_phone_code": "(+355) Albania",
        "price": 0.095
    },
    "DZ": {
        "name": "Algeria",
        "code": "DZ",
        "phone_code": 213,
        "name_with_phone_code": "(+213) Algeria",
        "price": 0.098
    },
    "AS": {
        "name": "American Samoa",
        "code": "AS",
        "phone_code": 1684,
        "name_with_phone_code": "(+1684) American Samoa",
        "price": 0.07
    },
    "AD": {
        "name": "Andorra",
        "code": "AD",
        "phone_code": 376,
        "name_with_phone_code": "(+376) Andorra",
        "price": 0.02
    },
    "AO": {
        "name": "Angola",
        "code": "AO",
        "phone_code": 244,
        "name_with_phone_code": "(+244) Angola",
        "price": 0.042
    },
    "AI": {
        "name": "Anguilla",
        "code": "AI",
        "phone_code": 1264,
        "name_with_phone_code": "(+1264) Anguilla",
        "price": 0.063
    },
    "AQ": {
        "name": "Antarctica",
        "code": "AQ",
        "phone_code": 672,
        "name_with_phone_code": "(+672) Antarctica",
        "price": 0
    },
    "AG": {
        "name": "Antigua & Barbuda",
        "code": "AG",
        "phone_code": 1268,
        "name_with_phone_code": "(+1268) Antigua & Barbuda",
        "price": 0.05
    },
    "AR": {
        "name": "Argentina",
        "code": "AR",
        "phone_code": 54,
        "name_with_phone_code": "(+54) Argentina",
        "price": 0.049
    },
    "AM": {
        "name": "Armenia",
        "code": "AM",
        "phone_code": 374,
        "name_with_phone_code": "(+374) Armenia",
        "price": 0.098
    },
    "AW": {
        "name": "Aruba",
        "code": "AW",
        "phone_code": 297,
        "name_with_phone_code": "(+297) Aruba",
        "price": 0.09
    },
    "AC": {
        "name": "Ascension Island",
        "code": "AC",
        "phone_code": "",
        "name_with_phone_code": "(+) Ascension Island",
        "price": 0
    },
    "AU": {
        "name": "Australia",
        "code": "AU",
        "phone_code": 61,
        "name_with_phone_code": "(+61) Australia",
        "price": 0.056
    },
    "AT": {
        "name": "Austria",
        "code": "AT",
        "phone_code": 43,
        "name_with_phone_code": "(+43) Austria",
        "price": 0.084
    },
    "AZ": {
        "name": "Azerbaijan",
        "code": "AZ",
        "phone_code": 994,
        "name_with_phone_code": "(+994) Azerbaijan",
        "price": 0.133
    },
    "BS": {
        "name": "Bahamas",
        "code": "BS",
        "phone_code": 1242,
        "name_with_phone_code": "(+1242) Bahamas",
        "price": 0.021
    },
    "BH": {
        "name": "Bahrain",
        "code": "BH",
        "phone_code": 973,
        "name_with_phone_code": "(+973) Bahrain",
        "price": 0.018
    },
    "BD": {
        "name": "Bangladesh",
        "code": "BD",
        "phone_code": 880,
        "name_with_phone_code": "(+880) Bangladesh",
        "price": 0.078
    },
    "BB": {
        "name": "Barbados",
        "code": "BB",
        "phone_code": 1246,
        "name_with_phone_code": "(+1246) Barbados",
        "price": 0.064
    },
    "BY": {
        "name": "Belarus",
        "code": "BY",
        "phone_code": 375,
        "name_with_phone_code": "(+375) Belarus",
        "price": 0.091
    },
    "BE": {
        "name": "Belgium",
        "code": "BE",
        "phone_code": 32,
        "name_with_phone_code": "(+32) Belgium",
        "price": 0.078
    },
    "BZ": {
        "name": "Belize",
        "code": "BZ",
        "phone_code": 501,
        "name_with_phone_code": "(+501) Belize",
        "price": 0.018
    },
    "BJ": {
        "name": "Benin",
        "code": "BJ",
        "phone_code": 229,
        "name_with_phone_code": "(+229) Benin",
        "price": 0.056
    },
    "BM": {
        "name": "Bermuda",
        "code": "BM",
        "phone_code": 1441,
        "name_with_phone_code": "(+1441) Bermuda",
        "price": 0.028
    },
    "BT": {
        "name": "Bhutan",
        "code": "BT",
        "phone_code": 975,
        "name_with_phone_code": "(+975) Bhutan",
        "price": 0.067
    },
    "BO": {
        "name": "Bolivia",
        "code": "BO",
        "phone_code": 591,
        "name_with_phone_code": "(+591) Bolivia",
        "price": 0.056
    },
    "BA": {
        "name": "Bosnia & Herzegovina",
        "code": "BA",
        "phone_code": 387,
        "name_with_phone_code": "(+387) Bosnia & Herzegovina",
        "price": 0.087
    },
    "BW": {
        "name": "Botswana",
        "code": "BW",
        "phone_code": 267,
        "name_with_phone_code": "(+267) Botswana",
        "price": 0.035
    },
    "BR": {
        "name": "Brazil",
        "code": "BR",
        "phone_code": 55,
        "name_with_phone_code": "(+55) Brazil",
        "price": 0.046
    },
    "IO": {
        "name": "British Indian Ocean Territory",
        "code": "IO",
        "phone_code": 246,
        "name_with_phone_code": "(+246) British Indian Ocean Territory",
        "price": 0
    },
    "VG": {
        "name": "British Virgin Islands",
        "code": "VG",
        "phone_code": 1284,
        "name_with_phone_code": "(+1284) British Virgin Islands",
        "price": 0.014
    },
    "BN": {
        "name": "Brunei",
        "code": "BN",
        "phone_code": 673,
        "name_with_phone_code": "(+673) Brunei",
        "price": 0.018
    },
    "BG": {
        "name": "Bulgaria",
        "code": "BG",
        "phone_code": 359,
        "name_with_phone_code": "(+359) Bulgaria",
        "price": 0.09
    },
    "BF": {
        "name": "Burkina Faso",
        "code": "BF",
        "phone_code": 226,
        "name_with_phone_code": "(+226) Burkina Faso",
        "price": 0.018
    },
    "BI": {
        "name": "Burundi",
        "code": "BI",
        "phone_code": 257,
        "name_with_phone_code": "(+257) Burundi",
        "price": 0.014
    },
    "KH": {
        "name": "Cambodia",
        "code": "KH",
        "phone_code": 855,
        "name_with_phone_code": "(+855) Cambodia",
        "price": 0.057
    },
    "CM": {
        "name": "Cameroon",
        "code": "CM",
        "phone_code": 237,
        "name_with_phone_code": "(+237) Cameroon",
        "price": 0.056
    },
    "CA": {
        "name": "Canada",
        "code": "CA",
        "phone_code": 1,
        "name_with_phone_code": "(+1) Canada",
        "price": 0
    },
    "IC": {
        "name": "Canary Islands",
        "code": "IC",
        "phone_code": "",
        "name_with_phone_code": "(+) Canary Islands",
        "price": 0
    },
    "CV": {
        "name": "Cape Verde",
        "code": "CV",
        "phone_code": 238,
        "name_with_phone_code": "(+238) Cape Verde",
        "price": 0.087
    },
    "BQ": {
        "name": "Caribbean Netherlands",
        "code": "BQ",
        "phone_code": "",
        "name_with_phone_code": "(+) Caribbean Netherlands",
        "price": 0.032
    },
    "KY": {
        "name": "Cayman Islands",
        "code": "KY",
        "phone_code": 1345,
        "name_with_phone_code": "(+1345) Cayman Islands",
        "price": 0.029
    },
    "CF": {
        "name": "Central African Republic",
        "code": "CF",
        "phone_code": 236,
        "name_with_phone_code": "(+236) Central African Republic",
        "price": 0.018
    },
    "EA": {
        "name": "Ceuta & Melilla",
        "code": "EA",
        "phone_code": "",
        "name_with_phone_code": "(+) Ceuta & Melilla",
        "price": 0
    },
    "TD": {
        "name": "Chad",
        "code": "TD",
        "phone_code": 235,
        "name_with_phone_code": "(+235) Chad",
        "price": 0.028
    },
    "CL": {
        "name": "Chile",
        "code": "CL",
        "phone_code": 56,
        "name_with_phone_code": "(+56) Chile",
        "price": 0.05
    },
    "CN": {
        "name": "China",
        "code": "CN",
        "phone_code": 86,
        "name_with_phone_code": "(+86) China",
        "price": 0.036
    },
    "CX": {
        "name": "Christmas Island",
        "code": "CX",
        "phone_code": 61,
        "name_with_phone_code": "(+61) Christmas Island",
        "price": 0
    },
    "CC": {
        "name": "Cocos (Keeling) Islands",
        "code": "CC",
        "phone_code": 672,
        "name_with_phone_code": "(+672) Cocos (Keeling) Islands",
        "price": 0
    },
    "CO": {
        "name": "Colombia",
        "code": "CO",
        "phone_code": 57,
        "name_with_phone_code": "(+57) Colombia",
        "price": 0.015
    },
    "KM": {
        "name": "Comoros",
        "code": "KM",
        "phone_code": 269,
        "name_with_phone_code": "(+269) Comoros",
        "price": 0.02
    },
    "CG": {
        "name": "Congo - Brazzaville",
        "code": "CG",
        "phone_code": 242,
        "name_with_phone_code": "(+242) Congo - Brazzaville",
        "price": 0.029
    },
    "CD": {
        "name": "Congo - Kinshasa",
        "code": "CD",
        "phone_code": 242,
        "name_with_phone_code": "(+242) Congo - Kinshasa",
        "price": 0
    },
    "CK": {
        "name": "Cook Islands",
        "code": "CK",
        "phone_code": 682,
        "name_with_phone_code": "(+682) Cook Islands",
        "price": 0.018
    },
    "CR": {
        "name": "Costa Rica",
        "code": "CR",
        "phone_code": 506,
        "name_with_phone_code": "(+506) Costa Rica",
        "price": 0.018
    },
    "CI": {
        "name": "Côte d’Ivoire",
        "code": "CI",
        "phone_code": 225,
        "name_with_phone_code": "(+225) Côte d’Ivoire",
        "price": 0.053
    },
    "HR": {
        "name": "Croatia",
        "code": "HR",
        "phone_code": 385,
        "name_with_phone_code": "(+385) Croatia",
        "price": 0.046
    },
    "CU": {
        "name": "Cuba",
        "code": "CU",
        "phone_code": 53,
        "name_with_phone_code": "(+53) Cuba",
        "price": 0.115
    },
    "CW": {
        "name": "Curaçao",
        "code": "CW",
        "phone_code": "",
        "name_with_phone_code": "(+) Curaçao",
        "price": 0
    },
    "CY": {
        "name": "Cyprus",
        "code": "CY",
        "phone_code": 357,
        "name_with_phone_code": "(+357) Cyprus",
        "price": 0.077
    },
    "CZ": {
        "name": "Czechia",
        "code": "CZ",
        "phone_code": 420,
        "name_with_phone_code": "(+420) Czechia",
        "price": 0.074
    },
    "DK": {
        "name": "Denmark",
        "code": "DK",
        "phone_code": 45,
        "name_with_phone_code": "(+45) Denmark",
        "price": 0.042
    },
    "DG": {
        "name": "Diego Garcia",
        "code": "DG",
        "phone_code": "",
        "name_with_phone_code": "(+) Diego Garcia",
        "price": 0.133
    },
    "DJ": {
        "name": "Djibouti",
        "code": "DJ",
        "phone_code": 253,
        "name_with_phone_code": "(+253) Djibouti",
        "price": 0.077
    },
    "DM": {
        "name": "Dominica",
        "code": "DM",
        "phone_code": 1767,
        "name_with_phone_code": "(+1767) Dominica",
        "price": 0.028
    },
    "DO": {
        "name": "Dominican Republic",
        "code": "DO",
        "phone_code": 1809,
        "name_with_phone_code": "(+1809) Dominican Republic",
        "price": 0.098
    },
    "EC": {
        "name": "Ecuador",
        "code": "EC",
        "phone_code": 593,
        "name_with_phone_code": "(+593) Ecuador",
        "price": 0.056
    },
    "EG": {
        "name": "Egypt",
        "code": "EG",
        "phone_code": 20,
        "name_with_phone_code": "(+20) Egypt",
        "price": 0.069
    },
    "SV": {
        "name": "El Salvador",
        "code": "SV",
        "phone_code": 503,
        "name_with_phone_code": "(+503) El Salvador",
        "price": 0.036
    },
    "GQ": {
        "name": "Equatorial Guinea",
        "code": "GQ",
        "phone_code": 240,
        "name_with_phone_code": "(+240) Equatorial Guinea",
        "price": 0.008
    },
    "ER": {
        "name": "Eritrea",
        "code": "ER",
        "phone_code": 291,
        "name_with_phone_code": "(+291) Eritrea",
        "price": 0
    },
    "EE": {
        "name": "Estonia",
        "code": "EE",
        "phone_code": 372,
        "name_with_phone_code": "(+372) Estonia",
        "price": 0.074
    },
    "ET": {
        "name": "Ethiopia",
        "code": "ET",
        "phone_code": 251,
        "name_with_phone_code": "(+251) Ethiopia",
        "price": 0.018
    },
    "FK": {
        "name": "Falkland Islands",
        "code": "FK",
        "phone_code": 500,
        "name_with_phone_code": "(+500) Falkland Islands",
        "price": 0.076
    },
    "FO": {
        "name": "Faroe Islands",
        "code": "FO",
        "phone_code": 298,
        "name_with_phone_code": "(+298) Faroe Islands",
        "price": 0.014
    },
    "FJ": {
        "name": "Fiji",
        "code": "FJ",
        "phone_code": 679,
        "name_with_phone_code": "(+679) Fiji",
        "price": 0.112
    },
    "FI": {
        "name": "Finland",
        "code": "FI",
        "phone_code": 358,
        "name_with_phone_code": "(+358) Finland",
        "price": 0.084
    },
    "FR": {
        "name": "France",
        "code": "FR",
        "phone_code": 33,
        "name_with_phone_code": "(+33) France",
        "price": 0.063
    },
    "GF": {
        "name": "French Guiana",
        "code": "GF",
        "phone_code": 594,
        "name_with_phone_code": "(+594) French Guiana",
        "price": 0.101
    },
    "PF": {
        "name": "French Polynesia",
        "code": "PF",
        "phone_code": 689,
        "name_with_phone_code": "(+689) French Polynesia",
        "price": 0.07
    },
    "TF": {
        "name": "French Southern Territories",
        "code": "TF",
        "phone_code": 9999,
        "name_with_phone_code": "(+9999) French Southern Territories",
        "price": 0
    },
    "GA": {
        "name": "Gabon",
        "code": "GA",
        "phone_code": 241,
        "name_with_phone_code": "(+241) Gabon",
        "price": 0.018
    },
    "GM": {
        "name": "Gambia",
        "code": "GM",
        "phone_code": 220,
        "name_with_phone_code": "(+220) Gambia",
        "price": 0.018
    },
    "GE": {
        "name": "Georgia",
        "code": "GE",
        "phone_code": 995,
        "name_with_phone_code": "(+995) Georgia",
        "price": 0.115
    },
    "DE": {
        "name": "Germany",
        "code": "DE",
        "phone_code": 49,
        "name_with_phone_code": "(+49) Germany",
        "price": 0.091
    },
    "GH": {
        "name": "Ghana",
        "code": "GH",
        "phone_code": 233,
        "name_with_phone_code": "(+233) Ghana",
        "price": 0.018
    },
    "GI": {
        "name": "Gibraltar",
        "code": "GI",
        "phone_code": 350,
        "name_with_phone_code": "(+350) Gibraltar",
        "price": 0.014
    },
    "GR": {
        "name": "Greece",
        "code": "GR",
        "phone_code": 30,
        "name_with_phone_code": "(+30) Greece",
        "price": 0.059
    },
    "GL": {
        "name": "Greenland",
        "code": "GL",
        "phone_code": 299,
        "name_with_phone_code": "(+299) Greenland",
        "price": 0.018
    },
    "GD": {
        "name": "Grenada",
        "code": "GD",
        "phone_code": 1473,
        "name_with_phone_code": "(+1473) Grenada",
        "price": 0.022
    },
    "GP": {
        "name": "Guadeloupe",
        "code": "GP",
        "phone_code": 590,
        "name_with_phone_code": "(+590) Guadeloupe",
        "price": 0.056
    },
    "GU": {
        "name": "Guam",
        "code": "GU",
        "phone_code": 1671,
        "name_with_phone_code": "(+1671) Guam",
        "price": 0.028
    },
    "GT": {
        "name": "Guatemala",
        "code": "GT",
        "phone_code": 502,
        "name_with_phone_code": "(+502) Guatemala",
        "price": 0.031
    },
    "GG": {
        "name": "Guernsey",
        "code": "GG",
        "phone_code": "",
        "name_with_phone_code": "(+) Guernsey",
        "price": 0
    },
    "GN": {
        "name": "Guinea",
        "code": "GN",
        "phone_code": 224,
        "name_with_phone_code": "(+224) Guinea",
        "price": 0.071
    },
    "GW": {
        "name": "Guinea-Bissau",
        "code": "GW",
        "phone_code": 245,
        "name_with_phone_code": "(+245) Guinea-Bissau",
        "price": 0.098
    },
    "GY": {
        "name": "Guyana",
        "code": "GY",
        "phone_code": 592,
        "name_with_phone_code": "(+592) Guyana",
        "price": 0.042
    },
    "HT": {
        "name": "Haiti",
        "code": "HT",
        "phone_code": 509,
        "name_with_phone_code": "(+509) Haiti",
        "price": 0.052
    },
    "HN": {
        "name": "Honduras",
        "code": "HN",
        "phone_code": 504,
        "name_with_phone_code": "(+504) Honduras",
        "price": 0.036
    },
    "HK": {
        "name": "Hong Kong SAR China",
        "code": "HK",
        "phone_code": 852,
        "name_with_phone_code": "(+852) Hong Kong SAR China",
        "price": 0.056
    },
    "HU": {
        "name": "Hungary",
        "code": "HU",
        "phone_code": 36,
        "name_with_phone_code": "(+36) Hungary",
        "price": 0.081
    },
    "IS": {
        "name": "Iceland",
        "code": "IS",
        "phone_code": 354,
        "name_with_phone_code": "(+354) Iceland",
        "price": 0.056
    },
    "IN": {
        "name": "India",
        "code": "IN",
        "phone_code": 91,
        "name_with_phone_code": "(+91) India",
        "price": 0.014
    },
    "ID": {
        "name": "Indonesia",
        "code": "ID",
        "phone_code": 62,
        "name_with_phone_code": "(+62) Indonesia",
        "price": 0.035
    },
    "IR": {
        "name": "Iran",
        "code": "IR",
        "phone_code": 98,
        "name_with_phone_code": "(+98) Iran",
        "price": 0.022
    },
    "IQ": {
        "name": "Iraq",
        "code": "IQ",
        "phone_code": 964,
        "name_with_phone_code": "(+964) Iraq",
        "price": 0.081
    },
    "IE": {
        "name": "Ireland",
        "code": "IE",
        "phone_code": 353,
        "name_with_phone_code": "(+353) Ireland",
        "price": 0.07
    },
    "IM": {
        "name": "Isle of Man",
        "code": "IM",
        "phone_code": "",
        "name_with_phone_code": "(+) Isle of Man",
        "price": 0
    },
    "IL": {
        "name": "Israel",
        "code": "IL",
        "phone_code": 972,
        "name_with_phone_code": "(+972) Israel",
        "price": 0.018
    },
    "IT": {
        "name": "Italy",
        "code": "IT",
        "phone_code": 39,
        "name_with_phone_code": "(+39) Italy",
        "price": 0.074
    },
    "JM": {
        "name": "Jamaica",
        "code": "JM",
        "phone_code": 1876,
        "name_with_phone_code": "(+1876) Jamaica",
        "price": 0.042
    },
    "JP": {
        "name": "Japan",
        "code": "JP",
        "phone_code": 81,
        "name_with_phone_code": "(+81) Japan",
        "price": 0.091
    },
    "JE": {
        "name": "Jersey",
        "code": "JE",
        "phone_code": "",
        "name_with_phone_code": "(+) Jersey",
        "price": 0
    },
    "JO": {
        "name": "Jordan",
        "code": "JO",
        "phone_code": 962,
        "name_with_phone_code": "(+962) Jordan",
        "price": 0.063
    },
    "KZ": {
        "name": "Kazakhstan",
        "code": "KZ",
        "phone_code": 7,
        "name_with_phone_code": "(+7) Kazakhstan",
        "price": 0.042
    },
    "KE": {
        "name": "Kenya",
        "code": "KE",
        "phone_code": 254,
        "name_with_phone_code": "(+254) Kenya",
        "price": 0.084
    },
    "KI": {
        "name": "Kiribati",
        "code": "KI",
        "phone_code": 686,
        "name_with_phone_code": "(+686) Kiribati",
        "price": 0
    },
    "XK": {
        "name": "Kosovo",
        "code": "XK",
        "phone_code": "",
        "name_with_phone_code": "(+) Kosovo",
        "price": 0.074
    },
    "KW": {
        "name": "Kuwait",
        "code": "KW",
        "phone_code": 965,
        "name_with_phone_code": "(+965) Kuwait",
        "price": 0.042
    },
    "KG": {
        "name": "Kyrgyzstan",
        "code": "KG",
        "phone_code": 996,
        "name_with_phone_code": "(+996) Kyrgyzstan",
        "price": 0.018
    },
    "LA": {
        "name": "Laos",
        "code": "LA",
        "phone_code": 856,
        "name_with_phone_code": "(+856) Laos",
        "price": 0.05
    },
    "LV": {
        "name": "Latvia",
        "code": "LV",
        "phone_code": 371,
        "name_with_phone_code": "(+371) Latvia",
        "price": 0.053
    },
    "LB": {
        "name": "Lebanon",
        "code": "LB",
        "phone_code": 961,
        "name_with_phone_code": "(+961) Lebanon",
        "price": 0.049
    },
    "LS": {
        "name": "Lesotho",
        "code": "LS",
        "phone_code": 266,
        "name_with_phone_code": "(+266) Lesotho",
        "price": 0.105
    },
    "LR": {
        "name": "Liberia",
        "code": "LR",
        "phone_code": 231,
        "name_with_phone_code": "(+231) Liberia",
        "price": 0.022
    },
    "LY": {
        "name": "Libya",
        "code": "LY",
        "phone_code": 218,
        "name_with_phone_code": "(+218) Libya",
        "price": 0.013
    },
    "LI": {
        "name": "Liechtenstein",
        "code": "LI",
        "phone_code": 423,
        "name_with_phone_code": "(+423) Liechtenstein",
        "price": 0.02
    },
    "LT": {
        "name": "Lithuania",
        "code": "LT",
        "phone_code": 370,
        "name_with_phone_code": "(+370) Lithuania",
        "price": 0.027
    },
    "LU": {
        "name": "Luxembourg",
        "code": "LU",
        "phone_code": 352,
        "name_with_phone_code": "(+352) Luxembourg",
        "price": 0.014
    },
    "MO": {
        "name": "Macau SAR China",
        "code": "MO",
        "phone_code": 853,
        "name_with_phone_code": "(+853) Macau SAR China",
        "price": 0.018
    },
    "MK": {
        "name": "Macedonia",
        "code": "MK",
        "phone_code": 389,
        "name_with_phone_code": "(+389) Macedonia",
        "price": 0.048
    },
    "MG": {
        "name": "Madagascar",
        "code": "MG",
        "phone_code": 261,
        "name_with_phone_code": "(+261) Madagascar",
        "price": 0.014
    },
    "MW": {
        "name": "Malawi",
        "code": "MW",
        "phone_code": 265,
        "name_with_phone_code": "(+265) Malawi",
        "price": 0.035
    },
    "MY": {
        "name": "Malaysia",
        "code": "MY",
        "phone_code": 60,
        "name_with_phone_code": "(+60) Malaysia",
        "price": 0.039
    },
    "MV": {
        "name": "Maldives",
        "code": "MV",
        "phone_code": 960,
        "name_with_phone_code": "(+960) Maldives",
        "price": 0.018
    },
    "ML": {
        "name": "Mali",
        "code": "ML",
        "phone_code": 223,
        "name_with_phone_code": "(+223) Mali",
        "price": 0.099
    },
    "MT": {
        "name": "Malta",
        "code": "MT",
        "phone_code": 356,
        "name_with_phone_code": "(+356) Malta",
        "price": 0.034
    },
    "MH": {
        "name": "Marshall Islands",
        "code": "MH",
        "phone_code": 692,
        "name_with_phone_code": "(+692) Marshall Islands",
        "price": 0
    },
    "MQ": {
        "name": "Martinique",
        "code": "MQ",
        "phone_code": 596,
        "name_with_phone_code": "(+596) Martinique",
        "price": 0.101
    },
    "MR": {
        "name": "Mauritania",
        "code": "MR",
        "phone_code": 222,
        "name_with_phone_code": "(+222) Mauritania",
        "price": 0.042
    },
    "MU": {
        "name": "Mauritius",
        "code": "MU",
        "phone_code": 230,
        "name_with_phone_code": "(+230) Mauritius",
        "price": 0.105
    },
    "YT": {
        "name": "Mayotte",
        "code": "YT",
        "phone_code": 269,
        "name_with_phone_code": "(+269) Mayotte",
        "price": 0
    },
    "MX": {
        "name": "Mexico",
        "code": "MX",
        "phone_code": 52,
        "name_with_phone_code": "(+52) Mexico",
        "price": 0.042
    },
    "FM": {
        "name": "Micronesia",
        "code": "FM",
        "phone_code": 691,
        "name_with_phone_code": "(+691) Micronesia",
        "price": 0
    },
    "MD": {
        "name": "Moldova",
        "code": "MD",
        "phone_code": 373,
        "name_with_phone_code": "(+373) Moldova",
        "price": 0.081
    },
    "MC": {
        "name": "Monaco",
        "code": "MC",
        "phone_code": 377,
        "name_with_phone_code": "(+377) Monaco",
        "price": 0.056
    },
    "MN": {
        "name": "Mongolia",
        "code": "MN",
        "phone_code": 976,
        "name_with_phone_code": "(+976) Mongolia",
        "price": 0.056
    },
    "ME": {
        "name": "Montenegro",
        "code": "ME",
        "phone_code": "",
        "name_with_phone_code": "(+) Montenegro",
        "price": 0.017
    },
    "MS": {
        "name": "Montserrat",
        "code": "MS",
        "phone_code": 1664,
        "name_with_phone_code": "(+1664) Montserrat",
        "price": 0.07
    },
    "MA": {
        "name": "Morocco",
        "code": "MA",
        "phone_code": 212,
        "name_with_phone_code": "(+212) Morocco",
        "price": 0.049
    },
    "MZ": {
        "name": "Mozambique",
        "code": "MZ",
        "phone_code": 258,
        "name_with_phone_code": "(+258) Mozambique",
        "price": 0.035
    },
    "MM": {
        "name": "Myanmar (Burma)",
        "code": "MM",
        "phone_code": 95,
        "name_with_phone_code": "(+95) Myanmar (Burma)",
        "price": 0.112
    },
    "NA": {
        "name": "Namibia",
        "code": "NA",
        "phone_code": 264,
        "name_with_phone_code": "(+264) Namibia",
        "price": 0.039
    },
    "NR": {
        "name": "Nauru",
        "code": "NR",
        "phone_code": 674,
        "name_with_phone_code": "(+674) Nauru",
        "price": 0
    },
    "NP": {
        "name": "Nepal",
        "code": "NP",
        "phone_code": 977,
        "name_with_phone_code": "(+977) Nepal",
        "price": 0.074
    },
    "NL": {
        "name": "Netherlands",
        "code": "NL",
        "phone_code": 31,
        "name_with_phone_code": "(+31) Netherlands",
        "price": 0.098
    },
    "NC": {
        "name": "New Caledonia",
        "code": "NC",
        "phone_code": 687,
        "name_with_phone_code": "(+687) New Caledonia",
        "price": 0.133
    },
    "NZ": {
        "name": "New Zealand",
        "code": "NZ",
        "phone_code": 64,
        "name_with_phone_code": "(+64) New Zealand",
        "price": 0.104
    },
    "NI": {
        "name": "Nicaragua",
        "code": "NI",
        "phone_code": 505,
        "name_with_phone_code": "(+505) Nicaragua",
        "price": 0.035
    },
    "NE": {
        "name": "Niger",
        "code": "NE",
        "phone_code": 227,
        "name_with_phone_code": "(+227) Niger",
        "price": 0.018
    },
    "NG": {
        "name": "Nigeria",
        "code": "NG",
        "phone_code": 234,
        "name_with_phone_code": "(+234) Nigeria",
        "price": 0.018
    },
    "NU": {
        "name": "Niue",
        "code": "NU",
        "phone_code": 683,
        "name_with_phone_code": "(+683) Niue",
        "price": 0
    },
    "NF": {
        "name": "Norfolk Island",
        "code": "NF",
        "phone_code": 672,
        "name_with_phone_code": "(+672) Norfolk Island",
        "price": 0.077
    },
    "KP": {
        "name": "North Korea",
        "code": "KP",
        "phone_code": 850,
        "name_with_phone_code": "(+850) North Korea",
        "price": 0
    },
    "MP": {
        "name": "Northern Mariana Islands",
        "code": "MP",
        "phone_code": 1670,
        "name_with_phone_code": "(+1670) Northern Mariana Islands",
        "price": 0.005
    },
    "NO": {
        "name": "Norway",
        "code": "NO",
        "phone_code": 47,
        "name_with_phone_code": "(+47) Norway",
        "price": 0.056
    },
    "OM": {
        "name": "Oman",
        "code": "OM",
        "phone_code": 968,
        "name_with_phone_code": "(+968) Oman",
        "price": 0.07
    },
    "PK": {
        "name": "Pakistan",
        "code": "PK",
        "phone_code": 92,
        "name_with_phone_code": "(+92) Pakistan",
        "price": 0.042
    },
    "PW": {
        "name": "Palau",
        "code": "PW",
        "phone_code": 680,
        "name_with_phone_code": "(+680) Palau",
        "price": 0
    },
    "PS": {
        "name": "Palestinian Territories",
        "code": "PS",
        "phone_code": 970,
        "name_with_phone_code": "(+970) Palestinian Territories",
        "price": 0.077
    },
    "PA": {
        "name": "Panama",
        "code": "PA",
        "phone_code": 507,
        "name_with_phone_code": "(+507) Panama",
        "price": 0.048
    },
    "PG": {
        "name": "Papua New Guinea",
        "code": "PG",
        "phone_code": 675,
        "name_with_phone_code": "(+675) Papua New Guinea",
        "price": 0.042
    },
    "PY": {
        "name": "Paraguay",
        "code": "PY",
        "phone_code": 595,
        "name_with_phone_code": "(+595) Paraguay",
        "price": 0.018
    },
    "PE": {
        "name": "Peru",
        "code": "PE",
        "phone_code": 51,
        "name_with_phone_code": "(+51) Peru",
        "price": 0.021
    },
    "PH": {
        "name": "Philippines",
        "code": "PH",
        "phone_code": 63,
        "name_with_phone_code": "(+63) Philippines",
        "price": 0.018
    },
    "PN": {
        "name": "Pitcairn Islands",
        "code": "PN",
        "phone_code": 9999,
        "name_with_phone_code": "(+9999) Pitcairn Islands",
        "price": 0
    },
    "PL": {
        "name": "Poland",
        "code": "PL",
        "phone_code": 48,
        "name_with_phone_code": "(+48) Poland",
        "price": 0.022
    },
    "PT": {
        "name": "Portugal",
        "code": "PT",
        "phone_code": 351,
        "name_with_phone_code": "(+351) Portugal",
        "price": 0.032
    },
    "PR": {
        "name": "Puerto Rico",
        "code": "PR",
        "phone_code": 1787,
        "name_with_phone_code": "(+1787) Puerto Rico",
        "price": 0.035
    },
    "QA": {
        "name": "Qatar",
        "code": "QA",
        "phone_code": 974,
        "name_with_phone_code": "(+974) Qatar",
        "price": 0.063
    },
    "RE": {
        "name": "Réunion",
        "code": "RE",
        "phone_code": 262,
        "name_with_phone_code": "(+262) Réunion",
        "price": 0.098
    },
    "RO": {
        "name": "Romania",
        "code": "RO",
        "phone_code": 40,
        "name_with_phone_code": "(+40) Romania",
        "price": 0.078
    },
    "RU": {
        "name": "Russia",
        "code": "RU",
        "phone_code": 70,
        "name_with_phone_code": "(+70) Russia",
        "price": 0.091
    },
    "RW": {
        "name": "Rwanda",
        "code": "RW",
        "phone_code": 250,
        "name_with_phone_code": "(+250) Rwanda",
        "price": 0.022
    },
    "WS": {
        "name": "Samoa",
        "code": "WS",
        "phone_code": 684,
        "name_with_phone_code": "(+684) Samoa",
        "price": 0.017
    },
    "SM": {
        "name": "San Marino",
        "code": "SM",
        "phone_code": 378,
        "name_with_phone_code": "(+378) San Marino",
        "price": 0
    },
    "ST": {
        "name": "São Tomé & Príncipe",
        "code": "ST",
        "phone_code": 239,
        "name_with_phone_code": "(+239) São Tomé & Príncipe",
        "price": 0.126
    },
    "SA": {
        "name": "Saudi Arabia",
        "code": "SA",
        "phone_code": 966,
        "name_with_phone_code": "(+966) Saudi Arabia",
        "price": 0.032
    },
    "SN": {
        "name": "Senegal",
        "code": "SN",
        "phone_code": 221,
        "name_with_phone_code": "(+221) Senegal",
        "price": 0.101
    },
    "RS": {
        "name": "Serbia",
        "code": "RS",
        "phone_code": "",
        "name_with_phone_code": "(+) Serbia",
        "price": 0.021
    },
    "SC": {
        "name": "Seychelles",
        "code": "SC",
        "phone_code": 248,
        "name_with_phone_code": "(+248) Seychelles",
        "price": 0.018
    },
    "SL": {
        "name": "Sierra Leone",
        "code": "SL",
        "phone_code": 232,
        "name_with_phone_code": "(+232) Sierra Leone",
        "price": 0.024
    },
    "SG": {
        "name": "Singapore",
        "code": "SG",
        "phone_code": 65,
        "name_with_phone_code": "(+65) Singapore",
        "price": 0.039
    },
    "SX": {
        "name": "Sint Maarten",
        "code": "SX",
        "phone_code": "",
        "name_with_phone_code": "(+) Sint Maarten",
        "price": 0
    },
    "SK": {
        "name": "Slovakia",
        "code": "SK",
        "phone_code": 421,
        "name_with_phone_code": "(+421) Slovakia",
        "price": 0.056
    },
    "SI": {
        "name": "Slovenia",
        "code": "SI",
        "phone_code": 386,
        "name_with_phone_code": "(+386) Slovenia",
        "price": 0.049
    },
    "SB": {
        "name": "Solomon Islands",
        "code": "SB",
        "phone_code": 677,
        "name_with_phone_code": "(+677) Solomon Islands",
        "price": 0.021
    },
    "SO": {
        "name": "Somalia",
        "code": "SO",
        "phone_code": 252,
        "name_with_phone_code": "(+252) Somalia",
        "price": 0.074
    },
    "ZA": {
        "name": "South Africa",
        "code": "ZA",
        "phone_code": 27,
        "name_with_phone_code": "(+27) South Africa",
        "price": 0.021
    },
    "GS": {
        "name": "South Georgia & South Sandwich Islands",
        "code": "GS",
        "phone_code": 9999,
        "name_with_phone_code": "(+9999) South Georgia & South Sandwich Islands",
        "price": 0
    },
    "KR": {
        "name": "South Korea",
        "code": "KR",
        "phone_code": 82,
        "name_with_phone_code": "(+82) South Korea",
        "price": 0.049
    },
    "SS": {
        "name": "South Sudan",
        "code": "SS",
        "phone_code": "",
        "name_with_phone_code": "(+) South Sudan",
        "price": 0.018
    },
    "ES": {
        "name": "Spain",
        "code": "ES",
        "phone_code": 34,
        "name_with_phone_code": "(+34) Spain",
        "price": 0.06
    },
    "LK": {
        "name": "Sri Lanka",
        "code": "LK",
        "phone_code": 94,
        "name_with_phone_code": "(+94) Sri Lanka",
        "price": 0.032
    },
    "BL": {
        "name": "St. Barthélemy",
        "code": "BL",
        "phone_code": "",
        "name_with_phone_code": "(+) St. Barthélemy",
        "price": 0
    },
    "SH": {
        "name": "St. Helena",
        "code": "SH",
        "phone_code": 290,
        "name_with_phone_code": "(+290) St. Helena",
        "price": 0
    },
    "KN": {
        "name": "St. Kitts & Nevis",
        "code": "KN",
        "phone_code": 1869,
        "name_with_phone_code": "(+1869) St. Kitts & Nevis",
        "price": 0.022
    },
    "LC": {
        "name": "St. Lucia",
        "code": "LC",
        "phone_code": 1758,
        "name_with_phone_code": "(+1758) St. Lucia",
        "price": 0.021
    },
    "MF": {
        "name": "St. Martin",
        "code": "MF",
        "phone_code": "",
        "name_with_phone_code": "(+) St. Martin",
        "price": 0
    },
    "PM": {
        "name": "St. Pierre & Miquelon",
        "code": "PM",
        "phone_code": 508,
        "name_with_phone_code": "(+508) St. Pierre & Miquelon",
        "price": 0
    },
    "VC": {
        "name": "St. Vincent & Grenadines",
        "code": "VC",
        "phone_code": 1784,
        "name_with_phone_code": "(+1784) St. Vincent & Grenadines",
        "price": 0.018
    },
    "SD": {
        "name": "Sudan",
        "code": "SD",
        "phone_code": 249,
        "name_with_phone_code": "(+249) Sudan",
        "price": 0.049
    },
    "SR": {
        "name": "Suriname",
        "code": "SR",
        "phone_code": 597,
        "name_with_phone_code": "(+597) Suriname",
        "price": 0.053
    },
    "SJ": {
        "name": "Svalbard & Jan Mayen",
        "code": "SJ",
        "phone_code": 47,
        "name_with_phone_code": "(+47) Svalbard & Jan Mayen",
        "price": 0
    },
    "SZ": {
        "name": "Swaziland",
        "code": "SZ",
        "phone_code": 268,
        "name_with_phone_code": "(+268) Swaziland",
        "price": 0.099
    },
    "SE": {
        "name": "Sweden",
        "code": "SE",
        "phone_code": 46,
        "name_with_phone_code": "(+46) Sweden",
        "price": 0.07
    },
    "CH": {
        "name": "Switzerland",
        "code": "CH",
        "phone_code": 41,
        "name_with_phone_code": "(+41) Switzerland",
        "price": 0.042
    },
    "SY": {
        "name": "Syria",
        "code": "SY",
        "phone_code": 963,
        "name_with_phone_code": "(+963) Syria",
        "price": 0.067
    },
    "TW": {
        "name": "Taiwan",
        "code": "TW",
        "phone_code": 886,
        "name_with_phone_code": "(+886) Taiwan",
        "price": 0.048
    },
    "TJ": {
        "name": "Tajikistan",
        "code": "TJ",
        "phone_code": 992,
        "name_with_phone_code": "(+992) Tajikistan",
        "price": 0.018
    },
    "TZ": {
        "name": "Tanzania",
        "code": "TZ",
        "phone_code": 255,
        "name_with_phone_code": "(+255) Tanzania",
        "price": 0.022
    },
    "TH": {
        "name": "Thailand",
        "code": "TH",
        "phone_code": 66,
        "name_with_phone_code": "(+66) Thailand",
        "price": 0.022
    },
    "TL": {
        "name": "Timor-Leste",
        "code": "TL",
        "phone_code": 670,
        "name_with_phone_code": "(+670) Timor-Leste",
        "price": 0.12
    },
    "TG": {
        "name": "Togo",
        "code": "TG",
        "phone_code": 228,
        "name_with_phone_code": "(+228) Togo",
        "price": 0.022
    },
    "TK": {
        "name": "Tokelau",
        "code": "TK",
        "phone_code": 690,
        "name_with_phone_code": "(+690) Tokelau",
        "price": 0
    },
    "TO": {
        "name": "Tonga",
        "code": "TO",
        "phone_code": 676,
        "name_with_phone_code": "(+676) Tonga",
        "price": 0.045
    },
    "TT": {
        "name": "Trinidad & Tobago",
        "code": "TT",
        "phone_code": 1868,
        "name_with_phone_code": "(+1868) Trinidad & Tobago",
        "price": 0.061
    },
    "TA": {
        "name": "Tristan da Cunha",
        "code": "TA",
        "phone_code": "",
        "name_with_phone_code": "(+) Tristan da Cunha",
        "price": 0
    },
    "TN": {
        "name": "Tunisia",
        "code": "TN",
        "phone_code": 216,
        "name_with_phone_code": "(+216) Tunisia",
        "price": 0.08
    },
    "TR": {
        "name": "Turkey",
        "code": "TR",
        "phone_code": 90,
        "name_with_phone_code": "(+90) Turkey",
        "price": 0.018
    },
    "TM": {
        "name": "Turkmenistan",
        "code": "TM",
        "phone_code": 7370,
        "name_with_phone_code": "(+7370) Turkmenistan",
        "price": 0.098
    },
    "TC": {
        "name": "Turks & Caicos Islands",
        "code": "TC",
        "phone_code": 1649,
        "name_with_phone_code": "(+1649) Turks & Caicos Islands",
        "price": 0.014
    },
    "TV": {
        "name": "Tuvalu",
        "code": "TV",
        "phone_code": 688,
        "name_with_phone_code": "(+688) Tuvalu",
        "price": 0
    },
    "UM": {
        "name": "U.S. Outlying Islands",
        "code": "UM",
        "phone_code": 1,
        "name_with_phone_code": "(+1) U.S. Outlying Islands",
        "price": 0
    },
    "VI": {
        "name": "U.S. Virgin Islands",
        "code": "VI",
        "phone_code": 1340,
        "name_with_phone_code": "(+1340) U.S. Virgin Islands",
        "price": 0
    },
    "UG": {
        "name": "Uganda",
        "code": "UG",
        "phone_code": 256,
        "name_with_phone_code": "(+256) Uganda",
        "price": 0.035
    },
    "UA": {
        "name": "Ukraine",
        "code": "UA",
        "phone_code": 380,
        "name_with_phone_code": "(+380) Ukraine",
        "price": 0.063
    },
    "AE": {
        "name": "United Arab Emirates",
        "code": "AE",
        "phone_code": 971,
        "name_with_phone_code": "(+971) United Arab Emirates",
        "price": 0.029
    },
    "GB": {
        "name": "United Kingdom",
        "code": "GB",
        "phone_code": 44,
        "name_with_phone_code": "(+44) United Kingdom",
        "price": 0.063
    },
    "US": {
        "name": "United States",
        "code": "US",
        "phone_code": 1,
        "name_with_phone_code": "(+1) United States",
        "price": 0.013
    },
    "UY": {
        "name": "Uruguay",
        "code": "UY",
        "phone_code": 598,
        "name_with_phone_code": "(+598) Uruguay",
        "price": 0.049
    },
    "UZ": {
        "name": "Uzbekistan",
        "code": "UZ",
        "phone_code": 998,
        "name_with_phone_code": "(+998) Uzbekistan",
        "price": 0.095
    },
    "VU": {
        "name": "Vanuatu",
        "code": "VU",
        "phone_code": 678,
        "name_with_phone_code": "(+678) Vanuatu",
        "price": 0.039
    },
    "VA": {
        "name": "Vatican City",
        "code": "VA",
        "phone_code": 39,
        "name_with_phone_code": "(+39) Vatican City",
        "price": 0
    },
    "VE": {
        "name": "Venezuela",
        "code": "VE",
        "phone_code": 58,
        "name_with_phone_code": "(+58) Venezuela",
        "price": 0.035
    },
    "VN": {
        "name": "Vietnam",
        "code": "VN",
        "phone_code": 84,
        "name_with_phone_code": "(+84) Vietnam",
        "price": 0.056
    },
    "WF": {
        "name": "Wallis & Futuna",
        "code": "WF",
        "phone_code": 681,
        "name_with_phone_code": "(+681) Wallis & Futuna",
        "price": 0
    },
    "EH": {
        "name": "Western Sahara",
        "code": "EH",
        "phone_code": 212,
        "name_with_phone_code": "(+212) Western Sahara",
        "price": 0
    },
    "YE": {
        "name": "Yemen",
        "code": "YE",
        "phone_code": 967,
        "name_with_phone_code": "(+967) Yemen",
        "price": 0.018
    },
    "ZM": {
        "name": "Zambia",
        "code": "ZM",
        "phone_code": 260,
        "name_with_phone_code": "(+260) Zambia",
        "price": 0.035
    },
    "ZW": {
        "name": "Zimbabwe",
        "code": "ZW",
        "phone_code": 263,
        "name_with_phone_code": "(+263) Zimbabwe",
        "price": 0.074
    }
}

HTTP Request

GET api/user/countries

HEAD api/user/countries

Balance

Get your current balance

Example request:

curl -X GET "https://api.smsway.mobi/api/balance" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/balance");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/balance",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "credits": 49.922
}

HTTP Request

GET api/balance

HEAD api/balance

Get hooks

List all hooks

Example request:

curl -X GET "https://api.smsway.mobi/api/hooks" \
-H "Accept: application/json"
$access_token = '{{ YOURTOKEN }}';

$headers = array(
    'Content-Type: application/json',
    sprintf('Authorization: Bearer %s', $access_token)
);

$curl = curl_init("https://api.smsway.mobi/api/hooks");

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$json = json_decode(curl_exec($curl));
print_r($json);
var token = '{{ YOURTOKEN }}';
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://api.smsway.mobi/api/hooks",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    },
    "beforeSend": function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + token); } 
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "hooks": [
        {
            "action": "smsqueue_created",
            "description": "SMS added to queue",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "smsqueue_sended",
            "description": "SMS sended",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "smsqueue_received",
            "description": "SMS received",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "smsqueue_updated",
            "description": "SMS updated in queue",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "smsqueue_deleted",
            "description": "SMS deleted from queue",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "sms_created",
            "description": "Campaign created",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "sms_updated",
            "description": "Campaign updated",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "sms_deleted",
            "description": "Campaign deleted",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "contacts_created",
            "description": "New contact created",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "contacts_updated",
            "description": "Contact updated",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "contacts_deleted",
            "description": "Contact deleted",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "contacts_added",
            "description": "Contact added to list",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "contacts_removed",
            "description": "Contact removed from list",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "lists_updated",
            "description": "List of contacts updated",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "lists_deleted",
            "description": "List of contacts deleted",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "invoices_created",
            "description": "New invoice created",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "invoices_updated",
            "description": "Invoice updated",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "invoices_deleted",
            "description": "Invoice deleted",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "senders_created",
            "description": "Sender (originator) created",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "senders_updated",
            "description": "Sender (originator) updated",
            "method": "POST",
            "parameters": "",
            "url": ""
        },
        {
            "action": "senders_deleted",
            "description": "Sender (originator) deleted",
            "method": "POST",
            "parameters": "",
            "url": ""
        }
    ]
}

HTTP Request

GET api/hooks

HEAD api/hooks