Add Multiple Users from a CSV file and an API
In some cases, you would like to add many users in bulk.
The users are often managed in a CSV file.
With the following steps, you will be able to insert users from a CSV file by converting the CSV file to a JSON format and run it with an API through the Swagger.
Steps:
1. Prepare a CSV file with the following columns (case sensitive):Â
|
|
userName |
firstName |
lastName |
roleId |
groups/0 |
|
Test10 |
FName10 |
Lname10 |
5d072c7b94278724f71ba2e5 |
5f477932c87fea1354e3e781 |
|
|
Test11 |
FName11 |
Lname11 |
5d072c7b94278724f71ba2e5 |
5f477932c87fea1354e3e781 |
|
|
Test12 |
FName12 |
Lname12 |
5d072c7b94278724f71ba2e5 |
5f477932c87fea1354e3e781 |
- email - User's email
- userName - User's user name
- firstName - User First Name
- lastName - User Last Name
- roleId - The role you would like to assign the user.Â
- The roles are - admin, contributor, consumer and dataDesigner
- You need to apply the roleId for each type of role.Â
- Note that each Sisense installation has a different roleId for similar role names.Â
- You can get the roleId for each role name by running the GET command in the Role group in Swagger 0.9.
- groups/0 - The group id you want the user to be part of
- Note: The groups have to exist. Use the Swagger 0.9 -> Groups -> Get -> Groups to get each group’s id.
2. Use a utility to transform the CSV file into a JSON format for example http://convertcsv.com/csv-to-json.htm)
 Note:
- After adding the new users, an activation email will be sent to each. The users then would need to set the initial password.Â
- If you wish to set an initial password and for the user only to get a Welcome message, then add a password column.
- In the JSON you will see another line looking like this:Â Â "password":"Sisense!1234"
3. Copy the JSON expression and paste it in Swagger 1.0 -> Users-> Post-> /users/bulk and execute.
- If you get response code 201...you made it 🙂
4. Check the users and groups in Admin - > Users
Enjoy and share 🙂
Tamir
0 comments