Live Data API Documentation (EA)

ActivTrak's Live Data API (now in Early Access) is a REST API that allows querying data from the Reporting Service. This data is available at the same rate as what is accessible from the ActivTrak Web Application. Data should appear near real-time depending on when we receive data from installed Agents.

Note: The Early Access version of the Live Data API supports:

Authorization

Authorization is handled with Auth Bearer tokens. Each Early Access account will have an Authorization Bearer Token (API Key) to access and pull data. Each token is mapped to a specific customer account and web user. The permissions that dictate the available data are driven by the
permissions for the user associated with the key.

We currently have two forms of pagination. The original is the older page-style pagination.
The newer is cursor-based pagination. For the time being, the Working Hours Report must
use page-based pagination, and the Activity Log must use cursor-based pagination. In the future,
we plan to move everything over to cursor-based pagination at which time we will deprecate page-based requests.

Working Hours API

URIs

Verb Endpoint (new) Description
GET
/reports/v2/workinghours/users
This API call returns a list of Working Hour Activity objects along with a total (used for pagination). This data is from the user's perspective.
GET
/reports/v2/workinghours/computers
This API call returns a list of Working Hour Activity objects along with a total (used for pagination). This data will be from the computer perspective.

Query Parameters

Name Type Default Required Description
from date   true The starting date. Format: YYYY-MM-DD.
to date   true The end date (inclusive). Format: YYYY-MM-DD.
page int 1 false The page number used in pagination.
pageSize int 150 false The page size for the number of results to return per request. The maximum value is 1000.
userId int -1 false The specific user Id to fetch data. The default value of -1 returns data "all users". Only one of the fields(userId, groupId, computerId) can be sent per request.
groupId int   false The specific group Id to fetch data. Only one of the fields (userId, groupId, computerId) can be sent per request.
computerId int   false The specific computer id to fetch data. Only one of the fields (userId, groupId, computerId) can be sent per request.

JSON Model

Users:

GET reports/v2/workinghours/users
RESPONSE:
{
"activity": [{
"date": "datetime",
"computerid": 1,
"groups": [],
"firstActivity": "datetime",
"lastActivity": "datetime",
"lastActivityLog": "datetime",
"users": [],
"activeTime": {
"productive": 0,
"unproductive": 0,
"undefined": 0,
"total": 0
},
"passiveTime": {
"productive": 0,
"unproductive": 0,
"undefined": 0,
"total": 0
},

"totalTime": 0
}],
"total": 0
}

Computers:

GET reports/v2/workinghours/computers
RESPONSE:
{
"activity": [{
"date": "datetime",
"userid": 1,
"groups": [],
"firstActivity": "datetime",
"lastActivity": "datetime",
"lastActivityLog": "datetime",
"computers": [],
"activeTime": {
"productive": 0,
"unproductive": 0,
"undefined": 0,
"total": 0
},
"passiveTime": {
"productive": 0,
"unproductive": 0,
"undefined": 0,
"total": 0
},
"totalTime": 0
}],
"total": 0
}

Activity Log API

URI:

Verb Endpoint (new) Description
GET
/reports/v2/activitylog
This API call returns a list of Activity Log objects.

Query Parameters:

Name Type Default Required Description
startDate date {TODAY} false The starting date. Format: YYYY-MM-DD. If a
cursor is provided for pagination, this field
does not affect your query results.
endDate date   false The end date (inclusive). Format: YYYY-MM-DD. This field should only be used to bind your data to a specific date range. Otherwise, you only require the start date and you can paginate through to all available data from that point.
cursor string   false The cursor for pagination. When a request is
made without a cursor, the response returns
results based on the date range. Each
response returns a cursor. You should input
the new cursor value for each subsequent
request if you wish to paginate through
additional data. If you do provide a cursor,
the startDate no longer affects the result
boundaries. This allows you to receive old
records that have arrived late. If you receive
no results with a valid/provided cursor, it
means that no new records have been
received yet. A cursor request which returns
no results will return the same cursor back to
the caller.
pageSize int 150 false The page size for number of results to return
per request. The maximum value is 1000.
userId int -1 false The specific user id to fetch data. The
default value of -1 returns data "all users"
Only one of the fields (userId, groupId,
computerId) can be sent per request
groupId int   false The specific group id to fetch data. Only one
of the fields (userId, groupId, computerId)
can be sent per request
computerId int   false The specific computer id to fetch data. Only
one of the fields (userId, groupId,
computerId) can be sent per request

Example:

GET reports/v2/activitylog
RESPONSE:
{
"activity": [
{
"logId": 0,
"productivity": 0,
"popupAlarm": null,
"emailAlarm": null,
"externalNotificationAlarm": null,
"terminate": null,
"date": "datetime",
"computerId": 1,
"computer": "",
"primaryDomain": "",
"privateIp": "",
"publicIp": "",
"loginDomain": "",
"user": "",
"session": 0,
"duration": 0,
"applicationId": 0,
"websiteId": null,
"executable": "",
"description": "",
"url": ""
}
],
"cursor": ""
}

 

Learn more:

Was this article helpful?

0 out of 0 found this helpful

Comments

No comments