Get started with 33 Lock devices

Learn how to connect and control 33 Lock smart locks with the Seam API.

Overview

Seam provides a universal API to connect and control many brands of IoT devices and systems, including smart locks, access control systems (ACSs), thermostats, and noise sensors.

This guide gives you a rapid introduction to connecting and controlling your 33 Lock device using the Seam API. For application developers, you can use the Seam API in your app, and your users can authorize your app to control their devices using Seam.

For detailed information about the 33 Lock devices that Seam supports, see our 33 Lock Supported Devices pagearrow-up-right.

To learn more about other IoT device and system brands that Seam supports—such as Yale, Schlage, Google Nest, and many more—visit our integration pagearrow-up-right.

circle-check

Step 1: Install a Seam SDK

Seam provides client libraries for many languages, including JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and an OpenAPIarrow-up-right spec.

First, install a Seam SDK, as follows:

Next, go to https://console.seam.co/arrow-up-right and sign up for Seamarrow-up-right to get your API keyarrow-up-right.

Then, export your API key as an environment variable.

circle-info

This guide uses a sandbox workspacearrow-up-right. You can only connect virtual devices and systems in this type of workspace. If you want to connect a real 33 Lock device, use a non-sandbox workspacearrow-up-right and API key.


To control your 33 Lock device using the Seam API, you must first authorize your Seam workspace to connect to your associated TTLock account. If your application needs to connect to your users' TTLock accounts, Seam provides fully-embedded, customizablearrow-up-right client-side Connect Webviewsarrow-up-right to collect their authorization securely. These user-friendly pre-built authorization flows walk your users through the process of granting your Seam workspace permission to control their 33 Lock devices. The Connect Webview presents a flow that prompts your users to enter their credentials for their TTLock account.

In this guide, you create a Connect Webview object. Then, you display the graphical component of the created Connect Webview and enter a set of sample credentials to connect a sandbox TTLock account.

circle-check

Create a Connect Webview

Create a connect_webview object and then note the returned URL.

Code:

Output:


Authorize your workspace

In a web browser, go to the URL that the Connect Webview object returned.

For application developers, you can redirect your user to this Connect Webview URL so that they can authorize your app to control their devices using Seam. We even provide a prebuilt Connect Account Buttonarrow-up-right within our suite of Seam Componentsarrow-up-right that help you build your device management flow.

circle-check

Complete the Connect Webview authorization flow by entering the following TTLock sandbox account credentials:

Confirm that authorization through the Connect Webview was successful by querying its status.

Code:

Output:


Step 3: Retrieve 33 Lock devices

When you link a TTLock account (for your 33 Lock devices) with Seam, we create a device object to represent each 33 Lock lock in your account. You can then retrieve these 33 Lock devices using the List Devicesarrow-up-right and Get Devicearrow-up-right endpoints.

The Seam API exposes each device's properties, such as the door lock status, power status, capabilities, and so on.

Code:

Output:


Step 4: Control your 33 Lock device

Next, you can use the Seam API to control your lock.

Each device that you connect to Seam has a specific set of capabilities. These capabilities define the Seam API actions that you can use, such as remote unlock actionsarrow-up-right, programming access codesarrow-up-right, and so on. Seam's intuitive and granular capability flagsarrow-up-right inform your application about what features and behaviors each device supports. Notice the capability flags within the code samples in this guide.

Try out the following actions on your 33 Lock device:

Unlock your lock

To unlock a door, use the Unlock Doorarrow-up-right endpoint. Specify the device that you want to unlock by including the device_id in the request body. This endpoint returns an action attemptarrow-up-right to track the progress of the unlock operation.

Code:

Output:

You can track the status of the unlock operation to confirm that the device unlocked successfully. Query the locked status of the device, retrieve the action attemptarrow-up-right by ID, or look for a lock.unlocked eventarrow-up-right.

To query the locked status of the device:

Code:

Output:

circle-check

Program access codes on your lock

You can use the Seam API to program online access codesarrow-up-right on 33 Lock devices. These devices have an integrated keypad. Lock users can then enter these access codes using the keypad to unlock the lock.

The Seam API makes it easy to program both ongoingarrow-up-right and time-boundarrow-up-right online access codes.

Code:

Output:


Step 5: Connect a real 33 Lock device

Now that you have learned the basics of using the Seam API, you can connect and control a real 33 Lock device. To do so, make sure to switch to a non-sandbox workspacearrow-up-right and API keyarrow-up-right.

For more details about setting up your real 33 Lock device, see the 33 Lock locks integration guide.


Step 6: Build your application!

Seam makes it easy to develop your application. In addition to the robust Seam API and the wide variety of programming languages that our SDKs support, we also provide a suite of Seam Componentsarrow-up-right. These prebuilt UI components help you to build your device management flow.

For example, you can use the Device Table Seam Componentarrow-up-right to display a list of devices and to identify all devices with issues. You can use the Device Details Seam Componentarrow-up-right to display a device's properties, settings, and issues, as well as to enable your users to perform actions based on each device's capabilities. The Access Code Details Seam Componentarrow-up-right provides a similar display and actions for access codes.

Seam Components use a responsive design to fit seamlessly on any screen size. They also provide device debugging flows to help your users.

To learn about all the Seam Components that we provide, see Seam Componentsarrow-up-right.


Next steps

Now that you've completed this getting started guide for 33 Lock devices, you can learn more about what you can do with the Seam API.

circle-info

If you have any questions or want to report an issue, email us at [email protected]envelope.


Last updated

Was this helpful?