Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/limone-eth/mw-images-api
Middleware Technologies for Distributed Systems - Backend API's for REST API project
https://github.com/limone-eth/mw-images-api
Last synced: 24 days ago
JSON representation
Middleware Technologies for Distributed Systems - Backend API's for REST API project
- Host: GitHub
- URL: https://github.com/limone-eth/mw-images-api
- Owner: limone-eth
- Created: 2020-02-24T14:54:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-20T17:37:26.000Z (over 4 years ago)
- Last Synced: 2024-12-26T14:14:56.547Z (29 days ago)
- Language: TypeScript
- Size: 2.34 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Docs
## :exclamation: Important to know
* :no_entry_sign: means that the endpoint is authenticated, this means that the user needs to include the Bearer token in the header field "Authorization"* :cop: means that the endpoint relates only to objects belonging to the user (e.g., you cannot download images that does not belong to you)
## Auth
#### SignupEndpoint: POST /auth/signup
Body:
```json
{
"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
```json
{
"authentication": {
"token": "string"
},
"user": {
"id": "integer"
}
}
```
___
#### LoginEndpoint: POST /auth/login
Body:
```json
{
"email": "string",
"password": "string"
}
```
Response: users_id and token to authorize subsequent HTTP calls
```json
{
"authentication": {
"token": "string"
},
"user": {
"id": "integer"
}
}
```
___
#### Logout :no_entry_sign:Endpoint: POST /auth/logout
## Users
#### Retrieve User Profile :no_entry_sign: :cop:Endpoint: GET /users
Response: a list of users objects with their images
```json
[
{
"id": "integer",
"first_name": "string",
"last_name": "string",
"email": "string",
"images": [
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
}
]
```
___
#### Retrieve Users List :no_entry_sign:Endpoint: GET /users/:id
Response: user object including the list of images belonging to him
```json
{
"id": "integer",
"first_name": "string",
"last_name": "string",
"email": "string"
}
```
___
## Images
#### Upload Image :no_entry_sign:Endpoint: POST /images
Body:
```json
{
"title": "string",
"image_base64": "string (base64)"
}
```Response: array of images belonging to the user
```json
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
```
___
#### Retrieve Images List :no_entry_sign: :cop:Endpoint: GET /images
Body:
```json
{
"title": "string",
"image_base64": "string (base64)"
}
```Response: array of images belonging to the user
```json
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
```
___
#### Update Image :no_entry_sign: :cop:Endpoint: PUT /images/:id
Body:
```json
{
"title": "string",
}
```Response: array of images belonging to the user (including the updated one)
```json
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
```
___
#### Delete Image :no_entry_sign: :cop:Endpoint: DELETE /images/:id
Response: array of images belonging to the user (not including the deleted one)
```json
[
{
"id": "integer",
"key": "string",
"title": "string"
},
{
"...": "..."
}
]
```
___
#### Download Image :no_entry_sign: :cop:Endpoint: GET /images/:id
Response: download the requested image