Facebook Pixel
Fit'DistanceDocumentation
Ouvrir l'app

Habitudes

2 routes

GET /habits

Habits of the coach, archived ones included.

  • Périmètre habits:read
  • 1 crédit
  • Lecture
  • Stable

Paramètres

NomTypeDescription
limitqueryinteger1–200, default 50
cursorquerystringOpaque cursor: next_cursor of the previous page.
sincequerydate-timeISO 8601. Returns the objects with updated_at >= since.
include_deletedquerybooleandefault false
curl "https://api.fitdistance.io/api/partner/v1/habits?limit=50" \
  -H "Authorization: Bearer fd_live_xxxxxxxx"
200 · une page de Habit
{
  "data": [
    {
      "id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
      "coach_id": 4821,
      "name": "string",
      "is_archived": true,
      "updated_at": "2026-10-24T09:12:00Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
403 · SCOPE_MISSING
{
  "error": {
    "name": "PARTNER_API",
    "message": "SCOPE_MISSING"
  }
}

200 · une page de Habit

NomTypeDescription
id requisstring
coach_id requisinteger
name requisstring
is_archived requisboolean
updated_at requisdate-time
deleted_atdate-time | nullPresent when include_deleted is true.

Erreurs

StatutCodeQuand
400VALIDATIONParamètres ou corps invalides.facturé
401UNAUTHORIZEDClé absente, inconnue ou révoquée.non facturé
402CREDITS_EXHAUSTEDPlus de crédits ce mois-ci et aucune réserve.non facturé
403SCOPE_MISSINGLa clé n'a pas le périmètre demandé.non facturé
403PLAN_NOT_ELIGIBLETon offre n'ouvre pas l'API.non facturé
429RATE_LIMITEDTrop d'appels : 10 par seconde, 300 par minute, 60 écritures et 20 suppressions par minute.non facturé

GET /habits/entries

Completed habit entries: one per student, habit and day. The value column that applies depends on the habit type.

  • Périmètre habits:read
  • 1 crédit
  • Lecture
  • Stable

Paramètres

NomTypeDescription
limitqueryinteger1–200, default 50
cursorquerystringOpaque cursor: next_cursor of the previous page.
sincequerydate-timeISO 8601. Returns the objects with updated_at >= since.
include_deletedquerybooleandefault false
student_idqueryinteger≥ 1
curl "https://api.fitdistance.io/api/partner/v1/habits/entries?limit=50" \
  -H "Authorization: Bearer fd_live_xxxxxxxx"
200 · une page de HabitEntry
{
  "data": [
    {
      "id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
      "habit_id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
      "student_id": 4821,
      "entry_date": "2026-10-24",
      "completed_at": "2026-10-24T09:12:00Z",
      "value_boolean": true,
      "value_number": 72.5,
      "value_rating": 4821,
      "value_choice": "string",
      "value_text": "string",
      "note": "string",
      "updated_at": "2026-10-24T09:12:00Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
403 · SCOPE_MISSING
{
  "error": {
    "name": "PARTNER_API",
    "message": "SCOPE_MISSING"
  }
}

200 · une page de HabitEntry

NomTypeDescription
id requisstring
habit_id requisstring
student_id requisintegerThe student the habit is assigned to.
entry_date requisdateThe day the entry counts for.
completed_at requisdate-time
value_boolean requisboolean | null
value_number requisnumber | null
value_rating requisinteger | null
value_choice requisstring | null
value_text requisstring | null
note requisstring | null
updated_at requisdate-time
deleted_atdate-time | nullPresent when include_deleted is true. An entry is deleted with its habit or its assignment.

Erreurs

StatutCodeQuand
400VALIDATIONParamètres ou corps invalides.facturé
401UNAUTHORIZEDClé absente, inconnue ou révoquée.non facturé
402CREDITS_EXHAUSTEDPlus de crédits ce mois-ci et aucune réserve.non facturé
403SCOPE_MISSINGLa clé n'a pas le périmètre demandé.non facturé
403PLAN_NOT_ELIGIBLETon offre n'ouvre pas l'API.non facturé
429RATE_LIMITEDTrop d'appels : 10 par seconde, 300 par minute, 60 écritures et 20 suppressions par minute.non facturé