Skip to content

Latest commit

 

History

History
89 lines (67 loc) · 909 Bytes

api-doc.md

File metadata and controls

89 lines (67 loc) · 909 Bytes

My-Gallery

​ List of available endpoints: ​

  • POST /register
  • POST /login
  • GET /photos

POST /register

Request:

  • data:
{
  "email": "string",
  "password": "string"
}

Response:

  • status: 201
  • body: ​
{
  "id": "integer",
  "email": "string"
}

POST /login

Request:

  • data:
{
  "email": "string",
  "password": "string"
}

Response:

  • status: 200
  • body: ​
{
    "id": "integer",
    "email": "string",
    "access_token": "jwt string"
}

GET /photos

description: get all current login user photo

Request:

  • headers: access_token (string)

Response:

  • status: 200
  • body:
{
  "photos": [
    {
      "id": 1,
      "imageUrl": "https://unsplash.com/photos/yC-Yzbqy7PY",
      "UserId": 1,
      "createdAt": "2020-06-12T16:22:40.469Z",
      "updatedAt": "2020-06-12T16:22:40.469Z"
    }
  ]
}