Skip to content

Fetch profile of current user

get/api/user/profile
Returns user profile for the current logged-in user.

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
dataIUserModel
messagestring
IUserModel
ts
export interface IUserModel {
  id: number
  username: string
  password: string
  fullname: string | null
  avatar: string | null
  is_admin: boolean
  created_at: Date

  bookmarks?: IBookmarkModel[]
  collections?: ICollectionModel[]
  tags?: ITagModel[]
}
export interface IUserModel {
  id: number
  username: string
  password: string
  fullname: string | null
  avatar: string | null
  is_admin: boolean
  created_at: Date

  bookmarks?: IBookmarkModel[]
  collections?: ICollectionModel[]
  tags?: ITagModel[]
}

Body application/json

json
{
  "code": "0",
  "data": {
    "id": 1,
    "username": "Username",
    "fullname": "Fullname",
    "avatar": "/avatars/user-1.png",
    "is_admin": false,
    "created_at": "2023-09-08 16:00:00"
  },
  "message": "Ok"
}
{
  "code": "0",
  "data": {
    "id": 1,
    "username": "Username",
    "fullname": "Fullname",
    "avatar": "/avatars/user-1.png",
    "is_admin": false,
    "created_at": "2023-09-08 16:00:00"
  },
  "message": "Ok"
}