Solved

How to use a variable in HTTP connector content parameter?

  • 9 November 2022
  • 7 replies
  • 130 views

Userlevel 2
Badge +5

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

This topic has been closed for comments

7 replies

Userlevel 2
Badge +5

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 +11

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
Badge +5

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
Badge +5

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 +11

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 +2

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
Badge +5

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}"}]