Follow a group of students automatically
Tag a group of students, read their pending check-ins every morning, write the feedback and set the check-in to done.
A tag gathers the students you want to follow closely. Every morning, this use case reads their pending check-ins, writes a feedback and marks the check-in as done. It writes in your name: it needs a key with Students › Read and Write (students:read, students:write), Check-ins › Read and Write (bilans:read, bilans:write) and the sensitive scope bilans.medical:read, which lets you read a check-in's comments. It also needs an offer that includes writes. Create the key in the app, terms of use accepted.
What this use case does
- Create the tag, once:
POST /operations/students.tag_createwith{"name": "auto"}. The reply gives the tag'suid. - Put it on the students you follow:
POST /operations/students.tags_setwith{"studentId": 42, "tagUids": ["<uid>"], "mode": "add"}. - Every morning:
GET /bilans?status=PENDING&tag=<uid>, through all pages. - Read the check-in and its thread:
GET /bilans/{id}, thenPOST /operations/bilans.comments_listwith{"bilanId": 7}. - Write the feedback:
POST /operations/bilans.comment_createwithdry_run: truefirst, without an idempotency key, then the real write with the headerIdempotency-Key: retour-<bilanId>. - Mark the check-in done:
POST /operations/bilans.set_statuswith{"bilanId": 7, "status": "DONE"}.
curl -X POST https://api.fitdistance.io/api/partner/v1/operations/bilans.comment_create \
-H "Authorization: Bearer fd_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"bilanId": 7, "content": "Assistant (IA) de Léa Coach — …", "dry_run": true}'When the preview looks right, replay the call without dry_run, with the header Idempotency-Key: retour-7. See Writes and idempotency.
What it costs
Each call costs one credit. The preview with dry_run: true is free.
What to know
- The feedback is signed with the coach's name. If an AI writes it, it introduces itself in the text, for example "Assistant (IA) de Léa Coach — …".
- A team key (
team:read) reads the trainers' check-ins, butbilans.comment_createandbilans.set_statuson one of them answer 404, like any check-in that does not belong to the key's coach. - A tag belongs to the coach who created it.
bilans.comments_listneeds the sensitive scopebilans.medical:read.
See Scopes for the detail of each scope.