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

ListEmployeesResponse listEmployees(locationId, status, limit, cursor)

ListEmployees

Example

// 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();
}

Parameters

NameTypeDescriptionNotes
locationIdStringFilter employees returned to only those that are associated with the specified location.[optional]
statusStringSpecifies the EmployeeStatus to filter the employee by.[optional]
limitIntegerThe number of employees to be returned on each page.[optional]
cursorStringThe token required to retrieve the specified page of results.[optional]

Return type

ListEmployeesResponse

Authorization

oauth2

HTTP request headers

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

retrieveEmployee

RetrieveEmployeeResponse retrieveEmployee(id)

RetrieveEmployee

Example

// 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();
}

Parameters

NameTypeDescriptionNotes
idStringUUID for the employee that was requested.

Return type

RetrieveEmployeeResponse

Authorization

oauth2

HTTP request headers

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