Skip to main content

Hi,

 

We are having a central (non-thinkwise) HR system for maintaining our employees. Ideally we would like to call an API on IAM to create a new user as well as to de-activate an existing user (settting USR.END_ON date) from this HR system. 

Do these API's exist and if so, where can we find the documentation to use them? 

thanks

 

Hi Bart,

Indicium offers a wide range of API endpoints for you to utilize. These are the same API endpoints the Universal GUI uses to write/read data. 

To create a User inside IAM, you can use the following cURL:

curl --request POST \
--url https://...../indicium/iam/iam/usr \
--header 'Authorization: Basic .....' \
--header 'Content-Type: application/json' \
--data '{
"tenant_id": 1,
"usr_id": "bob",
"first_name": "Bob",
"sur_name": "Bobbson",
"gender": 0,
"time_zone_id": "Etc/UTC",
"appl_lang_id": "ENG",
"authentication_type": 3
}'

Replace the dots and maybe other values with the correct data. You can also extract the URL and JSON data and paste that inside a program like Insomnia or Postman to run the POST request.

Running the above code will create Bob as user.

 

To set his password, you can use the following cURL:

curl --request POST \
--url 'https://...../indicium/iam/iam/usr(tenant_id=1,usr_id='bob')/task_set_usr_password' \
--header 'Authorization: Basic .....' \
--header 'Content-Type: application/json' \
--data '{
"new_password": "hunter1",
"confirm_password": "hunter1"
}'

Running the above code will set the password for Bob to “hunter1”.

 

To assign him a user group, you can use the following cURL:

curl --request POST \
--url https://...../indicium/iam/iam/usr_grp_usr \
--header 'Authorization: Basic .....' \
--header 'Content-Type: application/json' \
--data '{
"tenant_id": 1,
"usr_id": "bob",
"usr_grp_id": "Default user group"
}'

Running the above code will assign Bob to the user group “Default user group”.

 

To prevent Bob from logging in, you can use the following cURL:

curl --request PATCH \
--url 'https://.../indicium/iam/iam/usr(tenant_id=1,usr_id='bob')' \
--header 'Authorization: Basic .....' \
--header 'Content-Type: application/json' \
--data '{
"end_on": "2022-09-13T00:00:00Z"
}'

Running the above code will ensure Bob cannot log in anymore in any application after September 13th from 00:00.

 

Hope this helps!

Credits to @Anne Buit for providing the code samples