Skip to content

Fetch all collections

get/api/collections
Returns all collections.

Request

Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.Example: Authorization: Bearer <token>

Response

Schema: application/json
codestring
dataICollectionModel[]
messagestring
ICollectionModel
ts
export interface ICollectionModel {
  id: number
  author_id: number
  name: string
  icon: string
  created_at: Date

  author?: IUserModel
  bookmarks?: IBookmarkModel[]
}
export interface ICollectionModel {
  id: number
  author_id: number
  name: string
  icon: string
  created_at: Date

  author?: IUserModel
  bookmarks?: IBookmarkModel[]
}

Body application/json

json
// SUCCESS

{
  "code": "0",
  "data": [
    {
      "id": 1,
      "author_id": 1,
      "name": "Collection name",
      "icon": "icons:nuxt",
      "created_at": "2023-09-08 16:00:00"
    }
  ],
  "message": "Ok"
}
// SUCCESS

{
  "code": "0",
  "data": [
    {
      "id": 1,
      "author_id": 1,
      "name": "Collection name",
      "icon": "icons:nuxt",
      "created_at": "2023-09-08 16:00:00"
    }
  ],
  "message": "Ok"
}