IDE Services 2024.3 Help

Import users and permissions via REST API

IDE Services offers a bulk user creation feature that allows you to easily add multiple users and assign their access permissions.

When using IDE Services, you can submit a request with an array of users that need to be added to the IDE Services Server. In the current implementation, the request replaces existing users in the database with the ones specified in the JSON. This means that any user not included in the array will be deleted on the IDE Services Server. Additionally, if there are any differences in user permissions or assigned profiles, these details will be overwritten as well.

Generate an automation token

To make a request, you need a valid automation token generated on the IDE Services Server.

Create an automation token

  1. In the Web UI, open the Configuration page and navigate to the Automation Tokens tab.

  2. Click Create Automation Token.

  3. In the Create Automation Token dialog, specify the token name in the Client ID field, and set the expiration date for the token.

    New automation token

Get a profile ID

The current implementation implies that you have profiles created on the IDE Services Server. In the request, you need to provide IDs of those profiles that you want to assign to particular users.

  1. On the Profiles page, click the name of the profile you want to edit.

  2. Click More options in the top right corner of the screen and select Edit profile

  3. Copy the value in the ID field.

    Edit a profile

POST api/import/users

### POST http://localhost:8080/api/import/users Authorization: Bearer {{access_token}} Content-Type: application/json { "users": [ { "sub": "user1", "email": "user1@toolbox.com", "username": "user1", "active": true, "permissions": [ { "id": "ADMIN", "type": "ROLE" } ], "profiles": [ { "id": "80adf6a6-86c6-44f4-8392-a8bef847378e" } ] }, { "sub": "toolbox.admin", "email": "admin@toolbox.com", "username": "toolbox.admin", "active": true, "permissions": [ { "id": "ADMIN", "type": "ROLE" } ], "profiles": [ { "id": "80adf6a6-86c6-44f4-8392-a8bef847378e" } ] } ] }

Parameters of the User object

sub

String

The OAuth 2.0 subject of the IDE Services user.

email

String

The email of the IDE Services user.

username

String

The name of the IDE Services user.

active

Boolean

Defines the status of the current user. If set to true, IDE Services will manage the user and consider it as active. If set to false, the current user will be created as deactivated.

permissions

Array of objects

Defines the role assigned to the current user.

Possible values:

  • Administrator:

    { "id": "ADMIN", "type": "ROLE" }
  • Regular user:

    { "id": "USER", "type": "ROLE" }

If both roles are assigned to the user, they will get the administrator role automatically.

profiles

Array of objects

Lists IDs of all profiles that will be automatically assigned to the current user.

If you provide an ID of a profile that doesn't exist yet, IDE Services will generate it automatically and name it according to the ID value.

Last modified: 15 July 2024