Get pricing

Pricing for a given country

Endpoint

https://api.gateway360.com/api/3.0/account/pricing/sms/get-country-pricing

Request

api_key Your API Key.
country_code A country in ISO alpha2 format. If the parameter isn't passed, all countries will be returned.
Mandatory
Optional
{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "country_code":"ES",
}
curl -X POST \
 -H 'Content-Type: application/json' \
 -H 'Accept: application/json' \
 -d '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "country_code":"ES",
}' https://api.gateway360.com/api/3.0/account/pricing/sms/get-country-pricing
$request = '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "country_code":"ES",
}';

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

$ch = curl_init('https://api.gateway360.com/api/3.0/account/pricing/sms/get-country-pricing');

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);

$result = curl_exec($ch);

if( !curl_errno($ch) )
    $result = json_decode($result);
else
    $result = curl_error($ch);
    
print_r($result);
/** Imports */
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
/** End imports */


HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost request = new HttpPost("https://api.gateway360.com/api/3.0/account/get-balance");

StringEntity params = new StringEntity(
"{" +
"    \"api_key\":\"399d2b438a53ebed3db8a7d52107f846\"" +
"    \"country_code\":\"ES\"" +
"}");

request.addHeader("content-type", "application/json");
request.addHeader("Accept","application/json");
request.setEntity(params);
HttpResponse response = httpClient.execute(request);
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.gateway360.com/api/3.0/account/pricing/sms/get-country-pricing")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'

request.body = '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "country_code":"ES",
}'

response = http.request(request)
puts response.read_body
conn = http.client.HTTPSConnection("api.gateway360.com")

payload = '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "country_code":"ES",
}'

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/api/3.0/account/get-balance", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var client = new RestClient("https://api.gateway360.com/api/3.0/account/pricing/sms/get-country-pricing");

var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "country_code":"ES",
}', ParameterType.RequestBody);

IRestResponse response = client.Execute(request);
Private Sub Command1_Click()
Dim objHTTP As Object
Dim Json As String
Dim result As String


    Json = fJSON
    Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
    URl = "https://api.gateway360.com/api/3.0/account/pricing/sms/get-country-pricing"
    objHTTP.Open "POST", URl, False
    objHTTP.setRequestHeader "Content-type", "application/json"
    objHTTP.send (Json)
    result = objHTTP.responseText
   Set objHTTP = Nothing
End Sub

Private Function fJSON() As String
    fJSON = "{"
    fJSON = fJSON & """api_key"":""399d2b438a53ebed3db8a7d52107f846"""
    fJSON = fJSON & """country_code"":""ES"""
    fJSON = fJSON & "}"
End Function
var data = JSON.stringify({
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "country_code":"ES",
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.gateway360.com/api/3.0/account/pricing/sms/get-country-pricing");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

Response

status Status of request - either "ok" or "error"
name Name of the country.
prefix Prefix for that country.
networks Available networks for that country.
code Mobile Country Code (first 3 characters) and Mobile Network Code.
network Specific network.
price Price for that network.
error_id In case of status being "error", this param will contain the error id.
error_msg In case of status being "error", this param will contain additional information. Should only be used for debugging.
200 OK
{
    "status":"ok",
    "result":{
        "ES":{
		"name":"Spain",
		"prefix":"34",
		"networks":{
			"0":{
				"code":"21401",
				"network":"MNO - Vodafone Espana",
				"price":"0.0520"
			},
			"1":{
				"code":"21403",
				"network":"MNO - Orange Espana",
				"price":"0.0520"
			},
			"2":{
				"code":"21407",
				"network":"MNO - Movistar (Telefonica Moviles Espana)",
				"price":"0.0520"
			},
			"3":{
				"code":"21404",
				"network":"MNO - Yoigo (Xfera Moviles)",
				"price":"0.0520"
			}
		}
	}
    }
}
401 Unauthorized
{
    "status":"error",
    "error_id":"UNAUTHORIZED",
    "error_msg":"Your API key may be invalid or your IP is blocked."
}
We didn't continue processing your request because your API Key wasn't valid.
400 Bad Request
{
    "status":"error",
    "error_id":"JSON_PARSE_ERROR",
    "error_msg":"Your JSON was formatted incorrectly."
}
We couldn't process your request.

Errors

Error ID Explanation
INVALID_CONTENT_TYPE The content type must be: Content-Type: application/json
JSON_PARSE_ERROR Your JSON was formatted incorrectly or was considered otherwise improper or incomplete. Check it here.
MISSING_PARAMS Your request is incomplete and missing some mandatory parameters.
UNAUTHORIZED Your API key may be invalid, double-check that your API key was input correctly or see if your current IP is blocked in your account API settings.

Pricing for a given prefix

Endpoint

https://api.gateway360.com/api/3.0/account/pricing/sms/get-prefix-pricing

Request

api_key Your API Key.
prefix An international dialing code. For example, 34.
Mandatory
Optional
{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "prefix":"34",
}
curl -X POST \
 -H 'Content-Type: application/json' \
 -H 'Accept: application/json' \
 -d '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "prefix":"34",
}' https://api.gateway360.com/api/3.0/account/pricing/sms/get-prefix-pricing
$request = '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "prefix":"34",
}';

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

