Seam provides a universal API to connect and control many brands of smart locks. This guide provides a rapid introduction to connecting and controlling your Omnitec lock using the Seam API. Omnitec locks must be connected through an Omnitec Rent&Pass Gateway for online access.To learn more about other smart lock brands supported by Seam, head over to our integration page.
Seam provides client libraries for many languages, such as JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and OpenAPI spec.
pip install seam# For some development environments, use pip3 in this command instead of pip.
bundle add seam
composer require seamapi/seam
Install using nuget: https://www.nuget.org/packages/Seam
// Add to your pom.xml or build.gradle — see Maven Central for details.
# cURL is already installed on most systems. No additional installation needed.# Export your API key as an environment variable:export SEAM_API_KEY=seam_test2ZTo_0mEYQW2TvNDCxG5Atpj85Ffw
Once installed, sign up for Seam to get your API key, and export it as an environment variable:
This guide uses a Sandbox Workspace. Only virtual devices can be connected. If
you need to connect a real Omnitec lock, use a non-sandbox workspace and API key.
To control your Omnitec lock via the Seam API, you must first authorize your Seam workspace against your Omnitec account. To do so, Seam provides Connect Webviews: pre-built UX flows that walk you through authorizing your application to control your Omnitec lock.
import { Seam } from "seam";const seam = new Seam();const connectWebview = await seam.connectWebviews.create({ accepted_providers: ["omnitec"],});console.log(connectWebview.login_successful); // false// Send the webview URL to your userconsole.log(connectWebview.url);
from seam import Seamseam = Seam()webview = seam.connect_webviews.create(accepted_providers=["omnitec"])assert webview.login_successful is False# Send the webview URL to your userprint(webview.url)
require "seam"seam = Seam.new(api_key: "MY_API_KEY")webview = seam.connect_webviews.create( accepted_providers: ["omnitec"])puts webview.login_successful # false# Send the webview URL to your userputs webview.url
<?phpuse Seam\SeamClient;$seam = new SeamClient("YOUR_API_KEY");$webview = $seam->connect_webviews->create( accepted_providers: ["omnitec"]);echo $webview->login_successful; // false// Send the webview URL to your userecho $webview->url;
using Seam.Client;var seam = new SeamClient(apiToken: "YOUR_API_KEY");var webview = seam.ConnectWebviews.Create( acceptedProviders: new List<string> { "omnitec" });Console.WriteLine(webview.LoginSuccessful); // false// Send the webview URL to your userConsole.WriteLine(webview.Url);
import co.seam.Seam;import co.seam.api.types.ConnectWebview;Seam seam = Seam.builder().apiKey("YOUR_API_KEY").build();ConnectWebview webview = seam.connectWebviews().create( ConnectWebviewsCreateRequest.builder() .acceptedProviders(List.of("omnitec")) .build());System.out.println(webview.getLoginSuccessful()); // false// Send the webview URL to your userSystem.out.println(webview.getUrl());
Navigate to the URL returned by the Webview object. Since you are using a sandbox workspace, complete the login flow by entering the Omnitec sandbox test account credentials below:
During the Connect Webview flow, you will also be prompted to select a time zone. You can choose any valid time zone.Confirm the Connect Webview was successful by querying its status:
After an Omnitec account is linked with Seam, you can retrieve devices for this Omnitec account. The Seam API exposes most of the device’s properties such as battery level or door lock status.
# lock the doorseam.locks.lock_door(device_id=some_lock.device_id)updated_lock = seam.locks.get(device_id=some_lock.device_id)assert updated_lock.properties["locked"] is True# unlock the doorseam.locks.unlock_door(device_id=some_lock.device_id)updated_lock = seam.locks.get(device_id=some_lock.device_id)assert updated_lock.properties["locked"] is False
Omnitec locks with a keypad support access code programming. The Seam API makes it easy to program both ongoing codes and timebound codes on an Omnitec lock.You can find out more about access codes in our guide on access codes.
# create an ongoing codeseam.access_codes.create( device_id=some_lock.device_id, code="123456", name="Personal Access Code")# create a timebound codeseam.access_codes.create( device_id=some_lock.device_id, code="888888", name="Guest Access Code", starts_at="2028-11-12T19:00:00+0000", ends_at="2028-11-13T12:00:00+0000")# list all access codes on the deviceaccess_codes = seam.access_codes.list(device_id=some_lock.device_id)print(access_codes)
# create an ongoing codeseam.access_codes.create( device_id: some_lock.device_id, code: "123456", name: "Personal Access Code")# create a timebound codeseam.access_codes.create( device_id: some_lock.device_id, code: "888888", name: "Guest Access Code", starts_at: "2028-11-12T19:00:00+0000", ends_at: "2028-11-13T12:00:00+0000")# list all access codes on the deviceaccess_codes = seam.access_codes.list(device_id: some_lock.device_id)puts access_codes
<?php// create an ongoing code$seam->access_codes->create( device_id: $some_lock->device_id, code: "123456", name: "Personal Access Code");// create a timebound code$seam->access_codes->create( device_id: $some_lock->device_id, code: "888888", name: "Guest Access Code", starts_at: "2028-11-12T19:00:00+0000", ends_at: "2028-11-13T12:00:00+0000");// list all access codes on the device$access_codes = $seam->access_codes->list( device_id: $some_lock->device_id);print_r($access_codes);
// create an ongoing codeseam.AccessCodes.Create( deviceId: someLock.DeviceId, code: "123456", name: "Personal Access Code");// create a timebound codeseam.AccessCodes.Create( deviceId: someLock.DeviceId, code: "888888", name: "Guest Access Code", startsAt: "2028-11-12T19:00:00+0000", endsAt: "2028-11-13T12:00:00+0000");// list all access codes on the devicevar accessCodes = seam.AccessCodes.List( deviceId: someLock.DeviceId);foreach (var code in accessCodes){ Console.WriteLine(code.Code);}
// create an ongoing codeseam.accessCodes().create(AccessCodesCreateRequest.builder() .deviceId(someLock.getDeviceId()) .code("123456") .name("Personal Access Code") .build());// create a timebound codeseam.accessCodes().create(AccessCodesCreateRequest.builder() .deviceId(someLock.getDeviceId()) .code("888888") .name("Guest Access Code") .startsAt("2028-11-12T19:00:00+0000") .endsAt("2028-11-13T12:00:00+0000") .build());// list all access codes on the devicevar accessCodes = seam.accessCodes().list(AccessCodesListRequest.builder() .deviceId(someLock.getDeviceId()) .build());System.out.println(accessCodes);
Now that you’ve completed this guide, you can try to connect a real Omnitec device. To do so, make sure to switch to a non-sandbox workspace and API key as real devices cannot be connected to sandbox workspaces.In addition, if you’d like to explore other aspects of Seam, here is a list of helpful resources: