Granting a user access to a lock

1.Adding a user

Two types of users can be added, users with or without profile. Users without profile don't have an email address and thus cannot log in on the API and cannot use features like remote opening etc. Users with a profile can log in via the API and thus need an email address. The picture below shows how to add a user without a profile. If you want to add a user with a profile you have to add email: {user_email} to the body. This will cause an invitation email to be sent out to the user to complete their profile.

A. Create a POST request to {{url}}/v1.1/sites/{site_id}/users. In the body provide the information like shown above. A user has a certain role, to see the available roles on your site do GET {{url}}/v1.1/sites/{site_id}/roles. You can provide a Tag for the user to be associated with by filling in the tag ID. This is optional, a tag can also be added later to a user.
On success the endpoint will return the details of the user that was added.

2.Creating an access group

An access group is a definition of what users can enter which doors when. You first have to create the access group after which you can add doors/users/time schedules.

A. Create a POST request to {{url}}/v1.1/sites/{siteid}/accessgroups. In the body of the request you have to specify a customer_reference ie. a human readable name for the access group.
On success the endpoint will return the ID of the access group you have created.

3.Adding a lock to the access group

A.Create a POST request to {{url}}/v1.1/sites/{siteid}/accessgroups/{accessgroupid}/locks. In the body of the request provide the lock ID of the lock you want to add.

4.Adding a time schedule to the access group

A.Create a POST request to {{url}}/v1.1/sites/{siteid}/accessgroups/{accessgroupid}/time_schedules. In the body of the request provide the details of the time schedule you want to add. Some parameters are optional, refer to the Swagger documentation for more details on how to build a time schedule.

5.Adding a user to the access group

A. Create a POST request to {{url}}/v1.1/sites/{siteid}/accessgroups/{accessgroupid}/users. In the body of the request provide the ID of the user you want to add.

6.Test access

All components of the access group are now defined. Check that the user you added indeed has access to the lock using his/her tag.

Next

App storePlay store