All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
listEmployees | GET /v2/employees | ListEmployees |
retrieveEmployee | GET /v2/employees/{id} | RetrieveEmployee |
ListEmployeesResponse listEmployees(locationId, status, limit, cursor)
ListEmployees
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.EmployeesApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
EmployeesApi apiInstance = new EmployeesApi();
String locationId = "locationId_example"; // String | Filter employees returned to only those that are associated with the specified location.
String status = "status_example"; // String | Specifies the EmployeeStatus to filter the employee by.
Integer limit = 56; // Integer | The number of employees to be returned on each page.
String cursor = "cursor_example"; // String | The token required to retrieve the specified page of results.
try {
ListEmployeesResponse result = apiInstance.listEmployees(locationId, status, limit, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EmployeesApi#listEmployees");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
locationId | String | Filter employees returned to only those that are associated with the specified location. | [optional] |
status | String | Specifies the EmployeeStatus to filter the employee by. | [optional] |
limit | Integer | The number of employees to be returned on each page. | [optional] |
cursor | String | The token required to retrieve the specified page of results. | [optional] |
- Content-Type: application/json
- Accept: application/json
RetrieveEmployeeResponse retrieveEmployee(id)
RetrieveEmployee
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.EmployeesApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
EmployeesApi apiInstance = new EmployeesApi();
String id = "id_example"; // String | UUID for the employee that was requested.
try {
RetrieveEmployeeResponse result = apiInstance.retrieveEmployee(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EmployeesApi#retrieveEmployee");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | UUID for the employee that was requested. |
- Content-Type: application/json
- Accept: application/json