Resource names and custom IDs
Overview
The Salto Nebula API is a resource-oriented API. This means that resources are named entities, and resource names are their identifiers.
The resource name is organized hierarchically using collection IDs and resource IDs, separated by forward slashes. If a resource contains a sub-resource, the sub-resource's name is formed by specifying the parent resource name followed by the sub-resource's ID - again, separated by forward slashes.
Nebula resource names
All entities in Salto Nebula, like users or access rights, have a unique resource identifier called name
.
name
should not be confused with display_name
.
The name
always has a specific format.
For example, for a user it could be something like this:
installations/surelock-homes-hq/users/01FF2GQJATHV5Z90S1Y5CC6ECD
These identifiers of random characters are generated automatically if you do not fill out the {entity}_id
field when creating an entity.
For example, for a user this would be user_id
.
If you do fill it in, whatever identifier you put is used, but only for the segment that corresponds to it.
For example, if when creating a user you set the user_id
to "12345678Z" (because that's a unique identifier you already have for that user in your own database), then the user will be created with the following name
:
installations/surelock-homes-hq/users/12345678Z
.
Custom IDs
If you have an existing database with users and their corresponding IDs, you can use the ID of your own database rather than the ID that has been assigned to the entity by Nebula.
Every {entity}_id
present in Create{Entity}
methods is being used for its inclusion in the last part of the name
.
This means that when you set a custom user_id
, for example, rather than querying the user_id
to identify and retrieve the user again, you have to make a getName
request instead.
This will return the standard format (installations/surelock-homes-hq/users/12345678Z
) which contains the custom ID that you passed to it when you created the user.