Skip to main content

Get User

Description

Retrieve a specific user by ID.

Authentication

  • Required: Yes
  • Roles: Any authenticated user

Request

Headers

GET /v1/customer/user/:id
Authorization: Bearer <token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
idnumberYesUser ID

Response

Success Response (200)

{
"data": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"username": "johndoe",
"email": "john@example.com",
"phoneNumber": "0123456789",
"description": "User description",
"roleId": 1,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
}

Error Responses

Error Codes

  • E010_BAD_RESOURCE_NOT_EXISTS: User not found

Example Usage

curl -X GET https://api.stepx.io.vn/v1/customer/user/1 \
-H "Authorization: Bearer <token>"
const response = await fetch('https://api.stepx.io.vn/v1/customer/user/1', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});

const data = await response.json();