$employeesApi = $client->getEmployeesApi();
EmployeesApi
This endpoint is deprecated.
function listEmployees(
?string $locationId = null,
?string $status = null,
?int $limit = null,
?string $cursor = null
): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
locationId |
?string |
Query, Optional | - |
status |
?string(EmployeeStatus) |
Query, Optional | Specifies the EmployeeStatus to filter the employee by. |
limit |
?int |
Query, Optional | The number of employees to be returned on each page. |
cursor |
?string |
Query, Optional | The token required to retrieve the specified page of results. |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type ListEmployeesResponse
.
$apiResponse = $employeesApi->listEmployees();
if ($apiResponse->isSuccess()) {
$listEmployeesResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
This endpoint is deprecated.
function retrieveEmployee(string $id): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
id |
string |
Template, Required | UUID for the employee that was requested. |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type RetrieveEmployeeResponse
.
$id = 'id0';
$apiResponse = $employeesApi->retrieveEmployee($id);
if ($apiResponse->isSuccess()) {
$retrieveEmployeeResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());