Public
Documentation Settings

Project Pomodoro

This is the API-Documentation for the final Technigo-project of Birgit Nehrwein, Darya Lapata and Rebecca Philipson.

We built an API for a combined tasklist and pomodoro-timer. We use MongoDB and mongoose to store data about the user, his/her tasks and the no. of pomodoros.

All vital endpoints demand user authorization.

GEThttps://final-project-pomodoro-api.herokuapp.com/tasks/:userId

https://final-project-pomodoro-api.herokuapp.com/tasks/620ca30582b589206c54130b

GET all tasks of a user

HEADERS
Authorization

6889a07b5c123960ce918f48ef6a9b54af32fd3a68f39e678aa0fb8da8f1f0394e13d6235b2d4cbdbbaa2e4789381827c5bd93925666763dd3d1ede583fdf4f3a6abd9185684347b943fa3d521b893d30266649e15ae5a3258adb507336a2baac7de4141805b6ad5bedf31aa663a006c847b458c69026b8b10f1223867c984c7

Example Request
curl
curl --location 'https://final-project-pomodoro-api.herokuapp.com/tasks/620dfb8b6f09250029dc73cf' \
--header 'Authorization: 8bcc7cf920923f08659e64bc098cf3c7f059b7e501b6dfc3eec88f897cb31dbdf9454252d1b6aa399e1d354888bd5e11689ec63c453c04abd075534cdc7a4d9ffbe41b5d5204cb59e3cd51305fab9ff24f123fa24fe7419b3b6adc9b1d7d7663a4cd1e92a351602976ecd2a51f5945529d363bb8df8cf5493b279824d6b2a9db' \
--data ''
201 Created
Example Response
json
{
  "response": {
    "tasks": [
      {
        "completed": false,
        "pomodoros": 0,
        "completedAt": null,
        "_id": "620dfb9f6f09250029dc73e4",
        "description": "Third to do",
        "user": "620dfb8b6f09250029dc73cf",
        "createdAt": "2022-02-17T07:39:11.869Z",
        "__v": 0
      },
      {
        "completed": false,
        "pomodoros": 0,
        "completedAt": null,
        "_id": "620dfb9b6f09250029dc73dd",
        "description": "Second to do",
        "user": "620dfb8b6f09250029dc73cf",
        "createdAt": "2022-02-17T07:39:07.785Z",
        "__v": 0
      },
      {
        "completed": false,
        "pomodoros": 0,
        "completedAt": null,
        "_id": "620dfb976f09250029dc73d6",
        "description": "First to do",
        "user": "620dfb8b6f09250029dc73cf",
        "createdAt": "2022-02-17T07:39:03.694Z",
        "__v": 0
      }
    ],
    "pomodoros": []
  },
  "success": true
}
Server

Cowboy

Connection

keep-alive

X-Powered-By

Express

Access-Control-Allow-Origin

*

Content-Type

application/json; charset=utf-8

Content-Length

640

Etag

W/"280-521XG250nwgwIi6HUlIC7Do2rMg"

Date

Thu, 17 Feb 2022 07:41:45 GMT

Via

1.1 vegur

POSThttps://final-project-pomodoro-api.herokuapp.com/tasks/

https://final-project-pomodoro-api.herokuapp.com/tasks/

POST a new task

HEADERS
Authorization

8bcc7cf920923f08659e64bc098cf3c7f059b7e501b6dfc3eec88f897cb31dbdf9454252d1b6aa399e1d354888bd5e11689ec63c453c04abd075534cdc7a4d9ffbe41b5d5204cb59e3cd51305fab9ff24f123fa24fe7419b3b6adc9b1d7d7663a4cd1e92a351602976ecd2a51f5945529d363bb8df8cf5493b279824d6b2a9db

Bodyraw (json)
json
{
    "description": "New task",
    "user": "620dfb8b6f09250029dc73cf"
}
Example Request
curl
curl --location 'https://final-project-pomodoro-api.herokuapp.com/tasks/' \
--header 'Authorization: 8bcc7cf920923f08659e64bc098cf3c7f059b7e501b6dfc3eec88f897cb31dbdf9454252d1b6aa399e1d354888bd5e11689ec63c453c04abd075534cdc7a4d9ffbe41b5d5204cb59e3cd51305fab9ff24f123fa24fe7419b3b6adc9b1d7d7663a4cd1e92a351602976ecd2a51f5945529d363bb8df8cf5493b279824d6b2a9db' \
--data '{
    "description": "New task",
    "user": "620dfb8b6f09250029dc73cf"
}'
201 Created
Example Response
json
{
  "response": {
    "_id": "620e01876f09250029dc740d",
    "description": "New task",
    "completed": false,
    "pomodoros": 0,
    "createdAt": "2022-02-17T08:04:23.053Z"
  },
  "success": true
}
Server

Cowboy

Connection

keep-alive

X-Powered-By

Express

Access-Control-Allow-Origin

*

Content-Type

application/json; charset=utf-8

Content-Length

158

Etag

W/"9e-uVKuWbejgjQvdPs3+tOVeNNDIUA"

Date

Thu, 17 Feb 2022 08:04:23 GMT

Via

1.1 vegur

PATCHhttps://final-project-pomodoro-api.herokuapp.com/tasks/:taskId/complete

https://final-project-pomodoro-api.herokuapp.com/tasks/620dfb976f09250029dc73d6/complete

PATCH un/complete a task

HEADERS
Authorization

8bcc7cf920923f08659e64bc098cf3c7f059b7e501b6dfc3eec88f897cb31dbdf9454252d1b6aa399e1d354888bd5e11689ec63c453c04abd075534cdc7a4d9ffbe41b5d5204cb59e3cd51305fab9ff24f123fa24fe7419b3b6adc9b1d7d7663a4cd1e92a351602976ecd2a51f5945529d363bb8df8cf5493b279824d6b2a9db

Bodyraw (json)
json
{
    "user": "620dfb8b6f09250029dc73cf",
    "completed": true,
    "completedAt": "2022-02-17"
}
Example Request
curl
curl --location --request PATCH 'https://final-project-pomodoro-api.herokuapp.com/tasks/620dfb9b6f09250029dc73dd/complete' \
--header 'Authorization: 8bcc7cf920923f08659e64bc098cf3c7f059b7e501b6dfc3eec88f897cb31dbdf9454252d1b6aa399e1d354888bd5e11689ec63c453c04abd075534cdc7a4d9ffbe41b5d5204cb59e3cd51305fab9ff24f123fa24fe7419b3b6adc9b1d7d7663a4cd1e92a351602976ecd2a51f5945529d363bb8df8cf5493b279824d6b2a9db' \
--data '{
    "user": "620dfb8b6f09250029dc73cf",
    "completed": true,
    "completedAt": "17.02.2022"
}'
200 OK
Example Response
json
{
  "response": {
    "completed": true,
    "pomodoros": 0,
    "completedAt": "17.02.2022",
    "_id": "620dfb9b6f09250029dc73dd",
    "description": "Second to do",
    "user": "620dfb8b6f09250029dc73cf",
    "createdAt": "2022-02-17T07:39:07.785Z",
    "__v": 0
  },
  "success": true
}
Server

Cowboy

Connection

keep-alive

X-Powered-By

Express

Access-Control-Allow-Origin

*

Content-Type

application/json; charset=utf-8

Content-Length

230

Etag

W/"e6-ALU6BUVf6TOQfehqov4LF85+c1A"

Date

Thu, 17 Feb 2022 09:07:04 GMT

Via

1.1 vegur

PATCHhttps://final-project-pomodoro-api.herokuapp.com/tasks/:taskId/update

http://localhost:8080/tasks/61fd058222e0ee221840282b/update

PATCH update task description

HEADERS
Authorization

91aa3f5e65d23c567d78bcdc9769d3858eed711001a41a4d613c2ffc0d53fd6ab27b73cedf43a936319ec83581c26fdddb6865ce665f40997727669e09801c5ec85bb3489cbf342140cb19b94d6a5697d37f8ac7d8d33fa91600752b14708ba651f351b3a07df61c8c4b909ec38ad9195bf054dad593907b1c5865ca97b63b5d

Bodyraw (json)
json
{
    "description": "neue Aufgabe",
    "user": "61eaa3e6035bc32e08a1bfe1"
}
Example Request
curl
curl --location --request PATCH 'https://final-project-pomodoro-api.herokuapp.com/tasks/620e01876f09250029dc740d/update' \
--header 'Authorization: 8bcc7cf920923f08659e64bc098cf3c7f059b7e501b6dfc3eec88f897cb31dbdf9454252d1b6aa399e1d354888bd5e11689ec63c453c04abd075534cdc7a4d9ffbe41b5d5204cb59e3cd51305fab9ff24f123fa24fe7419b3b6adc9b1d7d7663a4cd1e92a351602976ecd2a51f5945529d363bb8df8cf5493b279824d6b2a9db' \
--data '{
    "description": "updated task",
    "user": "620dfb8b6f09250029dc73cf"
}'
200 OK
Example Response
json
{
  "response": {
    "completed": false,
    "pomodoros": 0,
    "completedAt": null,
    "_id": "620e01876f09250029dc740d",
    "description": "updated task",
    "user": "620dfb8b6f09250029dc73cf",
    "createdAt": "2022-02-17T08:04:23.053Z",
    "__v": 0
  },
  "success": true
}
Server

Cowboy

Connection

keep-alive

X-Powered-By

Express

Access-Control-Allow-Origin

*

Content-Type

application/json; charset=utf-8

Content-Length

223

Etag

W/"df-dnYQJjPQS8/DJk0f6ld0m5JCNkU"

Date

Thu, 17 Feb 2022 08:48:18 GMT

Via

1.1 vegur