Get Activities by Accessory ID

Retrieve or search all activities for a specific Accessory ID.

Get a list of Activities for a given Accessory Id. This API supports time boxing and activity filtering. Once you have a list of Activities, you can invoke Get Activity DASH, Get Activity HLS, Get Activity MP4 File, or Get Activity JPG File to retrieve media for them. Any activity other than the most recent one will not have it's meta-data change. The newest activity may still be in progress and all meta-data about it may change.

Note: Filtering Activities by Zone is only recommended when looking for results with a newer value than the lastModified field returned in Get or Save Zones by Accessory Id. If older data, use Object Location.

Permissions

Requires a Permissions scope of: circle:activities_basic

The request values for filter and extraFields are impacted by the Zones Feature and Advanced Timeline Filters Feature.

Valid values for startActivityId are impacted by the Storage Length Feature.

Response Body

Name

Type

Description

activities

array of objects

A list of Activity objects. For the detailed structure of the object, see Get Activity by Id. The returned list is always sorted newest to oldest.

nextStartActivityId

string

The Activity Id to use as the start value when doing paging. This value must be passed as the startActivityId in the subsequent call.

Examples

The following examples are written as if the current timestamp is March 2nd, 2016 at 11:22 am UTC time (20160302T112200Z). The examples also only show the activityId value in the return for brevity. See Get Activity by Id for the full object details.

// 1 - Ask for current list
POST /api/accessories/70e3e6f9-70c3-45b2-62e4-ace3d027988a/activities
{
    "scanDirectionNewer": true
}
// Returns
{
    "activities": [
        {"activityId": "20160302T112013Z"},
        {"activityId": "20160302T105548Z"}
    ],
    "nextStartActivityId": "20160302T105548Z"
}
// 2 - Use the previous newest for the second call to grab updates and newer values
POST /api/accessories/70e3e6f9-70c3-45b2-62e4-ace3d027988a/activities
{
    "startActivityId": "20160302T112013Z",
    "operator": ">=",
    "limit" : 20
}
// Returns
{
    "activities": [
        {"activityId": "20160302T112145Z"},
        {"activityId": "20160302T112013Z"}
    ]
}
// 1. First call in this sequence gets the 20 most recent events.
POST /api/accessories/70e3e6f9-70c3-45b2-62e4-ace3d027988a/activities
{
    "scanDirectionNewer": true,
    "limit" : 20
}
  
// Returns
{
    "activities": [
        {"activityId": "20160302T112013Z"},
        // ... 18 more objects here ...
        {"activityId": "20160302T033027Z"}
    ],
    "nextStartActivityId": "20160302T033027Z" // <--- This id becomes the starting point for next call
}
  
// 2. The next call uses the last activityId from the first call as the startTime with an older than operator
POST /api/accessories/70e3e6f9-70c3-45b2-62e4-ace3d027988a/activities
{
    "startActivityId": "20160302T033027Z",
    "scanDirectionNewer": true,
    "operator": "<",
    "limit": 20
}
 
// Returns a new list which doesn't include the last activity from the first call.
{
    "activities": [
        {"activityId": "20160302T031355Z"},
        // ... 18 more objects here ...
        {"activityId": "20160301T165610Z"}
    ]
    // Note: no "nextStartActivityId" means all the results have been retrieved
}
Language
Authentication
OAuth2