Comment on page
List Access Codes
Get all Access Codes of a Device by its ID
get
https://connect.getseam.com
/access_codes/list
Get list of Access Codes
Ruby
Python
Javascript
seam.access_codes.list("123e4567-e89b-12d3-a456-426614174000")
# [<Seam::AccessCode:0x007cd58
# code="669781"
# name="My first code"
# type="ongoing"
# created_at="2022-07-06T23:26:42.223Z"
# access_code_id="f19bc8cb-15be-43af-bb52-f1a417e0ff09">]
seam.access_codes.list("a83690b2-2b70-409a-9a94-426699b84c97")
# [AccessCode(
# access_code_id='26d6138c-6524-4f3c-ac96-43cc3bea0a8d',
# type='ongoing',
# code='1988',
# starts_at=None,
# ends_at=None,
# name='',
# status='setting'
# )
# ]
await seam.accessCodes.list({
device_id: "a83690b2-2b70-409a-9a94-426699b84c97",
});
/*
[
{
code: '1988',
type: 'ongoing',
status: 'setting',
created_at: '2022-08-26T12:50:17.858Z',
access_code_id: '26d6138c-6524-4f3c-ac96-43cc3bea0a8d'
}
]
*/
device_id | type: string | ID of Device connected to account |
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
{
"access_codes": [
{
"code": "1988",
"type": "ongoing",
"status": "setting",
"created_at": "2022-08-26T12:50:17.858Z",
"access_code_id": "26d6138c-6524-4f3c-ac96-43cc3bea0a8d"
}
],
"ok": true
}
Last modified 6mo ago