Skip to content

Fetch details of a collection

get/api/collection/:id
Returns a collection details for the given collection ID.

Request

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

Router Params

idnumber
required
ID of the collection.

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"
}
json
// COLLECTION_NOT_FOUND

{
  "code": "301",
  "message": "Collection not found"
}
// COLLECTION_NOT_FOUND

{
  "code": "301",
  "message": "Collection not found"
}