QUERY NUMBERS

Lists numbers owned by your account

This operation allows searching for numbers that you have already purchased and that are in your account. You can query by region using parameters such as prefix, city, state, zip code, rate center, among others. It returns the numbers in your account with information about status, lease information, configuration, and more. See the Response Parameters table below for the full list of values returned.

REQUEST PARAMETERS

Parameter Data Type Demo Value Description
QueryNumbers object Numbers request by query
MaxResults long 1000 Max number of results to return limited to 1000 (default: 1000)
FirstResult long 0 Start of next result set (default: 0)
Region object Region of number represented by city, state, prefix, etc...
Prefix string 1920659 4-7 digit prefix
City string Seattle Name of a city
State string WA State abbreviation
Zipcode string 98154 5 digit zipcode
Country string US 2 digit country code
Lata string 674 Lata
RateCenter string string SEATTLE
Latitude float 47.61 Latitude
Longitude float -122.331 Longitude
TimeZone string America/Los_Angeles
LabelName string MyLabel Label that number must have to be included

RESPONSE PARAMETERS

Parameter Data Type Description
NumberQueryResult List of Numbers returned from query
TotalResults long Results count
Number Info about Number like Region
Number PhoneNumber 11 digit E.164 number
NationalFormat string Phone number formatted for local
TollFree boolean Is toll free number
Region Region of number represented by city, state, prefix, etc...
Prefix string 4-7 digit prefix
City string Name of a city
State string State abbreviation
Zipcode string 5 digit zipcode
Country string 2 digit country code
Lata string Lata
RateCenter string
Latitude float Latitude
Longitude float Longitude
TimeZone string
Status NumberStatus [PENDING, ACTIVE, RELEASED, UNAVAILABLE]
LeaseInfo Info about Lease
LeaseBegin date Date lease began
LeaseEnd date Date lease ends
AutoRenew boolean Is lease set to renew each month
NumberConfiguration Configure Call and Text features
CallFeature NumberFeature [UNSUPPORTED, PENDING, DISABLED, ENABLED]
TextFeature NumberFeature [UNSUPPORTED, PENDING, DISABLED, ENABLED]
InboundCallConfigurationType InboundType [TRACKING, IVR]
InboundCallConfiguration object
CallTrackingConfig* object
Id long Unique ID of InboundConfig
TransferNumber List[PhoneNumber]
Screen boolean
Record boolean
IntroSoundId long
WhisperSoundId long
IvrInboundConfig
Id long Unique ID of InboundConfig
DialplanXml string

EXAMPLE

using RestSharp;

namespace [your-namespace]
{
    public class [your-class]
    {
        public string QueryNumbers()
        {
            var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
            client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");

            var request = new RestRequest("number", Method.GET);
            request.AddParameter("MaxResults", "1");
            request.AddParameter("Prefix", "121320");

            var response = client.Execute(request);
            string content = response.Content;
            return content;
        }
    }
}

The XML returned is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<r:Resource xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">

    <Number>

       <Number>12132042444</Number>

       <NationalFormat>12132042444</NationalFormat>

       <TollFree>false</TollFree>

       <Status>ACTIVE</Status>

       <LeaseInfo>

          <LeaseBegin>2014-12-02Z</LeaseBegin>

          <LeaseEnd>2015-01-02Z</LeaseEnd>

          <AutoRenew>true</AutoRenew>

       </LeaseInfo>

       <NumberConfiguration>

          <CallFeature>ENABLED</CallFeature>

          <TextFeature>ENABLED</TextFeature>

          <InboundCallConfigurationType>TRACKING</InboundCallConfigurationType>

          <InboundCallConfiguration>

             <CallTrackingConfig id="3630161003">

             <TransferNumber>12132042446</TransferNumber>

             <Screen>false</Screen>

             <Record>true</Record>

             </CallTrackingConfig>

          </InboundCallConfiguration>

       </NumberConfiguration>

    </Number>

</r:Resource>