Service Type Bandwidth by Region Report - GET /api/report/{service-type}/bandwidth/{region}

Reports ››
Parent Previous Next

GET /api/report/{service-type}/bandwidth/{region}    

Get bandwidth statistics for all domains of a particular service type.  Service-type should be one of the services you subscribe to:  web, wsa, download, or vodstream.  Refer to the mapping of these service types to QUANTIL's products.    You can specify multiple service types by separating them with semicolons. The region can be 'cn', 'nc', 'euna', or 'apac'  representing Mainland China, near China, Europe/North America, and Asia Pacific, respectively.  You may specify more than one area by separating them with semicolons.  In addition,  request parameters allow you to specify a time period, an interval type, and timezone for the output. An optional parameter lets you get HTTPS traffic only or HTTP traffic only.



Request Details


Request Headers


Header

Description

Required

Authorization

Authorization string for the request

Yes

Host

URI for the QUANTIL SDK (i.e., api.quantil.com)

Yes

Date

The date and time of the request.

Yes

Accept

Indicates the accepted format (i.e., application/xml)

Yes

Request Parameters

Parameter

Description

Required

datefrom

RFC3339 formatted date indicating the starting date. Example: 2013-01-01T22:30:00+08:00

Yes

dateto

RFC3339 formatted date indicating the ending date. Example: 2013-01-01T22:30:00+08:00

Yes

type

Indicates the granularity of time. Can be fiveminutes, hourly, or daily.

Yes

timezone

Indicates the timezone for the report data. It must be relative to GMT and specified in the format GMT+n where  -12<= n <= 12.  For example, timezone=GMT-7  and timezone=GMT+8.  If the parameter is unspecified, results will be in the GMT timezone.

No

https

If true, return traffic for domains using SSL. If false, return traffic for domains not using SSL. If not specified, return all traffic (SSL and non-SSL).

No


Request Body Elements

This request does not include an XML document in the request body.


Request Syntax:


GET /api/report/{service-type}/bandwidth HTTP/1.1

Authorization: <authorization string>

Host: api.quantil.com

Date: <date>

Accept: application/xml


Here is the structure of a request using the curl utility.


curl -i --url https://api.quantil.com/api/report/ {service-type} /bandwidth/{region} ?datefrom = {date from} & dateto = {date to}& type = {fiveminutes or Hourly or daily} & timezone = {timezone}& https = {https setting}

-X GET

-u {user}: {password}

-H 'Date: Fri, 26 Oct 2012 06:33:26 GMT'

-H 'Accept: application/xml'

Sample Request:


curl -i --url 'https://api.quantil.com/api/report/download/bandwidth/cn?datefrom=2014-08-01T00:00:00%2B09:00&dateto=2014-08-05T23:59:59%2B09:00&type=daily' -u test:aDz9BRnyZtq7jyVQZjBls0OBZk4= -H 'Date: Thu, 07 Aug 2014 14:31:12 PDT' -H 'Accept: application/xml'

Response Details:


Response Headers:

HTTP/1.1 200 OK

Date: <date>

Content-Type: application/xml; charset = utf-8

x-cnc-request-id: {id string auto generated by the QUANTIL server}



Response Body Elements


Element

Description

bandwidth-report

container for bandwidth information. It will contain one <bandwidth-summary> child element and zero or more <bandwidth-data> child elements indicating the bandwidth usage at different times.

bandwidth-summary

indicates total bandwidth in Mbits/second

bandwidth-data

this container object contains a <timestamp> element and a <bandwidth> element describing the bandwidth used.

timestamp

indicates the date and time

bandwidth

indicates the average bandwidth in Mbits/second for the requested time period.  Note that the bandwidth is the same as the traffic volume for the five minute interval multiplied by 8 and divided by 300.

Sample Response:


The following example shows data at daily intervals.


HTTP/1.1 200 OK

Date: Fri, 08 Aug 2014 01:30:40 GMT

Accept-Ranges: bytes

Server: WS-web-server

x-cnc-request-id: 1132407

ContentType: application/xml;charset=UTF-8

Content-Type: application/xml;charset=UTF-8

Content-Length: 541


<bandwidth-report>

 <bandwidth-summary>4077.6241</bandwidth-summary>

 <bandwidth-data>

   <timestamp>2014-07-31</timestamp>

   <bandwidth>64.497</bandwidth>

 </bandwidth-data>

 <bandwidth-data>

   <timestamp>2014-08-01</timestamp>

   <bandwidth>1322.6045</bandwidth>

 </bandwidth-data>

 <bandwidth-data>

   <timestamp>2014-08-02</timestamp>

   <bandwidth>1307.0056</bandwidth>

 </bandwidth-data>

 <bandwidth-data>

   <timestamp>2014-08-03</timestamp>

   <bandwidth>1383.517</bandwidth>

 </bandwidth-data>

</bandwidth-report>


Error List


Error

Description

HTTP status code

InvalidDatePeriod

The date specified is invalid.

400

InvalidReportType

The report type specified is invalid.

400

InvalidServiceArea

The region specified is invalid.

400

InvalidServiceType

The service type specified is invalid.

400