Skip to content

Fetch all bookmarks

get/api/bookmarks/[:id]
Returns all bookmarks for a Collection. If the [:id] parameter is passed, returns all bookmarks for the given Collection ID.

Request

Router Params

idnumber
required
ID of the collection.
Default:
undefined

Query Strings

searchstring
The search query string. You can search using the bookmark name or url.
pagenumber
The page number from which you want your page search results to be displayed.
Default:
1
per_pagenumber
Number of results per page.
Default:
20

Response

Schema: application/json
codestring
dataIBookmarkModel[]
messagestring
IBookmarkModel
ts
export interface IBookmarkModel {
  id: number
  author_id: number
  collection_id: number
  name: string
  url: string
  description: string
  icon: string
  created_at: Date

  author?: IUserModel
  collection?: ICollectionModel
  tags?: ITagModel[]
}
export interface IBookmarkModel {
  id: number
  author_id: number
  collection_id: number
  name: string
  url: string
  description: string
  icon: string
  created_at: Date

  author?: IUserModel
  collection?: ICollectionModel
  tags?: ITagModel[]
}

Body application/json

json
{
  "code": "0",
  "data": {
    "total": 1,
    "page": 1,
    "per_page": 20,
    "list": [
      {
        "id": 1,
        "name": "Bookmark",
        "description": "Description",
        "url": "http://www.domain.com",
        "icon": "http://www.domain.com/icon.png",
        "collection_id": 1,
        "collection": {
          "id": 1,
          "name": "Collection name"
        },
        "author_id": 1,
        "author": {
          "id": 1,
          "username": "Username",
          "fullname": "Fullname"
        },
        "tags": [
          {
            "id": 1,
            "name": "Tag 1"
          }
        ],
        "created_at": "2023-09-08 16:00:00"
      }
    ]
  },
  "message": "Ok"
}
{
  "code": "0",
  "data": {
    "total": 1,
    "page": 1,
    "per_page": 20,
    "list": [
      {
        "id": 1,
        "name": "Bookmark",
        "description": "Description",
        "url": "http://www.domain.com",
        "icon": "http://www.domain.com/icon.png",
        "collection_id": 1,
        "collection": {
          "id": 1,
          "name": "Collection name"
        },
        "author_id": 1,
        "author": {
          "id": 1,
          "username": "Username",
          "fullname": "Fullname"
        },
        "tags": [
          {
            "id": 1,
            "name": "Tag 1"
          }
        ],
        "created_at": "2023-09-08 16:00:00"
      }
    ]
  },
  "message": "Ok"
}