This article gives an overview how to create, list, query, resend and delete user invitations by using the CustomerID REST API.
It is possible to handle creation and management of new users and the invitation process using CustomerID REST APIs. Typically a target application includes the relevant calls within the target application user interface. See Complex invitation form example using CustomerID API for an example.
Introduction to Pending User concept
When populating a new system with users from an existing list, such as an excel spreadsheet or CSV file, there are two different techniques:
The API call MOD009 Create User will create a user account that is ready to use. This is usually used when all of the information about a user is already known, including the password. It assumes that the user has somehow already given consent for having an account created (e.g. based on an existing contract or based on a third-party user interface shown before invoking this command)
Roles can be assigned to user immediately after creation.
See MOD009 Create User API call.
The second method is the API call MOD026 Create Pending User. This call will create a user account that is not yet activated. The Ubisecure CustomerID system will send an email invitation to the user, inviting them to follow a link to activate the account. During activation, the user will have a chance to interactively approve any terms and conditions, set a password, change or modify any permitted attributes and enable strong authentication methods, such as SMS OTP and Print out OTP.
Roles cannot be assigned to a pending user before it the invitation has been accepted.
See MOD026 Create Pending User API call.
A call to either command will be required for each new user to be added.
Create user invitation
Use operation MOD026 (Create Pending User):
Depending on your use case, you might want to save the resulting CustomerID internal user ID (762983ae-ead7-4e3a-9281-a21898dafd4c above) to the user profile of your application. It is not straightforward to fetch the invited user e.g. by using the email address.
Query/modify invited user
If you have stored the CID user ID, you can simply use the operation REQ002 (Query User) to get the user attributes. Status "Pending" indicates that the user has not yet used the registration link in the invitation email.
You can use the operation (MOD004 Update User) to modify the attributes of the invited user. This may be useful for example if the user name was incorrect in the original invitation and it was later corrected. Note that no new invitation email will be sent, but the user will see the updated values in the account registration form.
Resend a user invitation
There is no direct way to generate a new invitation message if for example the invitee has lost the original message or the email for some reason couldn't be delivered. CustomerID will automatically send the invitation link again within reminder messages according to the configuration. If the invitation explicitely must be sent again, you can delete the invited pending user (example follows later in this article) and generate a new invitation by using the operation MOD026 (Create pending user).
It is also possible to generate the invitation link and send it directly to the invitee without using CustomerID. Here is an example invitation email generated by CustomerID when using MOD026 (Create pending user):
You can compose the registration link by using the operation REQ015 (Query Registration):
List all user invitations
Use the operation REQ013 (List Registrations) to list all pending user invitations:
You can then use REQ002 (Query User) to get attributes of each pending user.
Delete user invitation
If you need to delete an invitation completely, use MOD010 (Delete User):
Using the above APIs it is possible to implement creation and management of new users and the invitation process. Typically a target application includes the relevant calls within the target application user interface. See Complex invitation form example using CustomerID API for an example.