App47 Data API Overview
The App47 platform allows you to programmatically obtain data related to monitored apps. For instance, you can easily obtain all session data for a particular app, in raw form, for integration with in-house BI systems for analysis. Please note, this API is read-only; that is, you can only obtain metrics in this fashion – the metrics themselves are created by Apps containing the App47 Embedded Agent.
This feature is enabled by default and leverages an account token, which you can find in the Profile dropdown found on the top right of the App47 Dashboard.
In the dropdown, you’ll see an API option. Click on that to see your account’s unique APItoken. This token can be regenerated at will; furthermore, it’s required in a custom HTTP header (X-Token) for all programatic communication. All data is returned as XML unless an HTTP Accept header specifies JSON, in which case JSON documents will be returned.
Please note, the HTTP endpoint is cirrus.app47.com and not cumulus.app47.com.
URLs
All URLs in this API are HTTP GETs – this is a read-only API for data collection.
URLs:
Data type | HTTP method | URL |
---|---|---|
sessions | GET | https://cirrus.app47.com/api/sessions |
logs | GET | https://cirrus.app47.com/api/logs |
timed events | GET | https://cirrus.app47.com/api/timed_events |
generic events | GET | https://cirrus.app47.com/api/generic_events |
Parameters
As a part of any GET request, you can pass in optional filter parameters. start_time and end_time are available for any GET request; what's more, other URIs support parameters such as name and level. See the table below for more information:
Data type | Available parameters |
---|---|
sessions | start_date, end_date |
logs | start_date, end_date, level |
timed events | start_date, end_date, name |
generic events | start_date, end_date, name |
Valid values for level are:
-
Info
-
Debug
-
Warn
-
Error
-
Crash
Valid values for name include any timed event or generic event name you've added to your app while instrumenting the app.
Value values for start_date and end_date are exclusive, and used with the evaluation of “greater than” and “less than” respectively. They can take one of several forms:
-
By day: 2014-09-21 - will represent September 21, 2014 midnight UTC.
-
By time: 2014-09-21T15:30:00 - will represent September 21, 2014 3:30 p.m. UTC
-
By time with timezone: 2014-09-21T15:30:00-0500 - will represent September 21, 2014 3:30 p.m. EDST
Examples
The examples below use curl, which sends a default 'Accept' header of 'application/xml' with the request. If you are receiving an 406 error, make sure you are setting a header of 'Accept' equal to either 'application/xml' or 'application/json' with the request.
With an API token of abFLe994DE5g9r6673PsA
, you can retrieve all timed events for an account, using cURL, like so:
curl -H "X-Token: abFLe994DE5g9r6673PsA" https://cirrus.app47.com/api/timed_events
In this case, the response will be in XML. If you’d rather receive JSON, simple add an Accept HTTP Header like so:
curl -H "X-Token: abFLe994DE5g9r6673PsA" -H "Accept: application/json" https://cirrus.app47.com/api/timed_events
Naturally, if you have more than one app associated with your account, you can restrict retrieved data by your app’s id:
curl -H "X-Token: abFLe994DE5g9r6673PsA" -H "Accept: application/json" https://cirrus.app47.com/api/timed_events?app_id=4e0db5fddeec192345000018
In this case, you provide a parameter, app_id. In addition, we support a more RESTful style of URIs; consequently, you can refashion a URL to drop the parameter and instead add the App ID as follows:
curl -H "X-Token: abFLe994DE5g9r6673PsA" -H "Accept: application/json" https://cirrus.app47.com/api/apps/4e0db5fddeec190001000018/timed_events
Note, in this case, the resource URI changes to api/apps/{app_id}/metric_name.
You can restrict by date too. Just add a start_date parameter.
curl -H "X-Token: abFLe994DE5g9r6673PsA" -H "Accept: application/json" 'https://cirrus.app47.com/api/timed_events?app_id=4e0db5fddeec192345000018&start_date=2011-09-16'
All App47 monitored data is available for querying, including sessions, timed events, generic events, and logs. Simply replace the metric name in the URL (i.e. https://cumulus.app47.com/logs).
Comments
0 comments
Please sign in to leave a comment.