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 August lock 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 August devices that Seam supports, see the following table and our August Supported Devices page:
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 page.
This guide shows you how to install a Seam SDK and then control your August lock using the Seam API.
Another easy way to learn about what you can do with the Seam API is to explore the interactive Seam CLI, which you can access from directly within the Seam Console.
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 OpenAPI spec.
This guide uses a sandbox workspace. You can only connect virtual devices and systems in this type of workspace. If you want to connect a real August lock, use a non-sandbox workspace and API key.
Step 2: Link your August account with Seam
To control your August lock using the Seam API, you must first authorize your Seam workspace to connect to your August account. If your application needs to connect to your users' August accounts, Seam provides fully-embedded, customizable client-side Connect Webviews 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 August locks. The Connect Webview presents a flow that prompts your users to enter their credentials for their August 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 August account.
This guide shows you how to create a Connect Webview programmatically using the Seam API.
The Seam Console provides another easy way to connect devices to your Seam workspace.
Create a connect_webview object and then note the returned URL.
Code:
from seam import Seamseam =Seam()# Seam automatically uses your exported SEAM_API_KEY.connect_webview = seam.connect_webviews.create(accepted_providers=["august"])assert connect_webview.login_successful isFalse# Use the returned Connect Webview URL to display# the Connect Webview authorization flow to your user.print(connect_webview.url)
import { Seam } from"seam";constseam=newSeam(); // Seam automatically uses your exported SEAM_API_KEY.constconnectWebview=awaitseam.connectWebviews.create({ accepted_providers: ['august']});console.log(connectWebview.login_successful); // false// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.console.log(connectWebview.url);
require"seam"seam =Seam.new() # Seam automatically uses your exported SEAM_API_KEY.connect_webview = seam.connect_webviews.create( accepted_providers: ["august"])puts connect_webview.login_successful # false# Use the returned Connect Webview URL to display# the Connect Webview authorization flow to your user.puts connect_webview.url
<?phprequire'vendor/autoload.php';$seam =newSeam\SeamClient(); // Seam automatically uses your exported SEAM_API_KEY.$connect_webview = $seam->connect_webviews->create( accepted_providers: ["august"]);echo $connect_webview->login_successful ?'true':'false',"\n"; // false// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.echo $connect_webview->url;
usingSeam.Client;var seam =newSeamClient(apiToken: SEAM_API_KEY);var connectWebview =seam.ConnectWebviews.Create( acceptedProviders:new() {Seam.Api.ConnectWebviews.CreateRequest.AcceptedProvidersEnum.August});Console.WriteLine(connectWebview.LoginSuccessful); // False// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.Console.WriteLine(connectWebview.Url);
importjava.io.Console;importjava.util.*;importcom.fasterxml.jackson.annotation.*;importcom.fasterxml.jackson.databind.annotation.JsonDeserialize;importcom.seam.api.Seam;importcom.seam.api.core.ObjectMappers;importcom.seam.api.types.ConnectWebview;importcom.seam.api.types.Device;importcom.seam.api.types.Manufacturer;importcom.seam.api.types.ActionAttempt;importcom.seam.api.types.AccessCode;importcom.seam.api.resources.connectwebviews.requests.ConnectWebviewsCreateRequest;importcom.seam.api.resources.connectwebviews.requests.ConnectWebviewsGetRequest;importcom.seam.api.resources.devices.requests.DevicesListRequest;importcom.seam.api.resources.devices.requests.DevicesGetRequest;importcom.seam.api.resources.locks.requests.LocksUnlockDoorRequest;importcom.seam.api.resources.accesscodes.requests.AccessCodesCreateRequest;importcom.seam.api.resources.accesscodes.requests.AccessCodesListRequest;publicclassMain {publicstaticvoidmain(String[] args) {Seam seam =Seam.builder().apiKey(SEAM_API_KEY).build();ConnectWebview connectWebview =seam.connectWebviews().create(ConnectWebviewsCreateRequest.builder().acceptedProviders(List.of(AcceptedProvider.AUGUST)).build());System.out.println(connectWebview.getLoginSuccessful()); // false// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.System.out.println(connectWebview.getUrl()); }}
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 Button within our suite of Seam Components that help you build your device management flow.
Because you're using a sandbox workspace, you can connect Seam's test August account. We provide virtual devices for each of the brands that we support. These sandbox devices and systems enable you to test your app with devices from multiple brands without the need to own all the corresponding physical devices.
Complete the Connect Webview authorization flow by entering the following August sandbox account credentials:
Device Region: Others
Email: jane@example.com
Password: 1234
2FA Method: Email (jane@example.com)
Two Factor Code: 123456
Confirm that authorization through the Connect Webview was successful by querying its status.
When you link an August account with Seam, we create a device object to represent each August lock in your account. You can then retrieve these August devices using the List Devices and Get Device endpoints.
The Seam API exposes each device's properties, such as the door lock status, power status, capabilities, and so on.
Code:
# Retrieve all devices, filtered by manufacturer,# which is one of several filters that list() supports.all_august_locks = seam.devices.list(manufacturer="august")# Select the first device as an example.front_door = all_august_locks[0]# Inspect specific properties.assert front_door.properties["online"]isTrue# Trueassert front_door.properties["locked"]isTrue# True# View the entire returned device object.pprint(front_door)
# Retrieve all devices, filtered by manufacturer, which is# one of several filters that the list endpoint supports.all_august_locks=$(# Use GET or POST.curl-X'GET' \'https://connect.getseam.com/devices/list' \-H'accept: application/json' \-H"Authorization: Bearer ${SEAM_API_KEY}" \-H'Content-Type: application/json' \-d'{ "manufacturer": "august" }')# Select the first device as an example.front_door=$(jq-r'.devices[0]'<<<${all_august_locks})# Inspect specific properties.echo $(jq-r'"Online (true): " + (.properties.online | tostring)'<<<${front_door})echo $(jq-r'"Locked (true): " + (.properties.locked | tostring)'<<<${front_door})# View the entire returned device object.echo ${front_door}
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.constallAugustLocks=awaitseam.devices.list({manufacturer:"august"});// Select the first device as an example.constfrontDoor= allAugustLocks[0];// Inspect specific properties.console.log(frontDoor.properties.online); // trueconsole.log(frontDoor.properties.locked); // true// View the entire returned device object.console.log(frontDoor);
# Retrieve all devices, filtered by manufacturer,# which is one of several filters that list() supports.all_august_locks = seam.devices.list(manufacturer: "august")# Select the first device as an example.front_door = all_august_locks[0]# Inspect specific properties.puts front_door.properties.online # trueputs front_door.properties.locked # true# View the entire returned device object.puts front_door.inspect
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.$all_august_locks = $seam->devices->list(manufacturer:"august");// Select the first device as an example.$front_door = $all_august_locks[0];// Inspect specific properties.echo $front_door->properties->online ?'true':'false',"\n"; // trueecho $front_door->properties->locked ?'true':'false',"\n"; // true// View the entire returned device object.echojson_encode($front_door, JSON_PRETTY_PRINT);
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.var allAugustLocks =seam.Devices.List( manufacturer:Seam.Api.Devices.ListRequest.ManufacturerEnum.August);// Select the first device as an example.Device frontDoor =allAugustLocks[0];// Inspect specific properties.Console.WriteLine(frontDoor.Properties.Online); // trueConsole.WriteLine(frontDoor.Properties.Locked); // true// View the entire returned device object.Console.WriteLine(frontDoor);
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.var allAugustLocks =seam.devices().list(DevicesListRequest.builder().manufacturer(Manufacturer.AUGUST).build());// Select the first device as an example.Device frontDoor =allAugustLocks.get(0);// Inspect specific properties.System.out.println(frontDoor.getProperties().getOnline()); // trueSystem.out.println(frontDoor.getProperties().getLocked()); // true// View the entire returned device object.System.out.println(frontDoor);
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.allAugustLocks, err := client.Devices.List( context.Background(), &api.DevicesListRequest{ Manufacturer: api.ManufacturerAugust.Ptr(), },)// Select the first device as an example.frontDoor := allAugustLocks[0]if err !=nil {return err}// Inspect specific properties.fmt.Println(frontDoor.Properties.Online) // truefmt.Println(*frontDoor.Properties.Locked) // true