API

Notebooks

  • List all notebooks
  • Create new notebook
  • Retrieve notebook details
  • Update notebook details
  • Save browser tabs/windows as notebooks
  • Follow a notebook
  • Unfollow a notebook
  • Add notes to notebooks
  • Remove note from notebooks

List All Notebooks

Description

Retrieves all notebooks for current user

URL

/api/v1/notebooks/

HTTP Method

GET

Path Parameters

None

Query Parameters

Note: This endpoint returns a paginated response, please see Pagination section under Overview of this API documentation.

Data Parameters

None

Request Headers

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

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": [
    {
      "book_id": "hbjdifc5",
      "title": "Tabs at Sep 1, 2021 08:14pm",
      "description": "2 tabs from bloomberg.com, ycombinator.com",
      "slug": "tabs-at-sep-1-2021-0814pm",
      "created": "2021-09-01T12:14:38.526573Z",
      "modified": "2021-09-01T12:14:38.526595Z"
    },
    {
      "book_id": "5rj14xek",
      "title": "Vacation Ideas",
      "description": "Some links to share with my friends about our summer vacation plans",
      "slug": "vacation-2021",
      "created": "2021-09-01T12:14:02.485012Z",
      "modified": "2021-09-01T12:14:02.485033Z"
    }
  ],
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200,
  "count": 2,
  "previous": null,
  "next": "https://histre.com/api/v1/notebooks/?page=2"
}

Note: This endpoint returns a paginated response, please see Pagination section under Overview of this API documentation.

Create a New Notebook

Description

Creates a new notebook for current user

URL

/api/v1/notebooks/

HTTP Method

POST

Path Parameters

None

Query Parameters

None

Data Parameters

  • title (String): the notebook's title (required)
  • description (String): the notebook's description (optional)

Request Headers

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

Response

  • Status Code: 201
  • Content-Type: application/json
  • Schema/Example:
{
  "data": {
    "book_id": "7w84if4b",
    "title": "Notebook created from API",
    "description": "Created from calling API endpoints",
    "slug": "notebook-created-from-api"
  },
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 201
}

Retrieve Notebook Details

Description

Fetches details of notebook with given ID for current user

URL

/api/v1/notebooks/{book_id}/

HTTP Method

GET

Path Parameters

  • book_id (String): the notebook's ID (required)

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": {
    "book_id": "i1zpxqtz",
    "title": "First Public Notebook of user",
    "description": "Public notebook automatically created for user.",
    "slug": "first-public-notebook-of-user",
    "created": "2021-08-28T02:29:25.510101Z",
    "modified": "2021-08-28T02:29:25.510122Z"
  },
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}

Update Notebook Details

Description

Updates some details of a notebook with given ID

URL

/api/v1/notebooks/{book_id}/

HTTP Method

PATCH

Path Parameters

  • book_id (String): the notebook's ID (required)

Query Parameters

None

Data Parameters

One or both of the following should be provided in the request body: - title (String): the new title of the notebook - description (String): the new description of the notebook

Request Headers

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

Response

  • Status Code: 200
  • Content-Type: application/json
  • Schema/Example:
{
  "data": {
    "book_id": "7w84if4b",
    "title": "Updated by API endpoint",
    "description": "Description updated using API endpoint",
    "slug": "updated-by-api-endpoint"
  },
  "error": false,
  "errcode": 0,
  "errmsg": null,
  "status": 200
}

Delete a Notebook

Description

Deletes a notebook with the given ID

URL

/api/v1/notebooks/{book_id}/

HTTP Method

DELETE

Path Parameters

  • book_id (String): the notebook's ID (required)

Query Parameters

None

Data Parameters

None

Request Headers

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

Response

  • Status Code: 204 no content

Save Browser Tabs / Windows as Notebooks

Description

Used by browser extension to save all open browser tabs or windows as notebooks

URL

/api/v1/notebooks/save_tabs_or_windows/

HTTP Method

POST

Path Parameters

None

Query Parameters

None

Data Parameters

See JSON schema/example below

{
  "items": {
    "windowId001": [
      {"url": "https://www.google.com/", "title": "Google"},
      {"url": "https://news.ycombinator.com/", "title": "Hacker News"}
    ]
  },
  "friendly_time": "Mar 2, 2021 07:58pm"
}

Request Headers

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

Response

  • Status Code: 201
  • Content-Type: application/json
  • Schema/Example:
{"url": "https://histre.com/notebooks/h6yyd5g9/tabs-at-mar-2-2021-0758pm/"}

Follow a Notebook

Description

Lets the current user follow a public notebook of another user

URL

/api/v1/notebooks/{book_id}/follow/

HTTP Method

POST

Path Parameters

  • book_id (String): the notebook's ID (required)

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": {"total_followers": 1},
  "error": false,
  "errcode":0,
  "errmsg":null,
  "status":200
}

Unfollow a Notebook

Description

Lets the current user unfollow a notebook of another user

URL

/api/v1/notebooks/{book_id}/unfollow/

HTTP Method

POST

Path Parameters

  • book_id (String): the notebook's ID (required)

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": {"total_followers": 1},
  "error": false,
  "errcode":0,
  "errmsg":null,
  "status":200
}

Add Notes to Notebooks

Description

Adds one or more notes to one or more notebooks

URL

/api/v1/notebooks/add_notes/

HTTP Method

POST

Path Parameters

None

Query Parameters

None

Data Parameters

  • url_item_item_ids (Array): one or more URL item IDs (required)
  • book_ids (Array): one or more notebook IDs (required)

Request Headers

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

Response

  • Status Code: 204 no content

Remove Note from Notebooks

Description

Removes note (URL item) with given ID from one or more notebooks with given IDs

URL

/api/v1/notebooks/remove_note/

HTTP Method

POST

Path Parameters

None

Query Parameters

None

Data Parameters

  • url_item_item_id (String): ID of URL item to remove (required)
  • book_ids (Array): one or more notebook IDs from which the note will be removed (required, must have at least one ID)

Request Headers

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

Response

  • Status Code: 204 no content