Programming Code-Based Salto KS Credentials
Learn how to create Salto KS PIN codes.
# Get the ACS system.
building_a = seam.acs.systems.get(
acs_system_id="11111111-1111-1111-1111-111111111111"
)
# Define the listing.
listing = {
"listing_id": "2222222-2222",
"seam_access_group_ids": [
"555555-5555",
"666666-6666"
]
}
# Define the reservation.
reservation = {
"reservation_id": "3333122-432",
"guest_email": "[email protected]",
"listing_id": "2222222-2222",
"check_in": "2024-11-01T15:00:00.000Z",
"check_out": "2024-11-04T11:00:00.000Z"
}
# Step 1:
# Create the new ACS user, including the
# desired access schedule.
reservation_user = seam.acs.users.create(
full_name = reservation["reservation_id"],
acs_system_id = building_a.acs_system_id,
access_schedule = {
"starts_at": reservation["check_in"],
"ends_at": reservation["check_out"]
}
)
# Step 2:
# Add the ACS user to all access groups for the listing.
for group_id_to_add in listing["seam_access_group_ids"]:
seam.acs.users.add_to_access_group(
acs_user_id = reservation_user.acs_user_id,
acs_access_group_id = group_id_to_add
)
# Step 3:
# Create a PIN code for the ACS user.
reservation_pin_code = seam.acs.credentials.create(
acs_user_id = reservation_user.acs_user_id,
access_method = "code"
)
# View the new credential.
pprint(reservation_pin_code)Next Steps
Last updated
Was this helpful?

