CallFire has a new API!
We are proud to announce the launch of our API 2.0! Learn more about our streamlined, transactional and broadcast APIs. This version of the API documentation will remain available for reference only. There will be no new development, only bug fixes. We highly recommend upgrading to our newer and more sophisticated documentation.
Purchase numbers and keywords by creating a number order that includes a list of numbers, list of keywords, region info, or specifying toll-free. OrderId is returned from 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 a second) untill the order is in a
terminal state (FINISHED or ERRORED).
The recommended way to determine if 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
Parameter | Demo Value | Description | Data 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 | |
Latitude | Latitude | float | |
Longitude | Longitude | float | |
TimeZone | string | ||
BulkTollFree | Toll free numbers to aquire | object | |
Count | Amount of phone numbers to aquire | int |
* indicates choice value, bolded parameters are required
Response Parameters
Parameter | Description | Data Type |
---|---|---|
CreatedId | Unique ID of resource | long |
<?php
/**
* You'll need your login/password pair when you create the SOAP client.
* Don't use the fake login/password provided here; it's just for show and won't work.
*/
$wsdl = "http://callfire.com/api/1.1/wsdl/callfire-service-http-soap12.wsdl";
$client = new SoapClient($wsdl, array(
'soap_version' => SOAP_1_2,
'login' => 'YourLoginId',
'password' => 'YourPassword'));
/**
* CreateNumberOrder: Number order can be created by region or toll free.
*/
//
// Purchase known numbers and keywords found with SearchAvailableNumbers
// and SearchAvailableKeywords.
//
$request = new stdclass();
$request->Numbers = array('13108039783', '13108039779'); // List[PhoneNumber]
$request->Keywords = array('CHOCOLATE', 'VANALLA'); // List[string]
//
// Execute order and obtain the orderId that can be
// used in #GetNumberOrder to get info on numbers returned.
//
$orderId = $client->CreateNumberOrder($request);
print "orderId: $orderId\n";
// Sample $orderId: 129
//
// Or bulk purchase numbers by region.
// Select a region to find numbers in and then create order.
//
$request = new stdclass();
$request->BulkLocal->Count = 1; // required
$request->BulkLocal->Region = new stdclass(); // required
$request->BulkLocal->Region->City = 'Seattle';
$orderId = $client->CreateNumberOrder($request);
print "orderId: $orderId\n";
// Sample $orderId: 130
// Or can create number order from toll free.
$request = new stdclass();
$request->BulkTollFree = new stdclass();
$request->BulkTollFree->Count = 2; // required
$orderId = $client->CreateNumberOrder($request);
print "orderId: $orderId\n";
// Sample $orderId: 131
?>