Generate Statistics Report for a Network

Operation Summary: 
Generates a report for statistics of a specified type for a blog network.
Resource URL: 
https://api.compendiumblog.com/app/stats/{ReportType}
HTTP method: 
GET
HTTP Status Codes: 
200 OK
403 Forbidden
HTTP Status Code Details: 
200 OK
The request was processed successfully.
403 Forbidden
The user invoking the endpoint does not have appropriate authorization to perform the operation.
Response Representations: 
JSON (application/json)
Permitted Roles: 
Super Administrator
Super Delegate
Network Administrator
Default Permissions
Required Parameters: 
ReportType
Specifies the type of report to be generated.

Recognized Report Types

comments
Daily statistics for comment submission.
search.traffic
Daily statistics search traffic with correlation.
posts
Daily statistics for post publication.
visits
Daily statistics for total visits to blog.
traffic.sources
Breakdown of where inbound traffic is coming from.

Clicks (pageview) reports

clicks
Total clicks over time
clicks.outgoing
Total *outgoing clicks over time.
clicks.CTA
Total **CTA (Call to Action) clicks over time.
  • * outgoing is defined by clicks that point back to the 'target' domain. This tracking must be set up on a blog to work as expected.
  • ** CTA is defined as a click on a call to action. This tracking must be set up on a blog to work as expected.
Optional Parameters: 
NetworkId
The unique identifier for network whose statistics are being queried.
DateRange
A JSON encoded, two-element array of strings containing ISO 8601 formatted dates (YYYY-MM-DD) (e.g. ["2008-07-01", "2009-06-30"]).
ReportOptions
Key Value pairs of options (e.g. {"View":"Detail"}

Valid Report Views & Options

  Group By Options
Reports / Views Week Month Year
search.traffic      
  Trend x x x
traffic.sources      
  Trend      
  Percentage      
  Detail      
clicks      
  Trend x x x
  Percentage      
  Detail
(pairs a URI to the number of clicks, with no regard to dates)
     
visits      
  Trend x x x
Response Values: 
Success
The report was generated successfully.
Error
The requested report could not be generated.
Response Structure: 

JSON Responses are single-member objects which have a property name based on the type of result. The Success result will look like:

{"Success" : {
         "Title" : "Human readable report title", 
         "Data" : [ ["2009-09-22",1], ... ], 
         "Metric" : "Human readable name of the metric being returned"
         }
}

The Error result will be a flat array of objects, which have keys for the message name and explanatory text.

{
     "Error" : [
       { "Name" : string, "Message" : string },
       { "Name" : string, "Message" : string },
       ...   
    ]
 }
 
Error Types: 
ReportType
The specified report type was not recognized.
NetworkId
The specified network ID does not correspond to an existing network.
ReportUnavailable
The specified report could not be generated, this typically means it is dependent on a third party service that could not authenticate.
DateRange
The requested range of dates was not valid.
Security
There request was made by a user with inadequate authorization.

Command Line Example

curl -H "Accept: application/vnd.compendium.blog;version=2,application/json" --user someuser:mgc3crqk45ufzkfb https://api.test.compendiumblog.com/app/stats/visits
Drupal 6 Appliance - Powered by TurnKey Linux