Pomodoro plugin
Called by the pomodoro card when a focus session completes. Do not use it to log time the user only mentions in chat: sessions come from the timer.
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.
application/json- body
instance_id*Instance IdPomodoro card instance id
1 <= length <= 64course_id?|Course the focus time was spent on, if any
started_at*Started AtWhen the session started (UTC, timezone-aware)
date-timeended_at*Ended AtWhen the session ended (UTC, timezone-aware)
date-timeduration_sec*Duration SecSeconds actually spent, without pauses
1 <= value <= 14400mode?ModeOnly focus sessions count towards statistics
"focus""focus""short_break""long_break"Successful Response
application/json- response
id*Idduplicate*DuplicateTrue when this session had been recorded before
curl -X POST 'https://example.com/pomodoro/sessions' \ -H 'Content-Type: application/json' \ -d '{ "instance_id": "string", "started_at": "2019-08-24T14:15:22Z", "ended_at": "2019-08-24T14:15:22Z", "duration_sec": 1}'{ "id": "string", "duplicate": true}Use to answer how long the user focused, e.g. "how long did I study APS105 this week". Pass course_id to limit to one course (find it with academics.course.find). Defaults to the last 7 days. Days follow 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.
from_date?|First day (inclusive); defaults to 6 days before to_date
to_date?|Last day (inclusive); defaults to today
course_id?|Only count focus time spent on this course
program_id?|Program whose time zone defines the days; defaults to the active Program
Successful Response
application/json- response
from_date*From Datedateto_date*To Datedatetoday*TodayToday in the time zone used for the days
datetimezone*Timezonetotal_focus_sec*Total Focus Sectotal_sessions*Total Sessionsdays*array<>Days with focus time, ascending
by_course*array<>Focus time per course, longest first
curl -X GET 'https://example.com/pomodoro/stats'{ "from_date": "2019-08-24", "to_date": "2019-08-24", "today": "2019-08-24", "timezone": "string", "total_focus_sec": 0, "total_sessions": 0, "days": [ { "date": "2019-08-24", "focus_sec": 0, "sessions": 0 } ], "by_course": [ { "course_id": "string", "focus_sec": 0, "sessions": 0 } ]}