Solved

How to use a variable in HTTP connector content parameter?

  • 9 November 2022
  • 7 replies
  • 81 views

Userlevel 2

Hi,

For the project, I need to create users in IAM via universal. Created a process flow for the same. I am able to create a user with static parameters. However, for a dynamic variable its giving error.
Please guide what am I missing.

 

variables used in process parameter:

content parameter:

[  {       "usr_id": {email_id}
           ,"first_name":  "test1"
           ,"sur_name": "naik"
           ,"appl_lang_id": "ENG"
           ,"authentication_type": 3
           ,"email":  {email_id}
           ,"allow_change_password": 1
           ,"password_expiration_policy": 0
        }]

URL:

http://hrms.app.sisar.nl/indicium_dev/iam/iam/usr(tenant_id=1, usr_id={email_id})/task_set_usr_password

process variable : email

I took help of below :

 

 

icon

Best answer by Rucha Naik 16 November 2022, 17:52

View original

7 replies

Userlevel 2

Hi Jasper,

I updated the JSON, as below :

[  {       "usr_id": "{email_id}"
           ,"first_name":  "test1"
           ,"sur_name": "naik"
           ,"appl_lang_id": "ENG"
           ,"authentication_type": 3
           ,"email":  "{email_id}"
           ,"allow_change_password": 1
           ,"password_expiration_policy": 0
        }]

Synced IAM , also refreshed model while using the GUI. Still getting below error :

Please guide.

Userlevel 7
Badge +9

Hi Rusha, 

As Mark mentioned here, the content should not have the square brackets around the JSON.

Also, you should remove the quotes from the variable value.

Userlevel 2

Hi Jasper,

I removed the [] brackets and retried, still its giving the same error.

  {       "usr_id": "{email_id}"
           ,"first_name":  "test1"
           ,"sur_name": "naik"
           ,"appl_lang_id": "ENG"
           ,"authentication_type": 3
           ,"email":  "{email_id}"
           ,"allow_change_password": 1
           ,"password_expiration_policy": 0
        }

 

 

Userlevel 2

I removed the quotes for the variable as well and tried, giving same issue.

 

  {       "usr_id": {email_id}
           ,"first_name":  "test1"
           ,"sur_name": "naik"
           ,"appl_lang_id": "ENG"
           ,"authentication_type": 3
           ,"email":  {email_id}
           ,"allow_change_password": 1
           ,"password_expiration_policy": 0
        }

Userlevel 7
Badge +9

Hi Rucha, 

I meant the quotes from the variable value here:

If this still doesn't work you could write the value of the content variable to a logging table (using a process procedure for example) and check if the JSON is valid on this website: https://jsonlint.com/

Userlevel 4
Badge +1

Hi Rucha,

You might also want to catch the HTTP Response headers in a process flow variable. It might contain a TSFMessages header with the error.

This error is Base64 encoded which you can convert here:
https://www.base64decode.org/

Userlevel 2

Hi All,
Below is the format that worked for variable inputs:

URL : 

http://abcv/iam/iam/usr(tenant_id=1, usr_id='{email_id}'

Content: 

{       "usr_id": "{email_id}" 

           ,"first_name":  "test1" 

           }

Header: 

[{"key": "Authorization","value": "Zoho-oauthtoken {Authorization}"}] 

Reply