Notes API - abi-abishek/API-Development GitHub Wiki
Get a new Note
Request
POST /notes/get
Authorization: Bearer <your_access_token>
Form Data
| Attribute |
Description |
Token |
Need to provide the token which generated during the login. |
id |
Need to provide id of that particular note. |
Response
There are 3 types of responses.
| Status Code |
Description |
| 200 |
success, Notes related to that id will be displayed. |
| 403 |
unauthorized user. |
| 400 |
Bad Request Format or Not all attributes are available. |
Examples
200 OK
{
"title": "hello world"
"body": "hi hello world"
"created": "1 day ago"
}
400 Bad Request
{
"error": "Bad request"
}
Edit an existing note
Request
POST /auth/Edit
Authorization: Bearer <your_access_token>
Form Data
| Attribute |
Description |
Note_search_Term |
Need of particular Note Id (or) Title (or) Body. |
Token |
Need to provide the token which generated during the login. |
Response
There are 3 types of responses.
| Status Code |
Description |
| 200 |
User can modify the existing data. |
| 403 |
unauthorized user. |
| 400 |
Bad Request Format or Not all attributes are available. |
Examples
200 OK
{
"id": "1"
"name": "new notes"
"owner": "owner"
"created_at": "1 day ago"
"modified_at": "1 hour ago"
}
400 Bad Request
{
"error": "Bad request"
}
Delete Note
Request
POST /auth/delete
Authorization: Bearer <your_access_token>
Form Data
| Attribute |
Description |
Note_search_Term |
Need of particular Note Id (or) Title (or) Body. |
Token |
Need to provide the token which generated during the login. |
Response
There are 3 types of responses.
| Status Code |
Description |
| 200 |
User can delete the existing data. |
| 403 |
unauthorized user. |
| 400 |
Bad Request Format. |
Examples
200 OK
{
"message": "success"
}
400 Bad Request
{
"error": "Bad request"
}
Get all notes
Request
POST /auth/get
Authorization: Bearer <your_access_token>
Form Data
| Attribute |
Description |
Note_search_Term |
Need of particular Note Id (or) Title (or) Body. |
Token |
Need to provide the token which generated during the login. |
Response
There are 3 types of responses.
| Status Code |
Description |
| 200 |
User can get all the notes in a page. |
| 403 |
unauthorized user. |
| 400 |
Bad Request Format or Not all attributes are available. |
Examples
200 OK
{
id": "9",
"title": "Dummy note 1",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin quis convallis erat. Aenean
posuere condimentum efficitur.",
"created": "4 minutes ago",
"updated": "4 minutes ago"
}
{
id": "10",
"title": "Dummy note 2",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin quis convallis erat. Aenean
posuere condimentum efficitur.",
"created": "3 minutes ago",
"updated": "3 minutes ago"
}
400 Bad Request
{
"error": "Bad request"
}