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

Latest commit

 

History

History
113 lines (74 loc) · 3.23 KB

EmployeesApi.md

File metadata and controls

113 lines (74 loc) · 3.23 KB

SquareConnect.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(opts)

ListEmployees

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.EmployeesApi();

var opts = { 
  'locationId': "locationId_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, // Number | The number of employees to be returned on each page.
  'cursor': "cursor_example" // String | The token required to retrieve the specified page of results.
};
apiInstance.listEmployees(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

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 Number 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

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.EmployeesApi();

var id = "id_example"; // String | UUID for the employee that was requested.

apiInstance.retrieveEmployee(id).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

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