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.
Returns information on the order status, cost, and assets aquired.
Since CreateNumberOrder
is an asynchronous process this
GetNumberOrder
operation may need to be polled for up to
20 seconds at a rate of no more than once a second to determine when the
order is in a terminal state of FINISHED or ERRORED. Order will be in
'PROCESSING' status untill finished.
Request Parameters
Parameter | Demo Value | Description | Data Type |
---|---|---|---|
GetNumberOrder | NumberOrder request by unique ID | object | |
Id | Unique ID of resource | long |
* indicates choice value, bolded parameters are required
Response Parameters
Parameter | Description | Data Type |
---|---|---|
NumberOrder | Info on NumberOrder like id, status, and cost | |
id | long | |
Status | [NEW, PROCESSING, FINISHED, ERRORED, PAYMENT_ERROR, VOID, WAIT_FOR_PAYMENT, PARTIALLY_ADJUSTED, ADJUSTED, APPROVE_TIER_ONE, APPROVE_TIER_TWO, REJECTED, PROCESSING_ACH, ACH_ERROR] | OrderStatus |
Created | dateTime | |
TotalCost | float | |
Summary | float | |
SalesTax | float | |
Total | float | |
LocalNumbers | ||
Ordered | int | |
UnitCost | float | |
Fulfilled | List[string] | |
TollFreeNumbers | ||
Ordered | int | |
UnitCost | float | |
Fulfilled | List[string] | |
Keywords | ||
Ordered | int | |
UnitCost | float | |
Fulfilled | List[string] |
<?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'));
/**
* GetNumberOrder: Get info by orderId from previous number order (see #CreateNumberOrder).
*/
$request = new stdclass();
$request->Id = 129; // required
// $result is of type NumberOrder.
$response = $client->GetNumberOrder($request);
print_r($response);
// Sample $response
// stdClass Object (
// [Status] => PROCESSING
// [Created] => 2013-03-07T07:33:41-08:00
// [TotalCost] => 0.03
// [LocalNumbers] => stdClass Object (
// [Ordered] => 1
// [UnitCost] => 0.01
// )
// [id] => 129
// )
//
// Poll on number order every second until order in Status == FINISHED or ERRORED
//
$request = new stdclass();
$request->Id = 129; // required
$count = 0;
while ($client->GetNumberOrder($request)->Status == 'PROCESSING' && $count < 10) {
$count += 1;
echo "count: " . $count . "\n";
sleep(1);
}
print_r($client->GetNumberOrder($request));
?>