ajax-loader
rocket

API

Contact

Destination

Sender

SMS Model

SMS

SMS responses

User

Destination available

This service allows you to retrieve the list of destinations available for sending SMS.

POST   https://api.avosms.com/v1/list/country


Parameters

All the parameters below are to be sent in POST.

List of mandatory parameters
id Your AvoSMS account ID (email address)
key API key available from your "API Access" customer account

Example


<?php
$curl = curl_init("https://api.avosms.com/v1/list/country"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_COOKIESESSION, true);
$postfields = array( 'id' => "{ID}", //REQUIRED 'key' => "{KEY}", //REQUIRED );
$postfields_json = json_encode($postfields); $trame = http_build_query($postfields, '', '&'); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $trame); $raw_response = curl_exec($curl); curl_close($curl);
$response = json_decode($raw_response);
$status_response = $response->status; $code = $response->code;
if($code == "OK") { $listCountries = $response->list_country;
foreach($listCountries as $country) { $countryName = $country->country_name; $countryCode = $country->country_code; $countryCallingCode = $country->country_calling_code; $unitPrice = $country->unit_price; } }
?>


Codes / Answers

When you make a request to our services, a response is returned to you in JSON format. You will find in the "code" field the return code following your request. In case of success, the return code contains " OK ".


If successful:
code (OK) Your request has been processed correctly.
list_country Table containing the list of available destinations.

Variables of the table of available destinations (list_country)
country_name Name of the destination
country_code ISO2 code of the destination
country_calling_code Telephone number of the destination
unit_price Unit price for sending an SMS to the destination


In case of an error in the formatting / your input :
ERR_100 Unrecognized APIs.
ERR_101 No destination currently available


In the event of an error in processing by our services :
ERR_9XX Processing error, contact our services.
An internal processing error is reported to you by an error code "ERR_9XX", i.e. XX = non-fixed digits, depending on the type of error.


Have a question? Do you need help?