api server for note application client web https://github.com/wiklapandu/-client-note-app.git
- Authorization
- Note
- get all note by author id
- get detail note
- create note
- update note
- delete note
POST
/auth/login
(authorize user and return token)
name |
type |
data type |
description |
username |
required |
string |
username of user |
password |
required |
string |
password of user |
http code |
content-type |
response |
200 |
application/json |
{"status":"success","message":"Welcome back", "token": "AUTHORIZATION_TOKEN"} |
400 |
application/json |
{"status":"unauthorized","message":"ERROR_MESSAGE"} |
POST
/auth/register
(register user)
Name |
Type |
Data Type |
Description |
username |
required |
string |
username of user |
email |
email, required |
string |
email of user |
password |
password, required |
string |
password of user |
http code |
content-type |
response |
201 |
application/json |
{"status":"success","message":"success register user", "data": <User>[]} |
400 |
application/json |
{"status":"failed","message":"Failed Register user", "error": error} |
GET
/note
(Get all notes by author id)
Headers
Name |
Type |
Data Type |
Description |
Authorization |
required |
string |
we can get the token from endpoint login |
Name |
Type |
Data Type |
Description |
status |
N/A |
string |
status of note |
search |
N/A |
string |
for search note by title, and content |
http code |
content-type |
response |
201 |
application/json |
{"status":"Success","data": <Note>[]} |
GET
/note/:id
(get detail of note by id)
Headers
Name |
Type |
Data Type |
Description |
Authorization |
required |
string |
we can get the token from endpoint login |
Name |
Type |
Data Type |
Description |
id |
required, uuid |
string |
id of note |
http code |
content-type |
response |
201 |
application/json |
{"status":"success","data": <Note>} |
400 |
application/json |
{"status":"failed","message":"Failed error","error":error} |
POST
/note
(store note)
Headers
Name |
Type |
Data Type |
Description |
Authorization |
required |
string |
we can get the token from endpoint login |
Name |
Type |
Data Type |
Description |
title |
required |
string |
title of note |
content |
required |
string |
content of note |
color |
required |
string |
color of note |
status |
required |
string |
status of note |
http code |
content-type |
response |
201 |
application/json |
{"status":"success","message":"created note","note": <Note>} |
400 |
application/json |
{"status":"failed","message":"Failed error","error":error} |
PUT
/note/:id
(store note)
Headers
Name |
Type |
Data Type |
Description |
Authorization |
required |
string |
we can get the token from endpoint login |
Name |
Type |
Data Type |
Description |
id |
required, uuid |
string |
id of note |
Name |
Type |
Data Type |
Description |
title |
required |
string |
title of note |
content |
required |
string |
content of note |
color |
required |
string |
color of note |
status |
required |
string |
status of note |
http code |
content-type |
response |
201 |
application/json |
{"status":"success","message":"success update note"} |
400 |
application/json |
{"status":"failed","message":"Failed update error","error":error} |