-
🚫 means that the endpoint is authenticated, this means that the user needs to include the Bearer token in the header field "Authorization"
-
👮 means that the endpoint relates only to objects belonging to the user (e.g., you cannot download images that does not belong to you)
Endpoint: POST /auth/signup
Body:
{
"first_name": "string",
"last_name": "string",
"email": "string (email format)",
"password": "string (min 8 chars)"
}
Response: users_id and token to authorize subsequent HTTP calls
{
"authentication": {
"token": "string"
},
"user": {
"id": "integer"
}
}
Endpoint: POST /auth/login
Body:
{
"email": "string",
"password": "string"
}
Response: users_id and token to authorize subsequent HTTP calls
{
"authentication": {
"token": "string"
},
"user": {
"id": "integer"
}
}
Endpoint: POST /auth/logout
Endpoint: GET /users
Response: a list of users objects with their images
[
{
"id": "integer",
"first_name": "string",
"last_name": "string",
"email": "string",
"images": [
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
}
]
Endpoint: GET /users/:id
Response: user object including the list of images belonging to him
{
"id": "integer",
"first_name": "string",
"last_name": "string",
"email": "string"
}
Endpoint: POST /images
Body:
{
"title": "string",
"image_base64": "string (base64)"
}
Response: array of images belonging to the user
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
Endpoint: GET /images
Body:
{
"title": "string",
"image_base64": "string (base64)"
}
Response: array of images belonging to the user
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
Endpoint: PUT /images/:id
Body:
{
"title": "string",
}
Response: array of images belonging to the user (including the updated one)
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
Endpoint: DELETE /images/:id
Response: array of images belonging to the user (not including the deleted one)
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
Endpoint: GET /images/:id
Response: download the requested image