To get the details of a specific ExoPhone in your account including connectivity information, make an HTTP GET request to:
https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/incoming-phone-numbers/<exophone_sid>
<your_api_key>
and <your_api_token>
with the API key and token created by you.<your_sid>
with your “Account sid”<subdomain>
with the region of your account
<your_api_key>
, <your_api_token>
and <your_sid>
are available in the API settings page of your Exotel Dashboard
This API only supports a JSON reponse.
curl -X GET https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/incoming-phone-numbers/<exophone_sid>
var request = require('request'); var options = { url: 'https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/incoming-phone-numbers/<exophone_sid>' }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback);
<?php include('vendor/rmccue/requests/library/Requests.php'); Requests::register_autoloader(); $headers = array(); $response = Requests::get('https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/incoming-phone-numbers/<exophone_sid>', $headers);
import requests requests.get('https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/incoming-phone-numbers/<exophone_sid>')
require 'net/http' require 'uri' uri = URI.parse("https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/incoming-phone-numbers/<exophone_sid>") response = Net::HTTP.get_response(uri) # response.code # response.body
HTTP Response:
{ "request_id": "0f403dff8d854ca08c570a94717aa7d9", "method": "GET", "http_code": 200, "metadata": { "page_size": 1, "page": 0 }, "response": [ { "code": 200, "error_data": null, "status": "success", "data": { "sid": "01139585476", "date_created": "2018-08-22T12:22:49Z", "date_updated": "2018-08-24T11:25:49Z", "friendly_name": "01139585476", "account_sid": "Exotel", "phone_number": "+911139585476", "capabilities": { "voice": true }, "country": "IN", "region": "DL", "one_time_price": "0.000000", "rental_price": "499.000000", "incoming_rate": "0.000000", "incoming_pulse": "60", "currency": "INR", "number_type": "Landline", "vanity_number": false, "voice_url": "https://my.exotel.com/Exotel/exoml/start_voice/XXX", "sms_url": "https://my.exotel.com/Exotel/exoml/start_sms/XXX", "uri": "/v2/accounts/Exotel/incoming-phone-numbers/01139585476", "connectivity": { "incoming_call": { "status": "active", "last_check_time": "2018-08-24T11:25:49Z", "alternate_exophone": null }, "outgoing_call": { "status": "active", "last_check_time": "2018-08-24T11:25:49Z", "alternate_exophone": null } } } } ] }
Description of Parameters:
Parameter Name |
Description |
request_id |
Random string to uniquely identify the request |
method |
HTTP request method (GET, POST, PUT, DELETE) |
http_code |
HTTP response code for your request like 200, 404, 429, 500 etc. |
metadata |
To provide metadata about the response. In case of GET for pagination (bulk), it'll contain:
|
response |
JSON array representing the response and contains below parameters:
"error_data": { "code": 1000, "description": "Not Found", "message": "Not Found" } In case of no errors, it’ll be null.
|
sid |
String; An alpha-numeric unique identifier of the ExoPhone. This can be different than the ExoPhone itself. |
date_created |
Time in format: RFC 3339; Date and time at which the ExoPhone was added to the account |
date_updated |
Time in format: RFC 3339; Date and time at which the details of the ExoPhone was last updated |
account_sid |
Exotel account SID |
phone_number |
The phone number value of the ExoPhone in E.164 format like +911139585476 |
friendly_name |
A freindly name that can be used to identify the ExoPhone |
capabilities |
These are the capabilities that are supported on this ExoPhone:
|
country |
ISO Country Code to which this ExoPhone belongs to |
region |
The telecom circle this ExoPhone belongs to. Refer here for list of possible telecom circles. |
one_time_price |
One time cost incurred while adding this ExoPhone to your account |
rental_price |
Double; Recurring monthly rental associated with this ExoPhone |
incoming_rate |
Double; The per pulse cost for incoming calls |
incoming_pulse |
Double; The duration of one pulse in seconds |
currency |
Double; The currency in which this ExoPhone is billed |
number_type |
Double; The type of the ExoPhone |
vanity_number |
Boolean; Indicates if this ExoPhone is a vanity number |
voice_url |
string; The Url to the flow to which incoming calls are connected to |
sms_url |
string; The Url to the flow to which incoming SMS are connected to |
uri |
string; The Url to the flow to which incoming calls are connected to |
connectivity |
JSON block representing connectivity information about the ExoPhone. It contains incoming_call, outgoing_call blocks which represent connectivity information for incoming call and outgoing call respectively. |
Description of 'connectivity' parameters:
Parameter Name |
Description |
status |
It represents the connectivity status for that functionality (incoming call or outgoing call). Possible values are
|
last_check_time |
Format: RFC 3339; timestamp representing when this number was checked last for connectivity |
alternate_exophone |
If available, this will provide alternate ExoPhones in JSON array format which can be used if the given ExoPhone is down. If there are no alternate ExoPhones available it will be populated as null |