API

Highlights

  • Retrieve page highlights
  • Save page highlights
  • Update a highlight
  • Delete highlight

Retrieve Page Highlights

Description

Retrieves all highlights of a given URL, or a single highlight if highlight_id is passed

URL

/api/v1/highlight/

HTTP Method

GET

Path Parameters

None

Query Parameters

Either of the following should be provided as a query parameter:

  • url (String): URL of page for which the highlights are retrieved
  • highlight_id (String): Unique indentifier for a highlight

Data Parameters

None

Request Headers

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

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": [
    {
      "item_id": 83,
      "text": "This is the most important sentence",
      "color": "green",
      "created": "2021-09-18T11:12:53.501465Z",
      "modified": "2021-09-18T11:12:53.501509Z"
    },
    {
      "item_id": 83,
      "text": "Learn to highlight with this one weird trick",
      "color": "purple",
      "created": "2021-09-18T11:12:53.501465Z",
      "modified": "2021-09-18T11:12:53.501509Z"
    }
  ],
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}

Save Page Highlights

Description

Saves all highlights currently indicated on page

URL

/api/v1/highlight/

HTTP Method

POST

Path Parameters

None

Query Parameters

None

Data Parameters

  • url (String): required
  • title (String): required
  • text (String): required
  • color (String): optional
  • tweet (Boolean): optional
  • extra (Object): optional

Request Headers

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

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": {
    "highlight_id": "694lcs4u",
    "highlight_link": "https://histre.com/highlights/user0001/694lcs4u/"
  },
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}

Update a Highlight

Description

Updates the text and/or extra details of a highlight

URL

/api/v1/highlight/

HTTP Method

PATCH

Path Parameters

None

Query Parameters

None

Data Parameters

  • highlight_id (String): ID of the highlight to update
  • text (String): The highlighted text
  • color (String): The color of highlighted text
  • extra (Object): Key-value pairs of extra highlight details (optional)

Request Headers

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

Response

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

Delete Highlight

Description

Deletes given note highlight

URL

/api/v1/highlight/

HTTP Method

DELETE

Path Parameters

None

Query Parameters

None

Data Parameters

  • highlight_id (String): ID of the highlight to delete

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
}