Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Latest commit

 

History

History
122 lines (86 loc) · 3.8 KB

EmployeesApi.md

File metadata and controls

122 lines (86 loc) · 3.8 KB

EmployeesApi

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

Method HTTP request Description
listEmployees GET /v2/employees ListEmployees
retrieveEmployee GET /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

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]

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

Name Type Description Notes
id String UUID for the employee that was requested.

Return type

RetrieveEmployeeResponse

Authorization

oauth2

HTTP request headers

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