The DATA API in Beaver Notes enables third-party applications to interact with the platform. It provides functionalities for creating notes, deleting notes, and adding labels, allowing for efficient management and organization of information within Beaver Notes.
The Following documentation is related on how to use said API if you are looking on building a plugin for beaver notes using the Data API consider checkign out the Beaver-API-playground.
http://localhost:3000
Endpoint
POST /request-auth
Request Body
{
"id": "Your ID",
"platform": "Platform",
"auth": ["note:add", "note:delete", "label:add"]
}
Curl Example
curl --location 'http://localhost:3000/request-auth' \
--header 'Content-Type: application/json' \
--data '{
"id": "Your ID",
"platform": "Platform",
"auth": ["note:add", "note:delete", "label:add"]
}'
Response
Success: request sent!
:::info Remember that the user will ultimately be in charge of choosing what the app can and cannot do, so make sure to handle cases where one of the 3 auth options is not available. :::
Endpoint
GET /confirm-auth
Request Body
{
"id": "Your ID",
"platform": "Platform"
}
Curl Example
curl --location --request GET 'http://localhost:3000/confirm-auth' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
"platform": "Platform",
"id": "Your ID"
}'
Response
Success: passed
Endpoint
POST /add-note
Request Body
{
"id": "note.id",
"title": "Your Title",
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This is a sample note content."
}
]
}
]
},
"labels": [],
"isBookmarked": false,
"isArchived": false
}
Curl Example
curl --location 'http://localhost:3000/add-note' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
"id": "test1",
"title": "Sample Note",
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This is a sample note content."
}
]
}
]
},
"isBookmarked": false,
"isArchived": false
}'
Response
Success: Creating Note
Endpoint
POST /delete-note
Request Body
{
"id": "note-id"
}
Curl Example
curl --location 'http://localhost:3000/delete-note' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
"id": "note-id"
}'
Response
Success: Deleting Note
Endpoint
POST /add-label
Request Body
{
"id": "note-id",
"labelId": "label-content"
}
Curl Example
curl --location 'http://localhost:3000/add-label' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
"id": "note-id",
"labelId": "label-content"
}'
Response
Success: Adding Label