For the purpose of this spec, challenges are groups of workouts/activities that must be completed in order to qualify as 'completed'.
Challenges are specified in the following JSON format which describes a device/vendor/platform independent set of constraints. Our open source Android and iOS apps load challenges in this format and track completion automatically by connecting with wearable fitness devices.
Challenges have a standard header that ensures runtime compatiblity:
header format:
{
"sessions": "0.1.0"
}
Next, the challenge has a name, and a summary in words:
{
"name": "Fitstar 30 day challenge",
"summary": "perform 20 sessions in 30 days"
}
The segments array defines the challenge itself:
{
"segments": [
{
"type": "sessions",
"count": 20,
"days": 30,
filter: {
"types": [
"run",
"walk"
],
"minutes": 25
}
}
]
}
This example is a single segment. Multiple segments would need to satisfied linearly in order to compelte the challenge. If a segment needs to be restarted, the whole challenge is restarted. The segment says the person needs to run or walk for more than 25 minutes at least 20 times within a 30 day window.
The open source apps for iOS and Android can fetch and load challenges from any URL. Challenges should be available on http(s) endpoints with content-type "application/json".