Python cURL (bash) JavaScript Ruby PHP C# Java Go
Request:
Copy devices = seam . devices . list (
custom_metadata_has = {
"internal_account_id" : "user-1"
}
)
pprint (devices)
Response:
Copy [Device(device_id='f7a7fb02-9277-4354-8dd1-28e2d016a7a9',
device_type='schlage_lock',
...
is_managed=True,
custom_metadata={"internal_account_id": "user-1"}),
...]
Request:
Copy curl -X 'POST' \
'https://connect.getseam.com/devices/list' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ${API_KEY}' \
-H 'Content-Type: application/json' \
-d '{
"custom_metadata_has": {
"internal_account_id": "user-1"
},
}'
Response:
Copy {
"devices" : [
{
"device_id" : "f7a7fb02-9277-4354-8dd1-28e2d016a7a9" ,
"device_type" : "schlage_lock" ,
...
"is_managed" : true ,
"custom_metadata" : {
"internal_account_id" : "user-1"
}
}
] ,
"ok" : true
}
Request:
Copy const devices = await seam . devices .list ({
custom_metadata_has : {
"internal_account_id" : "user-1"
}
});
console .log (devices);
Response:
Copy [
{
device_id : 'f 7 a 7 fb 02-9277-4354-8 dd 1-28e2 d 016 a 7 a 9 ' ,
device_type : 'schlage_lock' ,
...
is_managed : true ,
custom_metadata : { internal_account_id : 'user -1 ' }
} ,
...
]
Request:
Copy devices = client . devices . list(
custom_metadata_has: {
"internal_account_id" : "user-1"
}
)
puts devices . inspect
Response:
Copy [<Seam::Device:0x004d8
device_id="f7a7fb02-9277-4354-8dd1-28e2d016a7a9"
device_type="schlage_lock"
...
is_managed=true
custom_metadata={"internal_account_id"=>"user-1"}>, ...]
Request:
Copy $devices = $seam -> devices -> list (
custom_metadata_has : array ( 'internal_account_id' => 'user-1' )
) ;
echo json_encode ( $devices ) ;
Response:
Copy [{ "device_id" : "f7a7fb02-9277-4354-8dd1-28e2d016a7a9" , "device_type" : "schlage_lock" , ... "is_managed" : true , "custom_metadata" : { "internal_account_id" : "user-1" }} , ...]
Request:
Copy var customMetadata = new Dictionary < string , string >()
{
{ "internal_account_id" , "user-1" }
};
var devices = seam . Devices . List (
customMetadataHas : customMetadata
);
foreach ( var device in devices)
{
Console . WriteLine (device);
}
Response:
Copy {
"device_id" : "f7a7fb02-9277-4354-8dd1-28e2d016a7a9" ,
"device_type" : "schlage_lock" ,
...
"is_managed" : true ,
"custom_metadata" : {
"internal_account_id" : "user-1"
}
}
...
Request:
Copy Map < String , CustomMetadataValue > customMetadata =
Map . of ( "internal_account_id" , CustomMetadataValue . of ( Optional . of ( "user-1" )));
var devices = seam . devices () . list ( DevicesListRequest . builder ()
. customMetadataHas (customMetadata)
. build ());
System . out . println (devices);
Response:
Copy [{
"device_id" : "f7a7fb02-9277-4354-8dd1-28e2d016a7a9" ,
"device_type" : "schlage_lock" ,
...
"is_managed" : true ,
"custom_metadata" : {
"internal_account_id" : "user-1"
}
} , ...
]
Request:
Copy devices, err := client.Devices. List (
context. Background (),
& api . DevicesListRequest {
CustomMetadataHas: { "internal_account_id" : "user-1" },
},
)
if err != nil {
return err
}
fmt. Println (devices)
return nil
Response:
Copy [{
"device_id" : "f7a7fb02-9277-4354-8dd1-28e2d016a7a9" ,
"device_type" : "schlage_lock" ,
...
"is_managed" : true ,
"custom_metadata" : {
"internal_account_id" : "user-1"
}
}...
]