Get CDN service reports

URL

https://cdnsun.com/api/cdns/[ID]/reports

Method

GET

Curl example

curl -i -X GET -u username:password -H 'Accept: application/json' -H 'Content-type: application/json' --url 'https://cdnsun.com/api/cdns/[ID]/reports?type=GB&period=24h'

Options

OptionData TypeDescriptionExampleKnown ValuesNote
IDintegerSpecify the CDN service ID for reports.5  
periodstringSpecify the time period for reports.24h4h, 6h, 8h, 12h, 24h, 48h, 7d, 14d, 1m, today, yesterday, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12It is a mandatory option when start and end options are not set.
startstringSpecify the start time for reports.2014-01-15T01:00:00+01:00  
endstringSpecify the end time for reports.2014-01-19T14:00:00+01:00  
type*stringSpecify the type of reports.GBGB, MBPS, COSTS 
detailed_onintegerEnable or disable detailed (per location) reports format.00, 1 

Note

Please note that the stat_time property of reports represents the following:

  • For periods 4h, 6h, 8h, 12h, 24h, 48h, today and yesterday it represents the hour for which the reports have been generated. In this case the stat_time property is in the ISO 8601 (with timezone) format. Stat_time 2012-04-15T17:00:00+02:00 represents the time frame between 2012-04-15T17:00:00+02:00 and 2012-04-15T17:59:59+02:00. To change your timezone please visit the Billing/Settings section.
  • For periods 7d, 14d, 1m and 1-12 (past months) it represents the day for which the reports have been generated. In this case the stat_time property is in the YYYY-MM-DD format (in your timezone). Stat_time 2012-04-15 represents the time frame between 2012-04-15T00:00:00 and 2012-04-15T23:59:59. To change your timezone please visit the Billing/Settings section.
  • When you set start and end options then the period option is not needed and it is ignored and the reports are in the hourly (ISO 8601) format in your timezone as well as the start and end options are expected to be in the ISO 8601 format in your timezone. To change your timezone please visit the Billing/Settings section. Please note that the maximal allowed time frame between start and end options is set to 31 days and that reports are kept for 365 days.

Please refer to PHP http_build_query for more informations on how to build a URL-encoded query string.

Contact Us

  ______     ___     ______   
 /_   _//   / _ \\  |      \\ 
 `-| |,-   | / \ || |  --  // 
   | ||    | \_/ || |  --  \\ 
   |_||     \___//  |______// 
   `-`'     `---`   `------`