Get Visitors Report

To get the Visitors report, use the following request:

GET /cdn/reports/visitors.xml
GET /cdn/reports/visitors.json

XML Request Example

curl -i -X GET -u user:userpass --url http://onapp.test/cdn/reports/visitors.xml -d '<visitors><start_date>2016-11-09</start_date><end_date>2016-11-10</end_date><entity_id>945986057</entity_id></visitors>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

curl -i -X GET -u user:userpass --url http://onapp.test/cdn/reports/visitors.json  -d '{"visitors": {"start_date": "2016-11-09", "end_date": "2016-11-10", "entity_id": "945986057"}}' -H 'Accept: application/json' -H 'Content-type: application/json'

Where:

Define a time period by setting the following parameters:

  • start_date - the start date of the specific time period
  • end_date - the end date of the specific time period

Get statistics for a particular CDN resource by setting the following parameters:

  • entity_id - the ID of the CDN resource

XML Output Example

<visitors>
<top_five_visitor_countries_line_chart type="array">
<top_five_visitor_countries_line_chart>
<time>2016-12-09</time>
<country>--</country>
<request type="float">44.0</request>
</top_five_visitor_countries_line_chart>
<visitor_country_table type="array">
<visitor_country_table>
<country>--</country>
<avgLatency type="float">1.5404897959183672</avgLatency>
<avgTransferRate type="float">1422596.5896</avgTransferRate>
<request type="float">4313.0</request>
<bandwidth type="float">190627943.0</bandwidth>
</visitor_country_table>
</visitors>

Where:

top_five_visitor_countries_line_chart - an array of top five visitor countries chart details:

time - the selected time period

country - the country, where visitors are located

request - the total amount of requests for the selected period

visitor_country_table - an array of  visitor country table details:

country - the country, where visitors are located

avgLatency - the average latency for the selected period

avgTransferRate - the average transfer rate for the selected period

request - the amount of successful file requests  for the selected period

bandwidth - the amount of transmitted bandwidth for the selected period