Go back

How to add user accounts from a file

December 12, 2022
Dimitrii Zuikov

Dimitrii Zuikov

After you have successfully deployed TrueConf Server, you need to add user accounts in the TrueConf Server control panel. You can either add user accounts manually one by one or add a group of users straight from a file with the help of TrueConf Server API.

As an example we will show you how to add user accounts from a file and divide them into the user groups. The code sample is available on GitHub.

Getting started

Code sample is written in Python. If you use Windows, please download Python from the official Python website and install it on the computer where you’re going to run the executable file (if you use Windows OS). If you use Linux you may have an integrated Python interpreter that allows you to run scripts from the terminal. To check if Python is installed on Linux, run the command python3 -V (as of 2022, version 3 remains the current version of Python).

Please note that it is not recommended to run the script on an operating system with TrueConf Server already installed. The best way to run the script is to use another computer in your local network which has access to TrueConf Server via IP or FQDN.

You also have to set up HTTPS connection and create OAuth application as shown in our article on how to get started with TrueConf Server API.

Step 1. Creating a file for import

Create a file with a list of users. The following formats are supported: .csv, .ods and Excel formats .xls and .xslx. According to the provided code sample, If a .csv file is used, it is necessary to specify the separator used in this file (check the README file in the project repository).

The table below will be used as an example:

Column name Description and example Required parameter
display_name Displayed user’s name: James Smith Yes
login_name login (TrueConf ID): Smith Yes
password User password: 12345 Yes
email Email address: smith@company.name Yes
groups Group name a user belongs to. If a user belongs to more than one group you should specify all the group names separated by commas and without spaces, e.g.: IT,Sales No
avatar Path to the avatar image: avatars/01.png No

Step 2. Reading data from the file

Build groups and users list using the Excel file you created earlier. We used pyexcel package to code as an example.

Step 3. Adding user groups

API 3.2 introduced in TrueConf Server 4.5 is used in this and subsequent commands. If you are using the video conferencing server supporting the later version of the API, you can substitute v3.2 with the proper version in the HTTPS request string. Read this guide to check the correspondence between TrueConf Server versions and its APIs.

Use Create Group POST request for each group name in the list you built in step 2, for example:

where {{$access_token}} is an access token created as shown in our article on how to get started with TrueConf Server API, e.g., dvN1tpoy7BmVhN8nUMzXcqJ8vsDYt4IN.

Specify a JSON group name in the request body, e.g.:

If the group has been added to TrueConf Server successfully you will get JSON object Group.

Step 4. Adding users

Use Create User POST request for each user name in the list you built in step 2 e.g.:

and specify filled object User JSON in the request body, for example:

If the user has been added to TrueConf Server successfully you will get JSON object user with the user’s data.

You can also edit existing TrueConf Server user accounts by using Edit User PUT tag.

Step 5. Adding avatars

Use Create Avatar POST request to add an avatar to a user account:

To add an avatar you should convey the image file in POST request. For instance, if you use Postman testing algorithm you should choose  form-data data type in Body tab below the POST request area and choose file parameter in the drop-down list on KEY area, then register image parameter and click Select Files to choose an image:

How to add user accounts from a file 1

Step 6. Adding users to groups

To divide users into their respective groups you should do the following:

  1. Use Get Group List GET request to obtain TrueConf Server group list:

  1. Register each group name to which you need to add a user, e.g. IT.
  2. Find a name of the respective group you need in the groups list, i.e., "display_name":"IT", and save its unique ID, e.g., "id": "0001".
  3. Use Add User POST request to add a user to the respective group by its ID:

and specify the sent JSON object:

{"user_id":"ivanov"} as account ID.

Deleting data on TrueConf Server

You can delete multiple TrueConf Server user accounts at the same time by specifying the list of their TrueConf IDs. To delete the chosen user accounts, please make Delete User DELETE request.

If you want to delete the group you should get its unique ID from the group list (as in Step 6 when adding users to the groups). You can delete the respective group by using Delete Group DELETE request.

Please note that the data will be deleted permanently without the confirmation request. Pay proper attention while making DELETE requests and make sure that you specify the required parameters.


Still have questions? Please contact our support team directly via online chat.

Sign up for newsletter