Skip to main content

employees

info

employees manager

All APIs endpoints

[POST]/users/employees

[GET]/users/employees

[GET]/users/employees/:id

[PUT]/users/employees:id

Create a employee

Parameter

  • email: required
    • Type: string
    • Validate: email input must be valid
  • first_name: required
    • Type: string
  • last_name: required
    • Type: string
  • phone: optional
    • Type: string
  • label_ids: optional
    • Type: string[]
    • description: a list of labels id to manage customer
  • address: optional
    • type address[]
    • description: a list of user's address
    • property
      • category: "Home" | "Office" | "Other"
      • location: object
        • name: string
        • geo: number[]

Request

curl --location --request POST 'https://api-v1-stg.lumyri.com/users/employees' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"address": [
{
"category": "home",
"location": {
"name": "Hoang Ngoc Building",
"geo": [
21.029942,
105.7828973,
17
]
}
}
],
"avatar": "",
"email": "employee1212@example.com",
"first_name": "employee"
"last_name": "first",
"label_ids": [
"b9a8f981-44e9-424c-89b5-79cde82a5fad"
],
"phone": "+123456589022"
}'

Response

{
"error": null,
"data": {
"message": "OK"
}
}

Get list of employees

Parameter

  • limit: optional
    • description: limit number of customer per page for pagination
    • default: 10
  • page: optional
    • description:current page for pagination
    • default: 1
  • order_by: optional
    • description: sort by name or description by ASC/DECS
    • default: asc

Request

curl --location --request GET 'https://api-v1-stg.lumyri.com/users/employees?limit=5&page=1&order_by=asc'
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response

{
"total": 20,
"per_page": 2,
"current_page": 1,
"last_page": 10,
"data": [
{
"id": "04c10c92-0000-4edf-a08a-7253ebd3459c",
"first_name": "employee_2",
"last_name": "2",
"phone": "+423000034243",
"email": "employee_2@example.com",
"address": "string",
"avatar": "string",
"lables": [
{
"id": "f69e2923-1a85-4d28-8a05-d2e9ec684b61",
"name": "label1",
"color": "gray"
},
{
"id": "dde1ef11-4b91-4fed-a401-b800e1450fd4",
"name": "label2",
"color": "blue"
}
]
},
{
"id": "04c10c92-0000-5622-a08a-7253ebd3459c",
"first_name": "employee_12",
"last_name": "2",
"phone": "+4200001834243",
"email": "employee_12@example.com",
"address": "string",
"avatar": "string",
"lables": null
}
]
}

Get employee detail

Request

curl --location -g --request GET 'https://api-v1-stg.lumyri.com/employees/04c10c92-0000-4edf-a08a-7253ebd3459c'
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response

{
"id": "04c10c92-0000-4edf-a08a-7253ebd3459c",
"first_name": "employee_2",
"last_name": "2",
"phone": "+423000034243",
"email": "employee_2@example.com",
"address": "string",
"avatar": "string",
"lables": [
{
"id": "f69e2923-1a85-4d28-8a05-d2e9ec684b61",
"name": "label1",
"color": "gray"
},
{
"id": "dde1ef11-4b91-4fed-a401-b800e1450fd4",
"name": "label2",
"color": "blue"
}
]
}

Update employee

  • email: optional
  • first_name: optional
  • last_name: optional
  • phone: optional
  • label_ids: optional
  • address: optional
    • property
      • category: "Home" | "Office" | "Other"
      • location: object
        • name: string
        • geo: number[]

Request

curl --location -g --request PUT 'https://api-v1-stg.lumyri.com/employees/{{employee-id}}' \
--data-raw '{
"first_name": "employee_1",
"last_name": "updated",
"phone": "+34300000235",
"email": "employee_1@example.com",
"address": "string",
"avatar": "string"
}'

Response

{
"message": "OK"
}