Introduction
This article explains how to use the Raw App Metrics End Point to acquire information about app usage.
App47 APIv2 Raw App Metrics
The Raw App Metrics end point allows you to retrieve the raw session, log, and data for generic and timed events for a specific app. You must have the proper permissions in your account in order to access this end point with your member token.
To use this API you must have at least read permission to the app you are requesting raw metrics:
URL | Description |
---|---|
/apps/:app_id/sessions | Raw session records for the given app id |
/apps/:app_id/logs | Raw log records for the given app id |
/apps/:app_id/generic_events | Raw Generic Event Records for the given app id |
/apps/:app_id/timed_events | Raw Timed Event Records for the given app id. |
For more information on how to configure your APIv2 calls, please consult the APIv2 Overview.
Parameters
When fetching raw records, the input parameters in the following table are provided through the App47 APIv2. If the parameter is only available on certain end points, it will be noted in the "Type(s)" column.
Parameter Name | Type(s) | Description | Required? | Default |
---|---|---|---|---|
end | All | The end time to retrieve records. Time should be passed in ISO 8601 format, e.g., 2014-06-19T20:24:48+00:00 | No | Now |
start | All | The start time to retrieve records. Time should be passed in ISO 8601 format, e.g., 2014-06-19T20:24:48+00:00 | No | Two weeks prior to end time |
limit | All | Number of records to return. | No | 50 |
skip | All | Number of records to skip. | No | 0 |
name | Timed and Generic Events | The event name to retrieve daily aggregated | No | None, all event names are returned |
Sessions
Retrieve raw session data for a given app using the following information.
End Point
GET https://cirrus.app47.com/api/v2/apps/:app_id/sessions
Example:
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/sessions
Example: (limiting the return, skipping the first 10 records)
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/sessions?limit=1000&skip=100
Expected Output
If valid, it will return a result with:
-
Success set to true
-
Skip - The number of records that were skipped (The API will return sets of 100 records)
-
Total - The total number of records in your account
-
Count - The total number of records returned in this response
-
List - List of sessions you have access to and match the input parameters
-
A md5 hash of the results element
-
HTTP result code 200
{ "results": { "skip": 0, "total": 1, "count": 1, "list": [ {"id":"583244d8db8fe979a7000001",
"created":"2016-11-21T00:50:30Z",
"modified":"Unknown",
"agent_id":"58324320db8fe974ee000002",
"start_time":"2016-11-21T00:49:25+00:00",
"app_id":"4e552727a2f8fd000100006f",
"device_id":"58324320db8fe974ee000001",
"loc": {"lat":0,
"long":0},
"ip_address":"173.79.107.70",
"device_data":{"manufacture":"Apple",
"model":"x86_64",
"os_version":"10.1",
"platform":"iOS",
"app_version":"1.3.3",
"unique_identifier":"BAD41334-3F40-4B5A-9F04-83362FE95572",
"agent_version":"2.4.1",
"name":"BAD41334-3F40-4B5A-9F04-83362FE95572"},
"geo":{"country":"United States",
"country_code":"US",
"state":"Virginia",
"state_code":"VA",
"postal_code":"20164"},
"session_id":"95686CFF-8332-4173-BE1A-C8B52FA998D2",
"duration":62.460667}], "success":true }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
If invalid, it will return a result with:
-
Success set to false
-
A message indicating the error
-
A md5 has of the results element
-
HTTP result code that is *not* 200
{ "results": { "message":"Invalid date", "success":false }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
Logs
Retrieve raw log data for a given app
End Point
GET https://cirrus.app47.com/api/v2/apps/:app_id/logs
Example:
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/logs
Example: (limiting the return, skipping the first 10 records)
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/logs?limit=1000&skip=100
Expected Output
If valid, it will return a result with:
-
Success set to true
-
Skip - The number of records that were skipped (The API will return sets of 100 records)
-
Total - The total number of records in your account
-
Count - The total number of records returned in this response
-
List - List of sessions you have access to and match the input parameters
-
A md5 hash of the results element
-
HTTP result code 200
{ "results": { "skip": 0, "total": 1, "count": 1, "list": [ {"id":"583244e1db8fe979ce000001",
"created":"2016-11-21T00:50:30Z",
"modified":"Unknown",
"agent_id":"58324320db8fe974ee000002",
"start_time":"2016-11-21T00:50:26+00:00",
"created_at":"2016-11-21T00:50:30Z",
"app_id":"4e552727a2f8fd000100006f",
"device_id":"58324320db8fe974ee000001",
"loc":{ "lat":0,
"long":0},
"ip_address":"173.79.107.70",
"device_data":{"agent_version":"2.4.1",
"app_version":"1.3.3",
"manufacture":"Apple",
"model":"x86_64",
"name":"BAD41334-3F40-4B5A-9F04-83362FE95572",
"os_version":"10.1",
"platform":"iOS",
"unique_identifier":"BAD41334-3F40-4B5A-9F04-83362FE95572"},
"geo":{"country":"United States",
"country_code":"US",
"state":"Virginia",
"state_code":"VA",
"postal_code":"20164"},
"log_id":"EC45059F-E1C4-40E9-94EC-5017679EA4CC",
"level":"warn",
"tags":[],
"session_id":"95686CFF-8332-4173-BE1A-C8B52FA998D2",
"message":"My Log Message",
"filename":"LogGeneratorController.m",
"line_number":81,
"error_name":null,
"error_reason":null,
"error_detail":null}], "success":true }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
If invalid, it will return a result with:
-
Success set to false
-
A message indicating the error
-
A md5 has of the results element
-
HTTP result code that is *not* 200
{ "results": { "message":"Invalid date", "success":false }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
Generic Events
Follow the following procedure to retrieve raw generic event data for a given app.
End Point
GET https://cirrus.app47.com/api/v2/apps/:app_id/generic_events
Example:
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/generic_events
Example: (limiting the return, skipping the first 10 records)
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/generic_events?limit=1000&skip=100
Expected Output
If valid, it will return a result with:
-
Success set to true
-
Skip - The number of records that were skipped (The API will return sets of 100 records)
-
Total - The total number of records in your account
-
Count - The total number of records returned in this response
-
List - List of sessions you have access to and match the input parameters
-
A md5 hash of the results element
-
HTTP result code 200
{ "results": { "skip": 0, "total": 1, "count": 1, "list": [ [{"id":"5832453adb8fe97a1c000001",
"created":"2016-11-21T00:52:07Z",
"modified":"Unknown",
"agent_id":"58324320db8fe974ee000002",
"start_time":"2016-11-21T00:52:04Z",
"app_id":"4e552727a2f8fd000100006f",
"device_id":"58324320db8fe974ee000001",
"loc":{"lat":null,
"long":null},
"ip_address":"173.79.107.70",
"device_data":{"agent_version":"2.4.1",
"app_version":"1.3.3",
"manufacture":"Apple",
"model":"x86_64",
"name":"BAD41334-3F40-4B5A-9F04-83362FE95572",
"os_version":"10.1",
"platform":"iOS",
"unique_identifier":"BAD41334-3F40-4B5A-9F04-83362FE95572"},
"tags":null,
"user_info":null,
"name":"iMac"}], "success":true }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
If invalid, it will return a result with:
-
Success set to false
-
A message indicating the error
-
A md5 has of the results element
-
HTTP result code that is *not* 200
{ "results": { "message":"Invalid date", "success":false }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
Timed Events
Follow the following procedure to retrieve raw timed event data for a given app.
End Point
GET https://cirrus.app47.com/api/v2/apps/:app_id/timed_events
Example:
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/timed_events
Example: (limiting the return, skipping the first 10 records)
curl -H"Access-Token: <<your token>>" https://cirrus.app47.com/api/v2/apps/<<your app id>>/timed_events?limit=1000&skip=100
Expected Output
If valid, it will return a result with:
-
Success set to true
-
Skip - The number of records that were skipped (The API will return sets of 100 records)
-
Total - The total number of records in your account
-
Count - The total number of records returned in this response
-
List - List of sessions you have access to and match the input parameters
-
A md5 hash of the results element
-
HTTP result code 200
{ "results": { "skip": 0, "total": 1, "count": 1, "list": [ [{"id":"5832453adb8fe97a1c000001",
"created":"2016-11-21T00:52:07Z",
"modified":"Unknown",
"agent_id":"58324320db8fe974ee000002",
"start_time":"2016-11-21T00:52:04Z",
"app_id":"4e552727a2f8fd000100006f",
"device_id":"58324320db8fe974ee000001",
"loc":{"lat":null,
"long":null},
"ip_address":"173.79.107.70",
"device_data":{"agent_version":"2.4.1",
"app_version":"1.3.3",
"manufacture":"Apple",
"model":"x86_64",
"name":"BAD41334-3F40-4B5A-9F04-83362FE95572",
"os_version":"10.1",
"platform":"iOS",
"unique_identifier":"BAD41334-3F40-4B5A-9F04-83362FE95572"},
"tags":null,
"user_info":null,
"name":"iMac",
"duration":0.13}], "success":true }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
If invalid, it will return a result with:
-
Success set to false
-
A message indicating the error
-
A md5 has of the results element
-
HTTP result code that is *not* 200
{ "results": { "message":"Invalid date", "success":false }, "md5":"896d94e5e2f4eb6b6bfa19144c7794e5" }
Comments
0 comments
Please sign in to leave a comment.