Setting up a lock

1

Adding a lock

After that, you can add the lock to the site.
Adding a lock
A
Create a POST request to {{url}}/v1.1/sites/{site_id}/locks. Replace the {site_id} with the id of the site you created.
B
In the body of the POST request you should add two variables: customer_reference and activation_code. The customer reference is a string that describes the lock for easy recognition. The activation code is 8 letter code that can be found on or in the lock formatted like this: XX.XX.XX.XX.
C
When you hit send you should get a 200-OK response and a response containing the id of the lock and all other information of the lock.
2

Attaching the lock to the IQ

Attaching the lock
A
Create a PUT request to {{url}}/v1.1/sites/{site_id}/iqs/{iq_id}/tree. Replace {site_id} with the id of the site and replace {iq_id} with the id of the IQ you want to attach your lock to. In the body of the request you should provide an OTP and an array of iq_tree_items, containing all the locks that should be attached to the IQ (so also locks that may already be attached).
B
In the Pre-request Script add the same script to generate OTP's that was used in step 4 of adding and activating an IQ. Don't forget to change the PIN to the new PIN you have chosen during that activation.
C
Once you hit send the tree will be sent to the IQ. The request should return 200 OK if everything went well and display the new tree of the IQ. After this, you will need to present a maintenance card to the lock. This will start the pairing process between IQ and lock. The LED on the lock should blink orange a few times and then green. It may happen that the LED of the lock blinks red this means pairing failed. Make sure that the lock is within range of the IQ and try again.
3

Opening the lock remotely

After the lock has been added it can be opened via the API.
Opening the lock remotely
A
Create a PATCH request to {{url}}/v1.1/sites/{site_id}/locks/{lock_id}/locking. Again replace {site_id} with the id of the site and replace {lock_id} with the id of the lock you want to open. In the body put locked_state to unlocked and add an OTP. Also using the same Pre-request Script as before to generate the OTP.
B
After you hit send you should get a Status 200 OK and a few seconds after that your lock will open.