Habit streak plugin
Use to see which days a habit was done. The range is at most 400 days and in the Program's time zone.
semestra_session<token>Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.
instance_id*Instance IdHabit card instance id
from_date*From DateFirst day to list (inclusive)
dateto_date*To DateLast day to list (inclusive)
dateSuccessful Response
application/json- response
items*array<>Checked days, ascending
curl -X GET 'https://example.com/habit/instances/string/checkins?from_date=2019-08-24&to_date=2019-08-24'{ "items": [ "2019-08-24" ]}The habit card's click: a checked day becomes unchecked and the other way round. Days older than 7 days or in the future are refused.
semestra_session<token>Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.
instance_id*Instance IdHabit card instance id
application/json- body
date*DateDay to check or uncheck, in the Program's time zone: today or up to 7 days ago
dateSuccessful Response
application/json- response
date*Datedatechecked*CheckedWhether the day is checked after the call
stats*curl -X POST 'https://example.com/habit/instances/string/checkins/toggle' \ -H 'Content-Type: application/json' \ -d '{ "date": "2019-08-24"}'{ "date": "2019-08-24", "checked": true, "stats": { "goal": "daily", "weekly_target": 0, "current_streak": 0, "longest_streak": 0, "total": 0, "period_done": 0, "period_target": 0, "today": "2019-08-24", "week_start": 1, "checked_today": true }}Use to answer how long the user's streak is or how often they did a habit. For a weekly goal the streaks count weeks that reached the weekly target; a streak stays alive while the running day (or week) is still open. Also returns today's date in the Program's time zone.
semestra_session<token>Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.
instance_id*Instance IdHabit card instance id
Successful Response
application/json- response
goal*Goal"daily""weekly"weekly_target*Weekly TargetCheck-ins needed per week (weekly goal)
current_streak*Current StreakDays (daily goal) or weeks (weekly goal) in a row
longest_streak*Longest Streaktotal*TotalAll checked days
period_done*Period DoneCheck-ins in the current day (daily) or week (weekly)
period_target*Period Target1 for a daily goal, the weekly target otherwise
today*TodayToday in the Program's time zone
dateweek_start*Week StartFirst day of the week: 1 Monday, 7 Sunday
17checked_today*Checked Todaycurl -X GET 'https://example.com/habit/instances/string/stats'{ "goal": "daily", "weekly_target": 0, "current_streak": 0, "longest_streak": 0, "total": 0, "period_done": 0, "period_target": 0, "today": "2019-08-24", "week_start": 1, "checked_today": true}