Get Activities by Accessory ID

Retrieve or search all activities for a specific Accessory ID.

Get a list of Activities for a given Accessory IdAccessory Id - A unique non changing value to identify a particular Accessory. Accessory Id's are globally unique and are UUID v4 strings. A new Accessory Id is assigned by the servers when a device is associated to an account for the first time. If the same physical device is re-associated to the same account, it will receive the same Accessory Id again. If the same physical device is re-associated to a different account, it will receive a new Accessory Id. Example: 70e3e6f9-70c3-45b2-62e4-ace3d027988a. 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 ActivityActivity - An event that is represented by a start time, end time, relevance and other meta-data. Activities are used to represent videos or audio activity that is part of the same sequence of frames or content. Every Activity has a unique Activity Id. Activities will only be stored for as long your service plan dictates. An Activity belongs to an Accessory. For the full list of attributes on an Activity see Get Activity by Id. Activities can be referred to as "clips" or "recordings" in the Logi Circle application. 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 IdActivity Id - A unique non changing value to identify a particular Activity within an Accessory event stream. The API uses a short ISO8601 based timestamp format (YYYYMMDDTHHMMSSZ) with everything represented server side as UTC+0 or "zulu" format. Activity Id's are the short Timestamp of the initial time of Activity creation. However, the Activities startTime value may be later than the value represented by the Activity Id due to trimming and video processing. Activity Id's are not globally unique, but are unique for a given Accessory 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