API

Notes and Tags

  • Create / Update notes
  • Retrieve a note
  • Retrieve a list of notes
  • Delete a note
  • Retrieve tags

Create / Update Notes

Description

Creates or updates one or more notes for the current user

URL

/api/v1/note/

HTTP Method

POST

Path Parameters

None

Query Parameters

  • append (String): set this to true to enable append mode (optional). Default is false.
  • notify (String): set this to false to disable notifying other users who have access to the collections the notes are added to (optional). Default is true.
# Example: this will enable append mode
/api/v1/note/?append=true

Data Parameters

See JSON schema/example below

[
  {"url": String, "title": String, "note": String, "book_ids": Array},
  {
    "url": String,
    "title": String,
    "note": String,
    "book_ids": Array,
    "attrs": Object
  },
  ...
]

Notes: - url, book_ids, and attrs are optional. - If attrs is passed, it must be a non-empty Object containing key-value elements.

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": {
    "item_id": "8wa15ojc"
  },
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}

Retrieve a Note

Description

Retreives the note that a user has added for a given URL

URL

/api/v1/note/

HTTP Method

GET

Path Parameters

None

Query Parameters

  • url (String): the URL associated with the note to be retrieved (required)

Data Parameters

None

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": {
    "item_id": "d78gn65y",
    "note": "Note text 1",
    "url": "http://www.example.com/page1",
    "title": "Title 1",
    "tags": [
      "tag1" ,
      "tag2"
    ],
    "highlights": [
      "Important content 1",
      "Important content 2"
    ],
    "access": "private",
    "attrs": {
      "field1": "value1",
      "field2": "value2",
      "field3": "value3"
    },
    "created": "2021-02-27T03:06:33.804000Z",
    "modified": "2021-09-18T11:12:53.477872Z"
  },
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}

Note: attrs can be an empty object {}.

Retrieve a List of Notes

Description

Retreives all notes of a user

URL

api/v1/note/

HTTP Method

GET

Path Parameters

None

Query Parameters

None (except for pagination parameters)

Data Parameters

None

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": [
    {
      "item_id": "d78gn65y",
      "note": "Note text 1",
      "url": "http://www.example.com/page1",
      "title": "Title 1",
      "tags": [
        "tag1" ,
        "tag2"
      ],
      "highlights": [
        "Important content 1",
        "Important content 2"
      ],
      "created": "2021-02-27T03:06:33.804000Z",
      "modified": "2021-09-18T11:12:53.477872Z"
    },
    {
      "item_id": "5a9u6839",
      "note": "",
      "url": null,
      "title": "Title 2",
      "tags": [],
      "highlights": [],
      "created": "2021-02-27T03:06:33.804000Z",
      "modified": "2021-09-18T11:12:53.477872Z"
    },
    ...
  ],
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200,
  "count": 1251,
  "next": "https://histre.com/api/v1/note/?page=2",
  "previous": null
}

Delete a Note

Description

Deletes a note permanently from current user's account

URL

/api/v1/note/

HTTP Method

DELETE

Path Parameters

None

Query Parameters

None

Data Parameters

  • note_id (String): ID of note to delete (required)

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": null,
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}

Retrieve Tags

Description

Retrieves all tags saved by current user

URL

/api/v1/tag/

HTTP Method

GET

Path Parameters

None

Query Parameters

None

Data Parameters

None

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example::
{
  "data": [
    {
      "value": "arithmetic"
    },
    {
      "value": "chemistry"
    },
    {
      "value": "constants"
    },
    ...
  ],
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}