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",
      "note": null,
      "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",
      "note": "Comment made on highlight",
      "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): URL of page where highlight is made (required)
  • title (String): Title of page where highlight is made (required)
  • text (String): The highlighted text (required)
  • color (String): Color of the highlight (optional)
  • tweet (Boolean): Indicates if highlight is a tweet (optional)
  • extra (Object): Key-value pairs of extra highlight details (optional)
  • note (String): Note text taken for the highlight (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 (required)
  • text (String): The highlighted text (required)
  • color (String): The color of highlighted text (required)
  • extra (Object): Key-value pairs of extra highlight details (optional)
  • note (String or null): Note text taken for the highlight (optional); to remove an existing note text, explicitly pass in null or an empty '' string

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
}