Programming Salto KS PIN Code Credentials
Learn how to create Salto KS PIN codes.
// Get the ACS system.
const buildingA = await seam.acs.systems.get({
acs_system_id: "11111111-1111-1111-1111-111111111111"
});
// Step 1:
// Create the new ACS user, including the
// desired access schedule.
const acsUser = await seam.acs.users.create({
full_name: "Jane Doe",
acs_system_id: buildingA.acs_system_id,
access_schedule: {
"starts_at": "2024-11-01T15:00:00.000Z",
"ends_at": "2024-11-04T11:00:00.000Z"
}
});
// Step 2:
// Add the ACS user to all desired access groups.
const accessGroupIds = [
"44444444-4444-4444-4444-333333333333",
"44444444-4444-4444-4444-444444444444"
];
for (const accessGroupId of accessGroupIds) {
await seam.acs.users.addToAccessGroup({
acs_user_id: acsUser.acs_user_id,
acs_access_group_id: accessGroupId
});
}
// Step 3:
// Create a PIN code for the ACS user.
const pinCode = await seam.acs.credentials.create({
acs_user_id: acsUser.acs_user_id,
access_method: "code"
});
// View the new credential.
console.log(pinCode);Next Steps
Last updated
Was this helpful?

