Get the traffic volume in megabytes or as percentages grouped by client internet service providers (ISPs). Request parameters allow you to specify a time period, whether to get percentages, and whether to get HTTPS traffic only or HTTP traffic only.
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 |
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 |
Can be either percent to get the percentage of volume from each ISP or logvalue to get the actual bytes from each ISP. |
Yes |
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 |
This request does not include an XML document in the request body.
GET /api/report/flow/clientisp 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/flow/clientisp?datefrom = {date from} & dateto = {date to} & type={percent or log value} & https = {https setting}
-X GET
-u {user}: {password}
-H 'Date: Fri, 26 Oct 2012 06:33:26 GMT'
-H 'Accept: application/xml'
This request will obtains the breakdown of volume by client ISP returned as percentages.
curl -i --url 'https://api.quantil.com/api/report/flow/clientisp?datefrom=2014-08-01T00:00:00%2B09:00&dateto=2014-08-02T23:59:59%2B09:00&type=percent' -u test:aDz9BXnyittq7jyVQZjBls0OBZk4= -H 'Date: Thu, 07 Aug 2014 14:31:12 PDT' -H 'Accept: application/xml'
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}
Element |
Description |
flow-report |
container for traffic information. It will contain zero or more <flow-client-isp> child elements indicating volume for different ISPs. |
flow-client-isp |
a container which has one <client-isp> element and either a <percent> element or a <value> element. The <percent> element is returned if the query parameter type is percent while <value> is returned if type is logvalue. |
client-isp |
indicates a client ISP. The format includes a two character country code from the list of codes below along with the name of an ISP, for example, FR_Orange. |
percent |
indicates percentage of traffic from the ISP. |
value |
indicates bytes transferred. |
HTTP/1.1 200 OK
Date: Thu, 07 Aug 2014 23:16:32 GMT
Accept-Ranges: bytes
Server: WS-web-server
x-cnc-request-id: 1130615
ContentType: application/xml;charset=UTF-8
Content-Type: application/xml;charset=UTF-8
Content-Length: 727
<?xml version="1.0" encoding="UTF-8"?>
<flow-report>
<flow-client-isp><client-isp>CN_dianxin</client-isp><percent>53.74</percent></flow-client-isp>
<flow-client-isp><client-isp>CN_wangtong</client-isp><percent>19.46</percent></flow-client-isp>
<flow-client-isp><client-isp>CN_yidong</client-isp><percent>14.98</percent></flow-client-isp>
<flow-client-isp><client-isp>FR_Orange</client-isp><percent>3.25</percent></flow-client-isp>
<flow-client-isp><client-isp>RU_Golden</client-isp><percent>1.21</percent></flow-client-isp>
<flow-client-isp><client-isp>US_T-Mobile</client-isp><percent>5.14</percent></flow-client-isp>
<flow-client-isp><client-isp>Other ISPs</client-isp><percent>2.18</percent></flow-client-isp></flow-report>
Error |
Description |
HTTP status code |
InvalidDatePeriod |
The date specified is invalid. |
400 |
InvalidReportType |
The report type specified is invalid. |
400 |