Syncing Roles
Before syncing a user’s roles, the user needs to exist, and be a staff member at your tenant. You can invite a user using the InviteStaffUser endpoint. This endpoint will return the user’s id even if they already exist, though you cannot change the name of an existing user (the endpoint will still return existing user’s ids, and users can manage their own name).
Setting Roles
With the user’s id you can now call SetRoleBindings. For staff users you will be granting them roles on either a Tenant or location. The roles for a user and resource are expected to be exhaustive, so calling this endpoint with no roles will remove all of user’s access to a given resource.
Getting Locations
Assigning roles for the entire tenant is fairly straightforward as that can be hardcoded, but in order to get the Location Id you will need to use GetOrCreateLocations. This endpoint will take the id of the location in the remote system, and will also need Bushel’s id for your remote system, called a datasource. This datasource will need to be provided to you by Bushel. The endpoint currently takes an integration id, which should be {datasourceId-sourceId}. This field may be deprecated in the near future, but it’s important to format it in that way for now
General Information
To use these endpoints you will need some information which will be provided for you by Bushel.
-
Service Token - This is your authorization token for these endpoints used in headers: Authorization bearer {serviceToken}
-
Tenant ID - Your company has a specific tenant id inside Bushel, and all of these endpoints require it in the headers
-
Role IDs - Roles are groups of permissions that can be granted to users at either then Tenant or Location level. We will provide the ids of these roles for you
-
Datasource IDs - If you need to get the IDs of your locations, you will need to know the datasource ID for that location. Bushel will provide the ID of each datasource your company has