CallFire Solutions

Create Number Order

Follow

CREATE NUMBER ORDER

Order new numbers and/or keywords

You can purchase numbers and keywords by creating a number order that includes a list of numbers, a list of keywords, a region, or specifying which numbers are toll-free or regular ones. An OrderId is returned from the request.

Creating a number order is an asynchronous process. The returned orderId can be used in a GetNumberOrder request to see the status of the order. However, there is no guarantee the order will be finished by the time GetNumberOrder is called. Therefore the GetNumberOrder operation must be polled (no more than once per second) until the order is in a terminal state (FINISHED or ERRORED).

The recommended way to determine whether an order is finished is not to poll, but to use a Postback. See SubscriptionService for information on registering a postback using subscriptions.

REQUEST PARAMETERS

ParameterDemo ValueDescriptionData Type
CreateNumberOrder   Create NumberOrder using attached info object
Numbers List E.164 11 digit numbers space seperated List[PhoneNumber]
Keywords List of keywords space seperated List[string]
BulkLocal   Local numbers to aquire object
Count   int
Region   Region of number represented by city, state, prefix, etc... object
Prefix 4-7 digit prefix string
City Name of a city string
State State abbreviation string
Zipcode 5 digit zipcode string
Country 2 digit country code string
Lata Lata string
RateCenter   string
Latitude Latitude float
Longitude Longitude float
TimeZone   string
BulkTollFree   Toll free numbers to aquire object
Count Amount of phone numbers to aquire int

RESPONSE PARAMETERS

ParameterDescriptionData Type
CreatedId Unique ID of resource long

EXAMPLE


using RestSharp;

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

            var request = new RestRequest("number/order", Method.POST);
            request.AddParameter("Numbers", "18559875391");
            request.AddParameter("City", "Seattle");
            request.AddParameter("State", "WA");
            request.AddParameter("Country", "US");

            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:ResourceReference xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">

    <r:Id>1428507003</r:Id>

<r:Location>https://www.callfire.com/api/1.1/rest/number/order/1428507003</r:Location>

</r:ResourceReference>

Have more questions? Submit a request

Comments