POST /api/v1/sessionsemail(string, required): the email of the user to authenticatepassword(string, required): the password of the user to authenticateapp_name(string, required): the name of the application making the request
$ curl -H "Content-Type: application/json" \
-X POST \
-d '{"email": "alix@example.org", "password": "secret", "app_name": "curl request"}' \
"https://app.flus.fr/api/v1/sessions"200 OK on success:
{
"token": "b6d6926418cf69285f3917556e7fe7cc99c43c07cb220e5375eb325efcec5fd5"
}400 Bad Request if the credentials are invalid:
{
"errors": {
"@base": [
{"code": "invalid_credentials", "description": "The credentials are invalid."}
]
}
}400 Bad Request if a parameter is missing:
{
"errors": {
"app_name": [
{"code": "presence", "description": "The app name is required."}
]
}
}- 2.0.0: added
DELETE /api/v1/session$ curl -H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-X DELETE \
"https://app.flus.fr/api/v1/session"200 OK on success:
{}401 Unauthorized if the request is not authenticated:
{
"error": "The request is not authenticated."
}- 2.0.3: added