REST API Documentation - Shanfang/SmartNote GitHub Wiki
- Get Notes
- Generate URL Notes
- Add Markdown Notes
- Delete Notes
- Modify Notes
- View Notes
- Add tag
- Check Archived Notes (Classification)
- Search Notes
serverURL:serverPort/api/allNotes
Method: GET
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note is saved | Date |
sourceLink | URL where the note is generated from | String |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note tag is empty."
}
{
"message": "Unauthorized user."
}
{
"title": ""How To Start a Blog in 2017",
"content":"This is content!!!",
"date":"2017-11-07T00:43:21.919Z",
"sourceLink":"https://www.bloggingbasics101.com/how-do-i-start-a-blog/",
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
"id": "ObjectId"
}
serverURL:serverPort/api/generateNote
Method: POST
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note is saved | Date |
sourceLink | URL where the note is generated from | String |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note tag is empty."
}
{
"message": "Unauthorized user."
}
{
"title": ""How To Start a Blog in 2017",
"content":"This is content!!!",
"date":"2017-11-07T00:43:21.919Z",
"sourceLink":"https://www.bloggingbasics101.com/how-do-i-start-a-blog/",
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
"id": "ObjectId"
}
serverURL:serverPort/api/addNote
Method: POST
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note saved | Date |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note tag is empty."
}
{
"message": "Unauthorized user."
}
{
"title": ""How To Start a Blog in 2017",
"content":"This is content!!!",
"date":"2017-11-07T00:43:21.919Z",
"sourceLink":"https://www.bloggingbasics101.com/how-do-i-start-a-blog/",
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
"id": "ObjectId"
}
serverURL:serverPort/api/deleteNote
Method: POST
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note ID is empty."
}
{
"message": "Unauthorized user."
}
{
"username": "software",
"id": "ObjectId("5a010228a61a9116f300fa08")"
}
serverURL:serverPort/api/modify
Method: POST
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note is saved | Date |
sourceLink | URL where the note is generated from | String |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note tag is empty."
}
{
"message": "Unauthorized user."
}
{
"title": ""How To Start a Blog in 2017",
"content":"This is content!!!",
"date":"2017-11-07T00:43:21.919Z",
"sourceLink":"https://www.bloggingbasics101.com/how-do-i-start-a-blog/",
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
"id": "ObjectId"
}
serverURL:serverPort/api/viewnote
Method: GET
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note is saved | Date |
sourceLink | URL where the note is generated from | String |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note ID is empty."
}
{
"message": "Unauthorized user."
}
{
"title": ""How To Start a Blog in 2017",
"content":"This is content!!!",
"date":"2017-11-07T00:43:21.919Z",
"sourceLink":"https://www.bloggingbasics101.com/how-do-i-start-a-blog/",
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
"id": "ObjectId"
}
serverURL:serverPort/api/addtag
Method: POST
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
tag | Tag of the note | Array |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note tag is empty."
}
{
"message": "Unauthorized user."
}
{
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
}
serverURL:serverPort/api/archive
Method: POST
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note is saved | Date |
sourceLink | URL where the note is generated from | String |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note tag is empty."
}
{
"message": "Unauthorized user."
}
{
"title": ""How To Start a Blog in 2017",
"content":"This is content!!!",
"date":"2017-11-07T00:43:21.919Z",
"sourceLink":"https://www.bloggingbasics101.com/how-do-i-start-a-blog/",
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
"id": "ObjectId"
}
serverURL:serverPort/api/search
Method: POST
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note is saved | Date |
sourceLink | URL where the note is generated from | String |
id | ID of the note | ObjectId |
Status Code: 500, 401, 200
If an error occurs in the database process, return error code 500.
If an unauthorized user is detected, return code 401.
If getting info successfully, return code 200.
{
"message": "Note tag is empty."
}
{
"message": "Unauthorized user."
}
{
"title": ""How To Start a Blog in 2017",
"content":"This is content!!!",
"date":"2017-11-07T00:43:21.919Z",
"sourceLink":"https://www.bloggingbasics101.com/how-do-i-start-a-blog/",
"user_name":"software",
"tag": [
{
"user_name":"software",
"name":"angular"
}
],
"id": "ObjectId"
}