π¦ Response codes & headers
Where the status comes fromβ
The HTTP status is 200 when the request got through. The real status is the code of the body. When a response has an X-Code header, the app uses that number as the status, over the HTTP one. Any status >= 400 is an error and shows the body's message (404 and 403 have fixed messages: "not found" and "forbidden action").
Codesβ
| Code | Name in the app | Meaning |
|---|---|---|
200 | OK | Success |
210 | EmptyData | Nothing found. Accepted as success by some updates; the student search reports "no student found" |
202 | β | First login: create the account |
220 | β | Wrong answer to the secret question |
221 | β | Identifiant already personalised |
235 | β | Identifiant already exists |
250 | Auht2Factor | 2FA required |
401 | UnauthorizedUser | Token invalid or expired |
403 | NotAuthorized | Forbidden action |
500 | β | Unexpected server error |
505 | β | Labelled βbad confirmation passwordβ by the app |
506 | SMSInvalid | Invalid SMS code |
508 509 511 514 517 519 521 581 582 | β | The app shows the server's message |
516 | CompteInvalide | βThis site is currently closedβ |
518 | β | βYour user record does not existβ |
520 525 | β | Token invalid or expired |
526 | AccessTokenInvalid | Access token invalid |
530 | DeniedAccess | Named in the app, no handling |
535 | NotExported | Named in the app, no handling |
580 | β | Error while sending the message |
585 | NotAvailable | Named in the app, no handling |
600 | UserTypeNotSupported | Named in the app, no handling |
517 is also used by the app itself for local failures of account switching ("no account found", "the profile change cannot be made").
Dead tokenβ
401, 520 and 525 mean the token is dead. The app renews it (see Renew the token) and replays the failed request once.
Payment result codesβ
Payment state answers with the payment outcome in code. The app does not treat these as errors:
| Code | Name | Meaning |
|---|---|---|
200 | OK | Paid |
501 | CANCEL | Cancelled by the user |
500 | REFUSED | Refused by the bank |
502 | KO | Failed |
550 | ERROR | Error |
Headersβ
| Header | Direction | Use |
|---|---|---|
X-Token | request, response | The token. Sent on every request once logged in; replace it with the one of any response that has one |
2FA-Token | request, response | The two-factor token, sent on every request once the server gave one, updated from responses |
X-Code | response | Overrides the HTTP status (see above). The upload endpoint answers its status only here |
WOPI-Token | response | Token of the online office editor (Collabora). Kept by the app when present |
STREAM-Token | response | Token to play streamed videos. Kept when present. It goes in the URL of Play a video |
X-WithAuthUserInfos and X-WithCacheContext are set by the app on responses for its own bookkeeping (cache and user context); they are not part of the API.
Hostsβ
| Host | Use |
|---|---|
https://api.ecoledirecte.com | Student, family and tutor accounts, and every login |
https://apip.ecoledirecte.com | Teacher and staff accounts after login |
https://controller.ecoledirecte.com | WebSocket |
https://libreoffice.ecoledirecte.com | Online office editor (Collabora); the app also builds REST URLs from it ({collabora}/restv3/ws) for the editor |
https://api.ecoledirecte.com/mot-de-passe-oublie.awp | Forgotten password page (opened in a browser) |
Outside production the app uses http://{host}/EDV3WEBSERVICES_WEB/FR/v3 and http://{host}/restv3/ws instead of /v3 and /restv3/ws.