Get employees by service

This endpoint retrieves information about all employees who have an active service association across the different products of a service.

GET /api/v2/businesses/{businessId}/services/{serviceId}/employees

If the data included in the request is correct —both businessId and serviceId—, the response will contain the list of employees in the service with all the defined information for them:

  • Example 1

  • Example 2

[
    {
        "name": "Theodore",
        "surname": "Hayes",
        "email": "theohayes@bsn.com",
        "birthday": "1989-09-10",
        "employeeId": "209_14",
        "virtual": false
    },
    {
        "name": "Melanie",
        "surname": "Jenkins",
        "employeeId": "555",
        "virtual": false
    },
    {
        "name": "Andrea",
        "surname": "Meyer",
        "employeeId": "444",
        "virtual": false
    },
    {
        "name": "Mariane",
        "surname": "Ortega Acevedo",
        "birthday": "2004-01-02",
        "employeeId": "1006350",
        "virtual": false
    }
]
[
    {
        "name": "ARIANA",
        "surname": "VISMARA",
        "group": "Responsible",
        "employeeId": "1493432",
        "metadata": {
            "language": "english"
        },
        "virtual": false
    },
    {
        "name": "CLARA",
        "surname": "SANDERS",
        "group": "Merchandising",
        "employeeId": "5690921",
        "metadata": {
            "or": "WOMAN"
        },
        "virtual": false
    },
    {
        "name": "MAYA",
        "surname": "SANTORO",
        "group": "General",
        "employeeId": "9454863",
        "virtual": false
    }
]

As shown in the examples, the request will return the defined information for each of the employees in the service. Thus, those non-mandatory fields whose information has not been defined in Orquest will not appear in the response. In the same way, metadata will only appear in businesses that have previously configured this information for their employees.

Considerations

If the service indicated in the URL does not exist in the business, the request will return a 404 Not Found error, specifying not exits in the message.

If there are no employees in the indicated service, or the employees don’t have active service associations, the request will return an empty array [].

Even if metadata is defined at the business level, only those metadata with an assigned value will be included in the response. In other words, if a metadata field does not have a defined value for an employee, that field will not appear in the response for that employee.