zapier

Zapier

There are 2 methods to integrate Kisi with Zapier, via Zapier templates and Zapier webhooks.

Zapier support events triggers and actions such as new user creation, update sharing, group fetching and create share. Read on to set up these integrations.

zapier triggers and actions

Method 1: Zapier Templates

Create a workflow in Zapier and connect to Kisi

Zapier Webhooks

Method 2: Zapier Webhooks

A step-by-step process on how to use Kisi Webhooks with Zapier to automate the process of Unlocking a lock.

Prerequisites

  1. A Zapier account. You can create an account on Zapier Website
  2. Webhooks by Zapier, webhooks by Zapier is available only on premium zapier accounts, hence you need to upgrade to a premium plan on zapier.

Steps

1. Create a Zap and add a trigger

zapier

2. Choose Webhooks by Zapier and pick Custom Request:

zapier

Set up actions on this custom request. The Method is POST, the URL and Data

will depend on what Kisi action you are doing. Various actions are described below.

zapier

Headers

Kisi documentation: Headers

Each POST needs to have at least 2 headers:

accept = application/json

content-type = application/json

Each POST after the log in step needs to have an additional authorization header:

Authorization = KISI-LOGIN authentication token from login

See below for how to login and get this value.

3. Create Kisi login to get your authentication token

This is the first POST required before any other Kisi API interactions. The Kisi authentication token output from this step needs to be included in the headers of following POSTs.

You can refer to this part of kisi documentation to see how it is created

You can make a request to the URL( https://api.kisi.io/logins) from the documentation page or use tools like postman and insomnia to make the request.

The request body is in the form:

{

"login": {

"type": "api",

"name": "string",

"push_token": "string",

"email": "user@example.com"

},

"user": {

"domain": "string",

"email": "string",

}

}

A successful response in the format below will return data (an object) which contains an authorization parameter which you we will pass an an header alongside other headers in subsequent requests

{

"id": 100829676,

"type": "api",

"name": null,

"primary": false,

"last_used_at": null,

"last_reauthenticated_at": null,

"created_at": "2022-07-12T14:42:39.650Z",

"updated_at": "2022-07-12T14:42:39.650Z",

"User_id": your id,

"app": {

"name": "Other",

"version": ""

},

"device": {

"brand": null,

"model": "Other",

"size": "Other"

},

"os": {

"name": "Other",

"version": ""

},

"user_agent": {

"name": "PostmanRuntime",

"version": ""

},

"user": {

"id": your id,

"email": "<your email>",

"name": "your name>”

},

"challenge_secret": "",

"secret": "<secret>",

"scram_credentials": null,

"authentication_token": "<the authentication token we need>",

"email": "<your email>",

"image": null,

"notifications_unread_count": 0,

"otp_required_for_login": false,

"otp_enabled_at": null,

"primary_login_exists": false,

"has_primary_device": false

}

A complete request header for subsequent requests will thus include these three headers

zapier

Unique Kisi values (ID numbers) needed

To tell Kisi which items to do the actions to, find the following IDs in the URL of various pages in your Kisi dashboard. Include these where necessary in your Zap actions.

Door page: https://web.kisi.io/places/14251/locks/25992

Place ID = 4251

Lock ID = 25992

Team page: https://web.kisi.io/organization/3403/groups/45791

Organization ID = 3403

Group ID = 45791

Locks vs. Groups

You can perform some Kisi actions on individual locks or groups of locks. If you can group locks to avoid doing multiple actions each Zap, then you'll cut down on the number of Zap tasks you run!

Add doors/locks to a Team in the Kisi dashboard and take note of the Group ID in the URL.

4. Unlock a lock (Kisi Actions)

This unlocks the lock at the time of the Zap action for the duration set in the lock settings (3 - 30 seconds).

Kisi documentation: Unlock a lock

You only need to input the lock ID in the URL and include the 3 headers. No code in the data section is necessary for this action.

URL: https://api.kisi.io/locks/ID/unlock

Publish your zap when you are done