Sisense Community logo
    • Community Feedback
    • Chapters
    • Events
    • Forums
      • Help and How To
      • Product Feedback Forum
      • Strategy & Use Cases
    • Blogs
    • KB Docs
      • KB Docs
      • Add-Ons & Plug-Ins
      • APIs
      • Best Practices
      • Blox
      • CDT
      • Cloud Managed Service
      • Data Models
      • Data Sources
      • Embedding Analytics
      • How-Tos & FAQs
      • Onboarding
      • PySisense
      • Security
      • Sisense Administration
      • Sisense Intelligence & AI
      • Troubleshooting
      • Widget & Dashboard Scripts
    • Support
    • Learning
      • Sisense Academy: Free Courses and Certifications
      • Official Developer Documentation
      • Official Product Documentation
      • Official Sisense Youtube Channel
      • Sisense Compose SDK Playground
    • Use Case Gallery
    All PostsDiscussionsBlogsIdeasQuestions
    Leaderboards
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Discussions
    • Knowledge Base DocsChevronRightIcon
    • APIsChevronRightIcon
    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): 

    email

    userName

    firstName

    lastName

    roleId

    groups/0

    test10@test.com

    Test10

    FName10

    Lname10

    5d072c7b94278724f71ba2e5

    5f477932c87fea1354e3e781

    test11@test.com

    Test11

    FName11

    Lname11

    5d072c7b94278724f71ba2e5

    5f477932c87fea1354e3e781

    test12@test.com

    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)
    [<br/> {<br/>   "email": "test10@test.com",<br/>   "userName": "Test10",<br/>   "firstName": "FName10",<br/>   "lastName": "Lname10",<br/>   "roleId": "5d072c7b94278724f71ba2e5",<br/>   "groups": [<br/>      "5f477932c87fea1354e3e781"<br/>   ]<br/>},<br/> {<br/>   "email": "test11@test.com",<br/>   "userName": "Test11",<br/>   "firstName": "FName11",<br/>   "lastName": "Lname11",<br/>   "roleId": "5d072c7b94278724f71ba2e5",<br/>   "groups": [<br/>      "5f477932c87fea1354e3e781"<br/>   ]<br/>},<br/> {<br/>   "email": "test12@test.com",<br/>   "userName": "Test12",<br/>   "firstName": "FName12",<br/>   "lastName": "Lname12",<br/>   "roleId": "5d072c7b94278724f71ba2e5",<br/>   "groups": [<br/>      "5f477932c87fea1354e3e781"<br/>   ]<br/>}<br/>]
     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
    intapiuser
    By
    intapiuser
    Posted 3 years ago
                                           
             
    0 comments

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                   
                                                                                     
    •                                                              
    •                                                              
    •