SquareConnect\EmployeesApi

November 20, 2019 · View on GitHub

All URIs are relative to https://connect.squareup.com

MethodHTTP requestDescription
listEmployeesGET /v2/employeesListEmployees
retrieveEmployeeGET /v2/employees/{id}RetrieveEmployee

listEmployees

\SquareConnect\Model\ListEmployeesResponse listEmployees(locationid,location_id, status, limit,limit, cursor)

ListEmployees

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\EmployeesApi();
$location_id = "location_id_example"; // string | Filter employees returned to only those that are associated with the specified location.
$status = "status_example"; // string | Specifies the EmployeeStatus to filter the employee by.
$limit = 56; // int | The number of employees to be returned on each page.
$cursor = "cursor_example"; // string | The token required to retrieve the specified page of results.

try {
    $result = $apiInstance->listEmployees($location_id, $status, $limit, $cursor);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmployeesApi->listEmployees: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
location_idstringFilter employees returned to only those that are associated with the specified location.[optional]
statusstringSpecifies the EmployeeStatus to filter the employee by.[optional]
limitintThe number of employees to be returned on each page.[optional]
cursorstringThe token required to retrieve the specified page of results.[optional]

Return type

\SquareConnect\Model\ListEmployeesResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveEmployee

\SquareConnect\Model\RetrieveEmployeeResponse retrieveEmployee($id)

RetrieveEmployee

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\EmployeesApi();
$id = "id_example"; // string | UUID for the employee that was requested.

try {
    $result = $apiInstance->retrieveEmployee($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmployeesApi->retrieveEmployee: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
idstringUUID for the employee that was requested.

Return type

\SquareConnect\Model\RetrieveEmployeeResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]