Filters
Activity Data can be filtered to retrieve a specific range of data, data from a specific source, to allow non-standardized data to be exposed and to provide administrative functionality from a population view. The following examples outline how to use data filters available via the Validic API:
End Date of Activity
Source Filter
The source
filter allows for retrieving datasets specific to a particular source (e.g., Fitbit, BodyMedia, etc.).
GET https://api.validic.com/v1/fitness.json?authentication_token=df3e98f9947c1f348ee097fafa07e27898cb3a78e46fb518488d53f26ff27717&source=sample_app 200 { "summary": { ... }, "fitness": [ { "_id": "51552cd7fded0807c400001f", "timestamp": "2013-03-10T07:12:16+00:00", "utc_offset": "-05:00" "type": "Walking", "intensity": "low", "start_time": "2013-03-10T02:12:16-05:00", "total_distance": 2600, "duration": 2460, "source": "sample_app", "source_name": "Sample App", "last_updated": "2013-03-10T07:12:16+00:00" }, { "_id": "51552cd7fded0807c400001f", "timestamp": "2013-03-10T07:12:16+00:00", "utc_offset": "-05:00" "type": "Walking", "intensity": "low", "start_time": "2013-03-10T02:12:16-05:00", "total_distance": 2600, "duration": 2460, "source": "sample_app", "source_name": "Sample App", "last_updated": "2013-03-10T07:12:16+00:00" } ] }
Expanded Filter
The expanded
filter allows for displaying all available additional output parameters from a single source. By default, expanded
is set to 0 (false). Note that expanded
is only available when combined with the source
filter, and only one source is specified.
For example, the Lumo API returns "time_in_bad_posture" and "time_in_good_posture"
as part of its response, which is not something Validic returns by default. To access this, you would specify source=lumo&expanded=1
.
GET https://api.validic.com/v1/routine.json?authentication_token={USER_ACCESS_TO
KEN}&source=lumo&expanded=1
GET https://api.validic.com/v1/routine.json?authentication_token={USER_ACCESS_TOKEN}&source=lumo&expanded=1 200 { "summary": { ... },Routine { "_id": "5508682080d3798d780000a5", "timestamp": "2015-03-09T00:00:00+00:00", "utc_offset": "+00:00", "steps": 10413, "calories_burned": 261, "distance": 7974, "floors": null, "elevation": null, "source": "lumo", "source_name": "Lumo", "last_updated": "2015-03-17T17:45:04+00:00", "extras": { "data_source": "LUMO_LIFT", "local_time": 1425859200, "total_calories": 261, "total_steps": 10413, "total_distance": 7974, "time_walking": 1154, "running_calories": 145, "running_distance": 2955, "running_steps": 2927, "time_running": 383, "time_in_bad_posture": 26883, "time_in_good_posture": 18417 } ] }
Status Filter
The status
filter allows for displaying all users within an organization with the supplied status. By default, status
is set to all.
GET https://api.validic.com/v1/organizations/5176906c6deddac02c000001/users.jso n?access_token=df3e98f9947c1f348ee097fafa07e27898cb3a78e46fb518488d53f26f f27717&status=all 200 { "summary": { ... }, "users": [ { "_id": "51552cd7fded0807c400001f", "uid": "1" }, { "_id": "51433ft7fdrd0719c4010011", "uid": "2" } ] }
Status List and Definitions
#
Validated Data Filter
The show_validated
filter allows you to be able to determine if the data you are receiving through the Validic API was generated using a device. Responses returned by the Validic API will include a new “validated” field which you may refer to for dertermining if data was device generated. For data to be considered as validated, any activity retrieved by Validic from a source that can be confirmed as recorded by a device, as opposed to entered manually, is considered validated. When determining if a record is validated, Validic will only set the “validated” field to true if there is information coming from the source that the activity was recorded by the device, If the value is false, this may mean that it was manually entered or that Validic is unable to definitively determine that the origin of the record was through the use of a device.
GET https://api.validic.com/v1/organizations/51aca5a06dedda916400002b/fitness.json?access_token=ENTERPRISE_KEY&show_validated=1 200 { "summary": { ... }, "fitness": [ { "_id": "55018daa8d01da30e4000139", "timestamp": "2015-03-12T18:00:00+00:00", "utc_offset": "-09:00", "type": "Martial Arts:Brazilian Jiu Jitsu", "intensity": null, "start_time": "2015-03-12T09:00:00-09:00", "distance": 40346.1538, "duration": 8100.0, "calories": 1372.0, "source": "fitbug", "source_name": "Fitbug", "last_updated": "2015-03-12T12:59:22+00:00", "user_id": "52ffcb4bf1f70eefba000004", "validated": false }, ... ] }