This API stores video access/usage statistics for the linear channels and vod items.
/api/analytics
Adds a new analytics record of either on-demand video usage or linear channel viewing statistics
Parameters:
| Name | Value | Requirement | Info |
|---|---|---|---|
| action | addVideoAccess | Mandatory | Identifies a request type |
| companyId | number | Mandatory | Identifies Icareus Suite company |
| groupId | number | Mandatory | Identifies Icareus Suite group |
| itemType | number | Mandatory | Specifies video item type. The type ids can be configured in Icareus Suite properties. Default values: 1 - VOD, 2 - linear channel |
| itemId | number | Mandatory | It could be either assetId or linear channelId depending on the item type |
| deviceUdid | sting | Mandatory | A unique device identifier to report statistics. The device should be registered in the system |
| presetId | number | Optional | A video preset to report statistics |
| startTime | number | Mandatory | UTC timestamp |
It is possible to use organizationId instead of companyId and groupId.
| organizationId | number | Optional | Identifies Icareus Suite organization |
JSON response parameters
| Name | Info |
|---|---|
| status | request status code ("ok", "error") |
| message | request status message |
| videoAccessId | report access id that should be stored to update statistics data |
Response:
{"message":"","status":"ok","videoAccessId":371745} |
The response from addVideoAccess contains videoAccessId which should be used to update video duration.
| Name | Value | Requirement | Info |
|---|---|---|---|
| action | updateVideoAccess | Mandatory | Identifies a request type |
| videoAccessId | number | Mandatory | access id parameter to update statistics (it should be obtained from addVideoAccess API call) |
| duration | number | Mandatory | access duration (seconds) |
Example:
http://127.0.0.1/api/analytics?action=updateVideoAccess&videoAccessId=118313&duration=30
{"message":"Duration updated","status":"ok"} |