This operation retrieves the usage statistics for an Infinity Cloud service account. Range options are available to retrieve the “current” statistic report for the active billing cycle, or the “total” statistic report for the lifetime of the account.
HTTP POST
To request usage statistics, make an HTTP POST to the API:
https://www.infinitysignature.com/api/v1/
Parameter | Req. | Value | Description |
---|---|---|---|
key | yes | api key | Supply the API key for your Infinity Cloud account. |
format | no | “json” | “xml” | Specify the requested format of return data. Defaults to json. |
task | yes | “stats” | The task determines the type of request being made to the API. |
range | no | “current” | “total” | Period of time for stat data. Defaults to current. |
Example
Retrieve the current account usage statistics via a PHP cURL request for the Infinity Cloud account with the api key: zphqpTUSc7pE3IM1pS2X.
Request:
$params = array( 'key' => 'zphqpTUSc7pE3IM1pS2X', 'format' => 'json', 'task' => 'stats', 'range' => 'current' ); $settings = array( CURLOPT_URL => 'https://www.infinitysignature.com/api/v1/', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $params, CURLOPT_RETURNTRANSFER => true ); $ch = curl_init(); curl_setopt_array($ch, $settings); $stats = json_decode(curl_exec($ch), true); curl_close($ch);
Response:
{ "created" : "2015-07-01", "expiration" : "2015-08-01", "service" : "Infinity Signature Cloud - Premier", "max_sigs" : "5000", "max_bytes" : "26843545600", "begin_date" : "2015-07-01", "end_date" : "2015-08-01", "dl_xfers" : "12150", "dl_bytes" : "199065608", "ul_sigs" : "3300" }
Request:
$params = array( 'key' => 'aAbBcCdDeE1234567890', 'format' => 'xml', 'task' => 'stats', 'range' => 'current' ); $settings = array( CURLOPT_URL => 'https://www.infinitysignature.com/api/v1/', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $params, CURLOPT_RETURNTRANSFER => true ); $ch = curl_init(); curl_setopt_array($ch, $settings); $stats = curl_exec($ch); curl_close($ch);
Response:
<response> <created>2015-07-01</created> <expiration>2015-08-01</expiration> <service>Infinity Signature Cloud - Premier</service> <max_sigs>5000</max_sigs> <max_bytes>26843545600</max_bytes> <begin_date>2015-07-01</begin_date> <end_date>2015-08-01</end_date> <dl_xfers>12150</dl_xfers> <dl_bytes>199065608</dl_bytes> <ul_sigs>3300</ul_sigs> </response>