Documentation

Deputy

Example Javascript code for importing data from Deputy

You can use Import Scripts to import data from your Deputy account directly into an Equals workbook.

Create a Deputy Access Token

Follow the instructions here to create a Deputy access token.

Add the key to a secret group

Copy the access token from the prior step. Then create a new secret group and paste the key into a new secret named deputy_api_key.

Example code

Once you've completed the prior steps, create a new workbook, add a new import script to a sheet and copy + paste the script below. Once pasted select your secret group in the toolbar (make sure the key in the secret group is called deputy_api_key).

Note that you'll want to change the URL below to reflect your Deputy information. For example, https://simonssambos.au.deputy.com is an installation called simonssambos and is present in the Australian geographic region. There are four possible regions for a Deputy installation currently:

  • AU (Australia)
  • EU (Europe)
  • UK (United Kingdom)
  • US (United States)

More details can be found on the Deputy API page here or by contacting their API support team.

const equals = require("equals");
var axios = require('axios');

const apiKey = equals.getSecret("deputy_api_key");

var config = {
 method: 'get',
 url: 'https://simonsambos.au.deputy.com/api/v1/supervise/employee',
 headers: { 
    'Authorization': 'Bearer ${apiKey}'
  }
};

const response = await axios(config)
equals.addRows(response.data)