Add users in bulk to Automation Hub through OpenAPI

How to upload bulk users into Automation Hub using OpenAPI?

Issue description:

The Upload CSV feature to import users in bulk is currently not available on Automation Suite.

Resolution:

Since the the upload csv function is not yet available in Automation Hub in Automation Suite, as a workaround the upload of bulk users can be performed using API calls.

  • First, generate a token from Automation Hub as mentioned here.
  • The csv template should have the following structure:
    • user_email,user_first_name,user_last_name,user_location,user_department,user_business_unit,user_job_title,user_is_active,user_invite_status,role_id1,category_id1

  • Download the Postman collection from this link and import it in the Postman workspace from Collections (on the left side) (more details here)
  • Once imported, on the left side expand the "Users" then expand "POST Add users" and click on "POST Add Users Pending (Variables)"
  • There fill in the endpoint which should have the following structure {fqdn}/automationhub_/api/v1/openapi/adduser
  • In the Headers tab, make sure the following headers are added/changed:
  1. x-ah-openapi-app-key which is the App Key of the token generated in AutomationHub
  2. Authorization should be "Bearer" + the token generated in Automation Hub
  • The Body is already there and it will be populated with the values from the csv file
  • When finished, it should look like this

  • To run the collection click on the collection name Automation Hub API_Latest and click on Run

  • After than, deselect all Run orders and keep only "Add User Pending (Variable)", upload the filled csv file and click on Run

If successful, it should respond with status 201 Created, as below:

The users will appear under Admin>manage access>assign roles>users in Automation Hub, but they will remain in Pending state until they login for the first time.