$ch = curl_init('https://api.gateway360.com/api/3.0/account/pricing/sms/get-prefix-pricing');

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);

$result = curl_exec($ch);

if( !curl_errno($ch) )
    $result = json_decode($result);
else
    $result = curl_error($ch);
    
print_r($result);
/** Imports */
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
/** End imports */


HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost request = new HttpPost("https://api.gateway360.com/api/3.0/account/get-balance");

StringEntity params = new StringEntity(
"{" +
"    \"api_key\":\"399d2b438a53ebed3db8a7d52107f846\"" +
"    \"prefix\":\"34\"" +
"}");

request.addHeader("content-type", "application/json");
request.addHeader("Accept","application/json");
request.setEntity(params);
HttpResponse response = httpClient.execute(request);
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.gateway360.com/api/3.0/account/pricing/sms/get-prefix-pricing")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'

request.body = '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "prefix":"34",
}'

response = http.request(request)
puts response.read_body
conn = http.client.HTTPSConnection("api.gateway360.com")

payload = '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "prefix":"34",
}'

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/api/3.0/account/get-balance", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var client = new RestClient("https://api.gateway360.com/api/3.0/account/pricing/sms/get-prefix-pricing");

var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", '{
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "prefix":"34",
}', ParameterType.RequestBody);

IRestResponse response = client.Execute(request);
Private Sub Command1_Click()
Dim objHTTP As Object
Dim Json As String
Dim result As String


    Json = fJSON
    Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
    URl = "https://api.gateway360.com/api/3.0/account/pricing/sms/get-prefix-pricing"
    objHTTP.Open "POST", URl, False
    objHTTP.setRequestHeader "Content-type", "application/json"
    objHTTP.send (Json)
    result = objHTTP.responseText
   Set objHTTP = Nothing
End Sub

Private Function fJSON() As String
    fJSON = "{"
    fJSON = fJSON & """api_key"":""399d2b438a53ebed3db8a7d52107f846"""
    fJSON = fJSON & """prefix"":""34"""
    fJSON = fJSON & "}"
End Function
var data = JSON.stringify({
    "api_key":"399d2b438a53ebed3db8a7d52107f846",
    "prefix":"34",
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.gateway360.com/api/3.0/account/pricing/sms/get-prefix-pricing");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

Response

status Status of request - either "ok" or "error"
name Name of the country.
prefix Prefix for that country.
networks Available networks for that country.
code Mobile Country Code (first 3 characters) and Mobile Network Code.
network Specific network.
price Price for that network.
error_id In case of status being "error", this param will contain the error id.
error_msg In case of status being "error", this param will contain additional information. Should only be used for debugging.
200 OK
{
    "status":"ok",
    "result":{
        "ES":{
		"name":"Spain",
		"prefix":"34",
		"networks":{
			"0":{
				"code":"21401",
				"network":"MNO - Vodafone Espana",
				"price":"0.0520"
			},
			"1":{
				"code":"21403",
				"network":"MNO - Orange Espana",
				"price":"0.0520"
			},
			"2":{
				"code":"21407",
				"network":"MNO - Movistar (Telefonica Moviles Espana)",
				"price":"0.0520"
			},
			"3":{
				"code":"21404",
				"network":"MNO - Yoigo (Xfera Moviles)",
				"price":"0.0520"
			}
		}
	}
    }
}
401 Unauthorized
{
    "status":"error",
    "error_id":"UNAUTHORIZED",
    "error_msg":"Your API key may be invalid or your IP is blocked."
}
We didn't continue processing your request because your API Key wasn't valid.
400 Bad Request
{
    "status":"error",
    "error_id":"JSON_PARSE_ERROR",
    "error_msg":"Your JSON was formatted incorrectly."
}
We couldn't process your request.

Errors

Error ID Explanation
INVALID_CONTENT_TYPE The content type must be: Content-Type: application/json
JSON_PARSE_ERROR Your JSON was formatted incorrectly or was considered otherwise improper or incomplete. Check it here.
MISSING_PARAMS Your request is incomplete and missing some mandatory parameters.
UNAUTHORIZED Your API key may be invalid, double-check that your API key was input correctly or see if your current IP is blocked in your account API settings.