-
Notifications
You must be signed in to change notification settings - Fork 0
Analytics API
The Analytics API exists to support the analysis of transactions performed on the ActiveTag Platform. Use of these APIs allows for detailed, transaction-level reporting of all activity in the system. This is ideally suited for integration into existing systems. This advanced functionality is available in the form of simple, light-weight and scalable RESTful web services which provide a wide range of data export formats.
- Downloading data to be imported into another system
- Powering a custom analytics dashboard
- Reviewing detailed levels of activity
- Forensic exploration
- Data Export Formats
-
CSV (
text/csv) -
XML (
text/xml, application/xml) -
JSON (
application/json) -
Tab-Separated Values (
text/tsv) -
Plain Text (
text/plain)
The Analytics API is accessible under the /analytics/ URI. It provides access to two sets of data:
- Scan activity
- Share activity
Though differing slightly in relevant data, both share the same general analytic interface and are designed to satisfy a range of use cases from simple data downloads to full forensic demands with strong precision.
To select a preferred data format, simply specify the desired content type via the "Accept" HTTP Request Header:
curl -v -X GET \
-H 'X-ActiveTag-AccessToken: 99065137-f220-4282-b228-07d97935b41d' \
-H 'Accept: text/csv' \
https://api.taglabsinc.com/analytics/scans
Each analytics API has a rich set of filters that allow the results to be narrowed by looking for a subset of characteristics. For example, filtering by date range, tag IDs, tag categories, share counts, etc. Refer to the documentation on each API to view the extensive and flexible list of filters available.
For example, to filter scan data for Colorado:
curl -v -X GET \
-H 'X-ActiveTag-AccessToken: 99065137-f220-4282-b228-07d97935b41d' \
-H 'Accept: text/csv' \
'https://api.taglabsinc.com/analytics/scans?country=US®ion=CO'
Any output column can be used for ordering/sorting of the result data. To sort an API result simply supply a Query Parameter named "order" with a comma-separated list of columns in the same order as the ordering result. This should have the same effect as an "ORDER BY" clause in SQL. The default sort order is "ascending" but a column can be prefixed with a "-" (a dash) to cause that column to sort descending.
For example, to sort by "scan_type" ascending and then by "timestamp" descending:
curl -v -X GET \
-H 'X-ActiveTag-AccessToken: 99065137-f220-4282-b228-07d97935b41d' \
-H 'Accept: text/csv' \
'https://api.taglabsinc.com/analytics/scans?order=scan_type,-timestamp'