Ask or search…
K
Links
Comment on page

Update an Access Code

Update an Access Code for a Device by its ID
put
https://connect.getseam.com
/access_codes/update
Update an Access Code

Code Example

Ruby
Javascript
Python
seam.access_codes.update(
access_code_id: "123e4567-e89b-12d3-a456-426614174000",
code: "1112",
name: 'New name'
)
# <Seam::ActionAttempt:0x00c7998
# status="success"
# action_type="UPDATE_ACCESS_CODE"
# action_attempt_id="2da52c27-9487-4a55-9379-60690a653b4e"
# result={
# "access_code"=>{
# "code"=>"1112",
# "name"=>"New name",
# "type"=>"ongoing",
# "status"=>"setting",
# "created_at"=>"2022-07-06T16:01:18.063Z",
# "access_code_id"=>"123e4567-e89b-12d3-a456-426614174000"}}>
await seam.accessCodes.update({
access_code_id: "cd706212-ec14-499a-abd5-ba04123ee65e",
code: "1111"
});
/*
{
code: '1111',
name: 'My first code',
type: 'ongoing',
status: 'setting',
created_at: '2022-08-31T17:27:33.324Z',
access_code_id: 'cd706212-ec14-499a-abd5-ba04123ee65e'
}
*/
seam.access_codes.update(
"cd706212-ec14-499a-abd5-ba04123ee65e",
None, None, 4321)
# AccessCode(
# access_code_id='cd706212-ec14-499a-abd5-ba04123ee65e',
# type='ongoing',
# code='4321',
# starts_at=None,
# ends_at=None,
# name='My first code',
# status='setting'
# )

Parameters

access_code_id
type:string
ID of the Access Code
device_id
type: string Optional
ID of the Device
name
type: string Optional
Name of Access Code
starts_at
type: string Optional
From when is the code valid
ends_at
type: string Optional
Code expiry
code
type: string Optional
Access code of Device

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": "UPDATE_ACCESS_CODE",
"action_attempt_id": "bbb8a07d-a91d-4564-b002-8172f7cdadc4",
"result": null,
"error": null
},
"ok": true
}