Beaver Notes
  • 🏠Hub
  • User Guides
    • πŸš€Installation
    • πŸ“”Getting Around
    • βœ’οΈMarkdown syntax
    • 🏷️Labels
    • πŸ”’Security
    • πŸ”„Set up the Sync
  • Dev Guides
    • πŸ’¬How to contribute
    • πŸ› οΈSetup Your Environment
    • πŸ—οΈBuilding and Testing Beaver Notes
    • πŸ“¦Packaging the app
    • πŸ’»Beaver Integrations - DATA API
    • 🌎Translations
    • πŸ—ΊοΈTranslate Beaver (Legacy)
Powered by GitBook
On this page
  • Auth
  • Request Authentication
  • Verify Authentication
  • Notes Management
  • Add Note
  • Delete Note
  • Add Label to Note
  1. Dev Guides

Beaver Integrations - DATA API

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.

Auth

Request Authentication

Endpoint: POST /request-auth

Description: Sends an authentication request to the renderer process in Electron.

Request:

  • Headers: Content-Type: application/json

  • Body:

    {
      "platform": "your-platform",
      "id": "your-id"
    }

Example curl Command:

curl --location 'http://localhost:3000/request-auth' \
--header 'Content-Type: application/json' \
--data '{
    "platform": "your-platform",
    "id": "your-id"
}'

Verify Authentication

Endpoint: GET /confirm-auth

Description: Verifies the authentication token.

Request:

  • Headers:

    • Authorization: Bearer your-token

    • Content-Type: application/json

Example curl Command:

curl --location --request GET 'http://localhost:3000/confirm-auth' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
    "platform": "your-platform",
    "id": "your-id"
}' 

Notes Management

Add Note

Endpoint: POST /add-note

Description: Adds a new note and broadcasts it to all connected clients.

Request:

  • Headers:

    • Authorization: Bearer your-token

    • Content-Type: application/json

  • Body:

    {
      "title": "Sample Note",
      "content": "This is a sample note content."
    }

Example curl Command:

curl --location 'http://localhost:3000/add-note' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
    "title": "Sample Note",
    "content": "This is a sample note content."
}'

Delete Note

Endpoint: POST /delete-note

Description: Deletes a note and broadcasts the deletion to all connected clients.

Request:

  • Headers:

    • Authorization: Bearer your-token

    • Content-Type: application/json

  • Body:

    {
      "id": "note-id"
    }

Example curl Command:

curl --location 'http://localhost:3000/delete-note' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
    "id": "note-id"
}'

Add Label to Note

Endpoint: POST /add-label

Description: Adds a label to a note and broadcasts the update to all connected clients.

Request:

  • Headers:

    • Authorization: Bearer your-token

    • Content-Type: application/json

  • Body:

    {
      "id": "note-id",
      "labelId": "label-id"
    }

Example curl Command:

curl --location 'http://localhost:3000/add-label' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--data '{
    "id": "note-id",
    "labelId": "label-id"
}'
PreviousPackaging the appNextTranslations

Last updated 11 months ago

πŸ’»