Links

Lock a Lock

Issue a lock command on the Device by its Device ID
post
https://connect.getseam.com
/locks/lock_door
Lock Door for Device

Code Example

Ruby
Javascript
Python
seam.locks.lock_door("123e4567-e89b-12d3-a456-426614174000")
#<Seam::ActionAttempt:0x00438
# status="pending"
# action_type="LOCK_DOOR"
# action_attempt_id="31709a8a-8799-4098-90b8-fe1bc251e983"
# result=nil>
await seam.locks.lockDoor(
"a83690b-2b70-409a-9a94-426699b84c97"
);
//{}
seam.locks.lock_door("a83690b2-2b70-409a-9a94-426699b84c97")
# <Seam::ActionAttempt:0x008f6b0
# status="success"
# action_type="LOCK_DOOR"
# action_attempt_id="4c3f9e12-5c9e-474e-92c4-719f72e13496"
# result={}>

Parameters

device_id
type: string
Device ID
sync
type: boolean Optional

Response

This section shows the JSON response returned by the API. Since each language encapsulates this response inside objects specific to that language and/or implementation, the actual type in your language might differ from what’s written here.

JSON format

JSON
{
"action_attempt": {
"status": "pending",
"action_type": "LOCK_DOOR",
"action_attempt_id": "4a11bcaf-c930-41d8-85f0-be375c93096f",
"result": null,
"error": null
},
"ok": true
}
status
"success" | "error" | "pending"
success determines a completed action performed on the device. error determines an unsuccessful action performed on the device. pending determines Seam is still trying to perform the action on the device
action_type
"LOCK_DOOR"
Determines the type of action performed on the device
action_attempt_id
String
ID of the action attempt
result
String
result only exists for the success status describing the event
error
Object
error only exists for the error status describing the event. It is an object with type and message. Where type determines type of error and message describes the error
© Seam Labs, Inc. All rights reserved.