TIKS VMS - CSV Upload for Admin Users
Following are the steps to bulk import CSV file as the admin users in the admin portal.
- Login via the admin portal at
https://<domain>/dashboard
with your admin credentials. - Find the valid API Key under the global settings tab.
- Prepare the CSV file. The template file can be downloaded form users tab by clicking bulk import and download template.
- If you do not want to remove certain users, make sure you have the record in CSV file to be imported. Note: TIKS recycles every user from the CSV file, this means if a user is not in the CSV file but exist in the current system, this user will be deleted.
- Request bulk import.
- Using cURL Command:
curl -X POST \
https://<domain>/sync-admin-users \
-H 'Accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-H 'cache-control: no-cache' \
-H 'x-api-key: <x-api-key>' \
-F file=@./users.csv
Please note the Content-Type and Accept header parameters. They should be `application/json` & `multipart/form-data` respectively. Send the API key in the header with x-api-key parameter, as in the command.
If you want to have these error messages stored in a text file, the append file name at the end. Make sure to adjust the path for output.txt file.
curl -X POST \
https://<domain>/sync-admin-users \
-H 'Accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-H 'cache-control: no-cache' \
-H 'x-api-key: <x-api-key>' \
-F file=@./users.csv >> output.txt
Please review the response payload if there is validation error, the below will be returned{"success":false,"errors":[{"line":2,"msg":{"email":["The email format is invalid."]}}]}
Validations And Race Conditions
- Ideal waiting time for each record sync is 1 minute. For the records to be synced properly, please wait one minute before another sync request.
- Users won't be inserted into the system until all the records in the CSV file is valid. It validates the entire file first, and if it passes the validation then starts to sync.
If you don't have CURL installed by default, follow these steps to install cURL in your machine (Windows).
The easiest way to check whether the curl is installed or not is by typing following command in the command prompt.
curl --help
Now that you have your CSV file, you will need to ensure your system can use the cURL command correctly. As some systems (such as Windows computers) do not support cURL by default and it may be necessary to download cURL. To ensure you are running the correct version of cURL, please follow the steps below:

8. Once the file has downloaded, navigate to it and find the curl.exe file. This will be in the “bin” folder.
9. In Windows computers, hold shift and right-click on the curl.exe file. After doing so, a drop-down menu should open up, please click on Copy as Path(using the default click only).

10. Open your default terminal and paste the path in there (remove the quotes around it). It should read similar to:

"C:\Users\vani\Downloads\curl-7.64.1-win64-mingw\curl-7.64.1-win64-mingw\bin\curl.exe" -X POST "https://<domain>/sync-admin-users" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -H "x-api-key: <x-api-key>" -F "file=@users.csv"
Update the file path.
CSV Upload Schedular
Windows
Task Scheduler makes it easy to upload a CSV on a periodic basis. The following instructions assume cURL is installed into a directory in the PATH environment variable.
1. Open Task Scheduler. This is found in Start > All Programs > Administrative Tools > Task Scheduler.

3. On the right, in the Actions pane, select Create Basic Task.

4. Give your task a name and description, and click Next.

5. Select the frequency that you would like the CSV to upload. Daily uploads are recommended.
* If your database system triggers an event when it exports as a CSV, select “When a specific event is logged” instead, and navigate to the event.

6. Set the time you wish to automatically upload the CSV.

7. Check Start a program.

8. Paste the cURL command into the Program/script box. Make sure to change the file path to the CSV you wish to upload.

9. If a message box appears, select Yes.
10. Select Finish, and every day at your specified time, the CSV will be uploaded.
11. The entire output can be saved into a file.