Connectors / Service / Zenefits

Artisan IMG > Zenefits (zenefits)

Zenefits

Zenefits offers cloud-based software as a service to companies for managing their human resources, with a particular focus on helping them with health insurance coverage.

Overview

Zenefits is a service connector, has all the HR tools that make managing your people easy, from streamlined onboarding and easy PTO tracking to org charts, performance reviews, and so much more.

Authentication

When using the Zenefits connector, the first thing you will need to do is go to your Tray.io account page, and select the workflow you wish to work on. Once in the workflow builder itself, search and drag the Zenefits connector from the connectors panel (on the left hand side) onto your workflow.

With the new Zenefits connector step highlighted, in the properties panel on the right, click on 'New Authentication' which is located under the 'Settings' heading.

zenefits-auth

This will result in a Tray.io authentication pop-up window. The first page will ask you to name your authentication, and state which type of authentication you wish to create ('Personal' or 'Organisational').

As you can see, the next page asks you for your 'Client ID' and 'Client secret' credentials.

PLEASE NOTE: A different Zenefits 'Domain' can be used instead of the autofill option. Thiswill change the authentication location, and may be used for testing purposes. Otherwise, feelfree to leave the domain unchanged.

zenefits-auth-popups

In addition to the above, you will need to tick the relevant scopes from the list of scopes to again the correct access to retrieve information from your Zenefits account.

IMPORTANT!: The Platform scope is the only mandatory scope required to be included in allrequests that identifies that an integration has been added. Request will fail without this scope.

zenefits-scopes

Once you have added these fields to your Tray.io authentication popup window, click on the 'Create authentication' button. Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.

Your connector authentication setup should now be complete.

Available Operations

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Using the Raw HTTP Request ('Universal Operation')

As of version 1.0, it is now possible to effectively create your own operations.

This is a very powerful feature which you can put to use when there is an endpoint in Zenefits which is not used by any of our operations.

To use this you will first of all need to research the endpoint in the Zenefits API documentation(v1), to find the exact format that Zenefits will be expecting the endpoint to be passed in.

Note that you will only need to add the suffix to the endpoint, as the base url will be automatically set (the base url is picked up from the value you entered when you created your authentication).

The base url is in the format of https://api.zenefits.com/core/

For example, say that the 'List people' operation did not exist in our Zenefits connector, and you wanted to use this endpoint, you would use the Zenefits API docs to find that the 'List people' endpoint is a get request at the following url:

zenefits-get-url

So if you know what your endpoint and company ID is, you can get a list of people, with the following settings:

Endpoint: /companies/{:company_id}/people

E.g. company_id: 123456

zenefits-raw-http

Final outcome: https://api.zenefits.com/core/companies/123456/people

This will now return information about a company's employees details.

Example usage

Below is an example of a way in which you could potentially use the Zenefits connector, to list installations and update the installation status of a selected installation.

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the Zenefits connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

The steps will be as follows:

  1. Set up your manual trigger and first Zenefits connector step.

  2. Add a Loop connector to iterate through your installations.

  3. Add a step to update the installation status.

The final outcome should look like this:

zenefits-complete-workflow

1 - Setup trigger & List Installations

Once you have clicked 'Create new workflow' on your main Tray.io dashboard (and named said new workflow), select the 'Manual Trigger' from the trigger options available:

zenefits-manual-trigger

Once you have been redirected to the Tray.io workflow dashboard, from the connectors panel the left, add an 'Zenefits' connector to your second step. Set the operation to 'List installations'.

This operation returns information about the installations for companies who have added your application. You can specify the number of results returned using the Limit parameter. Default value is set to 100 results.

Feel free to re-name your steps as you go along to make things clearer for yourself and other users.

zenefits-first-step

Now when this workflow is run, it will retrieve all installations for companies who have added your application. This means you will be able to view them when you click through your debug panel, and expend the output field.

2 - Add a Loop step

Next, we add a 'Loop Collection' connector to the workflow.

Use the connector-snake to generate the JSON path you will need, by clicking and dragging on the orange circle mapping icon, left of the 'List operation' itself.

CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray.io, please see our Intro page and Data Guide for more details.

.

Once you have dragged it over to the first Zenefits step, you will see a dropdown list of options appear. Select the id output.

zenefits-loop-connector

This will enable us to iterate over the list of installations, and perform operations for each one, during each loop cycle.

3 - Update Installation Status

Finally, drag another Zenefits connector step into the Loop collection itself, and select the operation 'Update installation status'. This operation updates Zenefits when your application is ready to begin working for a company.

Use the same connector-snake method for generating the JSON path to get the 'value' field from the Loop connector.

zenefits-second-step

Your 'Installation ID' should be along the lines of $.steps.loop-1.value, and the 'Status' (i.e. what to update the installation status to) you can choose from the drop down options: OK or Not Enrolled.

zenefits-second-step-complete

BEST PRACTICES: Whenever you do decide to create your own workflow, please make sure you take a look at our managing data best practices guide.

All Operations

Latest version:

2.2

Get authorized user

Returns information about the currently authorized user.

Get employee field

Retrieves the given employee field.

List all flows

Returns all flows across all people's subscriptions

List applications

Returns information about your application(s).

List companies

Returns information about companies.

List company bank accounts

Returns information about a company's bank account.

List custom fields

Returns information about a company's custom fields

List custom fields DDL

List departments

Returns a list of a company's departments.

List employee bank accounts

Returns information about an employee's bank accounts.

List employee fields DDL

List employements

Returns information about an employee's historical employment.

List flow custom fields DDL

List installation custom fields DDL

List installations

Returns information about the installations for companies who have added your application.

List installations DDL

List labor group types

Returns information about a company's labor group types.

List labor group types DDL

List locations

Returns a list of a company's locations.

List people

Returns information about a company's employees.

List person custom field values

Returns information about a person's custom field answers.

List person subscriptions

Returns information about the subscriptions for people in the company where your integration was added.

List person subscriptions DDL

List sub labor groups

Returns a list of labor groups for a given labor group type.

List subscription custom fields DDL

List subscription flows

Returns information about the flows (e.g. hiring) completed by people who have added your application.

List subscription flows DDL

List time durations

Returns information about a person's T&A hours.

List vacation requests

Returns information about employees' PTO vacation requests.

List vacation types

Returns information about a company's PTO vacation types.

Raw HTTP request (advanced)

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication.

Set installation custom fields

Set values for installation custom fields.

Set subscription custom fields

Set values for subscription custom fields.

Set subscription flow custom fields

Set values for subscription flow custom fields.

Trigger a new flow

Triggers a collection of new information from a person outside of the standard flows.

Update installation status

Updates Zenefits when your application is ready to begin working for a company.

Update subscription status

Updates Zenefits when accounts in your service are linked to Zenefits accounts.