Bulk User Add

Description

Bulk User Add is a CallReporter utility that allows admins to System admins to add users in bulk to CallReporter via CSV.

CSV Fields

The Bulk User Add takes a .csv file as an argument.

USERNAME,PASSWORD,LEVEL,SERVICE_PROVIDER_ID,GROUP_ID

  • USERNAME - The username of the user to add.
  • PASSWORD - The password for the user. This will be encrypted before being added to the system.
  • LEVEL - The admin level of the user. Options - System, ServiceProvider, Group
    • System - Can view all data for the all Clusters.
    • Cluster - Can view all data for the Cluster.
    • ServiceProvider - Can only view data for the Service Provider and below.
    • Group - Can only view data for the Group and below.
  • CLUSTER - The cluster to limit the User to. Required for Cluster level and lower.
  • SERVICE_PROVIDER_ID - The id of the service provider to limit the user to. Only required for Service Provider and Group Level
  • GROUP_ID - The id of the group to limit the user to. Only required for Group level. Note that this field also requires the SERVICE_PROVIDER_ID field.

Setup

The script is located in the CallReporter install directory (usually /opt/CallReporter/bulkUserAdd).

  1. Replace default REPORT_URL with the correct value for your system.
    • REPORT_URL="http://127.0.0.1:8080/api/users/add" -> REPORT_URL="http://<CALLREPORTER_HOSTNAME>:<CALLREPORTER_PORT>/api/users/add"
  2. Replace default admin user in curl command.
    • curl --user admin:Slick-Green-I -X POST -F "file=@$1" $REPORT_URL -> curl --user <YOUR_USERNAME>:<YOUR_PASSWORD> -X POST -F "file=@$1" $REPORT_URL

Usage

Command - ./bulkUserAdd <PATH_TO_CSV>

Output

Upon completion, the number of successful and failed adds will be displayed. To see why certain adds failed, view the logs in <CALLREPORTER_HOME>/logs/callreporter.log.

Sample Output

Successfully added 3. Failed to add 1. Check logs for details.

Error From Log

Error - Line 4: Username User1 is already in use.

Indicates that line 4 in the provided csv failed to be added due to the username already being in use.