Contains ALL routes for user authentication (register, login, reset password, etc).
Generate password token & send a reset URL email to the email address if valid.
Endpoint:
Method: POST
Type: RAW (JSON)
URL: https://json-node-api.herokuapp.com/api/v1/auth/forgotPassword/
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Content Type |
Body:
{
"email": "john@example.com"
}
Get the details of the current logged in user. This can be helpful when user details are required in a Front-End with any CRUD action.
Endpoint:
Method: GET
URL: https://json-node-api.herokuapp.com/api/v1/auth/me/
Validates the credentials passed in. Returns a JWT token & cookie.
Endpoint:
Method: POST
Type: RAW (JSON)
URL: https://json-node-api.herokuapp.com/api/v1/auth/login/
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Content Type |
Body:
{
"email": "john@example.com",
"password": "Qwert0"
}
Clears out token cookie.
Endpoint:
Method: GET
URL: https://json-node-api.herokuapp.com/api/v1/auth/logout/
Creates a user if account with email address sent is non-existing. Returns a JWT token & cookie.
Endpoint:
Method: POST
Type: RAW (JSON)
URL: https://json-node-api.herokuapp.com/api/v1/auth/register/
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Content Type |
Body:
{
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"password": "Qwert0"
}
Checks if the reset token sent is valid & updates the validated password respectively.
Endpoint:
Method: PUT
Type: RAW (JSON)
URL: https://json-node-api.herokuapp.com/api/v1/auth/resetPassword/8a9f8b89881ad27f0cb0150f2ede3ef15115fc25
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Content Type |
Body:
{
"password": "Qwert0"
}
Books CRUD functionality. This includes routes for
- Getting all books
- Getting a single book
- Adding a book
- Updating a book
- Deleting a book
Endpoint:
Method: POST
Type: RAW (JSON)
URL: https://json-node-api.herokuapp.com/api/v1/books/
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Content Type |
Body:
{
"title": "The Debugger",
"price": 10.99,
"author": "Omezibe Obioha",
"datePublished": "06-09-2021",
"pages": 153,
"publisher": "Diamonds Books 💎",
"description": "This book talks about the \"adventures\" of the author in his programming journey so far: the good, bad, and ugly.",
"isbn": "9876543210"
}
Endpoint:
Method: DELETE
URL: https://json-node-api.herokuapp.com/api/v1/books/e297d1d4-8050-4368-85c2-75aa7e8c5c04/
Endpoint:
Method: GET
URL: https://json-node-api.herokuapp.com/api/v1/books/e297d1d4-8050-4368-85c2-75aa7e8c5c05/
Endpoint:
Method: GET
URL: https://json-node-api.herokuapp.com/api/v1/books/
Query Params:
Key | Value | Description |
---|---|---|
select | title,author,price,isbn | Allows you to select the fields you want the API to send. By default, ALL fields are sent. Also, the "id" field can't be deselected. |
limit | 5 | Sets the number of records the APi sends per request. The default value is 5. |
page | 1 | Allows to navigate to a "page" to get the next or previous set of records as required. The default value is 1. |
Endpoint:
Method: PUT
Type: RAW (JSON)
URL: https://json-node-api.herokuapp.com/api/v1/books/e297d1d4-8050-4368-85c2-75aa7e8c5c05/
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Content Type |
Body:
{
"title": "Purple Hibiscus (Revised Edition)"
}
Made with ♥ by Omzi