Skip to main content
Solved

How to use a variable in HTTP connector content parameter?

  • November 9, 2022
  • 7 replies
  • 146 views

Rucha Naik
Forum|alt.badge.img+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 :

 

https://community.thinkwisesoftware.com/news-blogs-21/introducing-variables-in-process-flow-input-parameters-1343https://community.thinkwisesoftware.com/questions-conversations-78/what-is-the-format-to-write-the-body-in-http-connector-for-api-2898

 

Best answer by Rucha Naik

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

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

Rucha Naik
Forum|alt.badge.img+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.


Jasper
Superhero
  • November 9, 2022

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.


Rucha Naik
Forum|alt.badge.img+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
        }

 

 


Rucha Naik
Forum|alt.badge.img+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
        }


Jasper
Superhero
  • November 9, 2022

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/


Forum|alt.badge.img+3

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/


Rucha Naik
Forum|alt.badge.img+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}"}] 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings