|
| 1 | +# API Reference |
| 2 | + |
| 3 | +This directory provides detailed documentation of each endpoint in the NavigoLearn API. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +For each endpoint, we provide the following details: |
| 10 | + |
| 11 | +- The HTTP method (GET, POST, PUT, DELETE) |
| 12 | +- Endpoint URL |
| 13 | +- Required parameters in the request |
| 14 | +- A short description of what the endpoint does |
| 15 | +- An example request |
| 16 | +- An example response |
| 17 | + |
| 18 | +## Endpoints |
| 19 | + |
| 20 | +- /api |
| 21 | + - /api/auth |
| 22 | + - [GET /api/auth/google-login](./auth/google-login.md) |
| 23 | + - [GET /api/auth/google-callback](./auth/google-callback.md) |
| 24 | + - [GET /api/auth/github-login](./auth/github-login.md) |
| 25 | + - [GET /api/auth/github-callback](./auth/github-callback.md) |
| 26 | + - [POST /api/auth/login](./auth/login.md) |
| 27 | + - [POST /api/auth/register](./auth/register.md) |
| 28 | + - [POST /api/auth/change-password](./auth/change-password.md) |
| 29 | + - [POST /api/auth/forgot-password](./auth/forgot-password.md) (Not Implemented - Not planned) |
| 30 | + - [DELETE /api/auth/logout](./auth/logout.md) |
| 31 | + - /api/search (formerly /api/explore) |
| 32 | + - [GET /api/search/roadmaps](./search/roadmaps.md) |
| 33 | + - [GET /api/search/feeling-lucky](./search/feeling-lucky.md) |
| 34 | + - ... More to be added |
| 35 | + - /api/roadmaps |
| 36 | + - [GET /api/roadmaps/:roadmapId](./roadmaps/get-roadmap.md) |
| 37 | + - [POST /api/roadmaps/create](./roadmaps/create-roadmap.md) |
| 38 | + - /api/roadmaps/:roadmapId |
| 39 | + - **Update roadmap data** |
| 40 | + - [POST /api/roadmaps/:roadmapId/](./roadmaps/update-roadmap.md) |
| 41 | + - [POST /api/roadmaps/:roadmapId/about](./roadmaps/update-roadmap-about.md) |
| 42 | + - [POST /api/roadmaps/:roadmapId/name](./roadmaps/update-roadmap-name.md) |
| 43 | + - [POST /api/roadmaps/:roadmapId/description](./roadmaps/update-roadmap-description.md) |
| 44 | + - [POST /api/roadmaps/:roadmapId/topics](./roadmaps/update-roadmap-topic.md) |
| 45 | + - [POST /api/roadmaps/:roadmapId/draft](./roadmaps/update-roadmap-draft.md) |
| 46 | + - [POST /api/roadmaps/:roadmapId/version](./roadmaps/update-roadmap-version.md) |
| 47 | + - [POST /api/roadmaps/:roadmapId/data](./roadmaps/update-roadmap-data.md) |
| 48 | + - [POST /api/roadmaps/:roadmapId/misc-data](./roadmaps/update-roadmap-misc-data.md) |
| 49 | + - **Interact with the roadmap** |
| 50 | + - [GET /api/roadmaps/:roadmapId/like](./roadmaps/like-roadmap.md) |
| 51 | + - [GET /api/roadmaps/:roadmapId/dislike](./roadmaps/unlike-roadmap.md) |
| 52 | + - [GET /api/roadmaps/:roadmapId/progress](./roadmaps/get-roadmap-progress.md) |
| 53 | + - [POST /api/roadmaps/:roadmapId/progress](./roadmaps/update-roadmap-progress.md) |
| 54 | + - [DELETE /api/roadmaps/:roadmapId/{like,dislike}](./roadmaps/delete-roadmap-like.md) |
| 55 | + - [DELETE /api/roadmaps/:roadmapId](./roadmaps/delete-roadmap.md) |
| 56 | + - /api/users |
| 57 | + - [GET /api/users/:userId?](./users/get-user.md) |
| 58 | + - [GET /api/users/:userId/mini](./users/get-user-mini.md) |
| 59 | + - [GET /api/users/:userId/roadmaps](./users/get-user-roadmaps.md) |
| 60 | + - [GET /api/users/:userId/follow](./users/follow-user.md) |
| 61 | + - [DELETE /api/users/:userId/follow](./users/unfollow-user.md) |
| 62 | + - [POST /api/users/](./users/update-user.md) |
| 63 | + - [POST /api/users/name](./users/update-user-name.md) |
| 64 | + - [POST /api/users/profile-picture](./users/update-user-profile-picture.md) (Not Implemented - Not plan) |
| 65 | + - [POST /api/users/bio](./users/update-user-bio.md) |
| 66 | + - [POST /api/users/quote](./users/update-user-quote.md) |
| 67 | + - [POST /api/users/website-url](./users/update-user-website-url.md) |
| 68 | + - [POST /api/users/github-url](./users/update-user-github-url.md) (To be added) |
| 69 | + - [DELETE /api/users/:userId](./users/delete-user.md) |
| 70 | + |
| 71 | +## Responses |
| 72 | + |
| 73 | +All responses are in JSON format and have the keys `success` and `message`. The `success` key is a boolean that indicates whether the request was successful or not. The `message` key is a string that contains a message about the request. If the request was successful, the `message` key will contain a confirmation message. If the request was unsuccessful, the `message` key will contain an error message. |
| 74 | + |
| 75 | +Additionally, some responses will contain a `data` key. The `data` key will contain the data requested by the user. For example, if the user requests a roadmap, the `data` key will contain the roadmap data. |
| 76 | + |
| 77 | +Also, some responses will contain a `total` key. The `total` key will contain the total number of items that match the response `data` array. For example, if the user requests a list of roadmaps, the `total` key will contain the total number of roadmaps that match the request. |
| 78 | + |
| 79 | +**Each response file above contains an example response.** |
| 80 | + |
| 81 | +## Note |
| 82 | + |
| 83 | +Please note that this API reference is a work in progress and will continue to grow as new endpoints are added to the NavigoLearn API. |
| 84 | + |
| 85 | +And some might change requirements or functionality as the project evolves. |
0 commit comments