10-26-2017 06:03 AM
Hi,
I am using Rest_Client Element to send data to API for Authentication, When i give static text in Body i get success, where as when i substitute some of the fields in Body with session Data i get 500 error, I am thinking the value is not substituting with {Data.Session.s_ANI} in Body text
Eg: How i am trying to do below, i am trying to substitute identifier with sessionData. When i give static value in "XXXXXX" that gives me success 200.
Please let me know how to substitute the values required in Body.
{
"serviceData": {
"loggingId": "demoeloyLogId" },
"userData": {
"identifier": {Data.Session.s_ANI}
},
"processingInformation": {
"biometric": {
"type": "text-dependent",
"mode": "td_demo"
},
Solved! Go to Solution.
10-30-2017 01:38 AM
As a workaround, you can write a custom action element class and build your response body in java code using as many session data as you want and then set the final body string to a session variable and on the rest client element, use that variable as the body.
10-26-2017 06:39 AM
I believe there's a bug that cisco needs to patch where it doesn't know
how to substitute a variable as variable substitution uses the same
syntax structure { } as json uses { }
10-26-2017 06:47 AM
Thanks Janine for quick reply.
since there is bug, we could not use session data in substitution?
like this highlighted below
{
"serviceData": {
"loggingId": "demoeloyLogId" },
"userData": {
"identifier": {Data.Session.s_ANI}
},
10-26-2017 07:03 AM
It looks like Cisco has created a Defect (CSCve44607) to fix it in 11.6 .
For now, I don't know how you can sub a variable into the JSON string.
Does anyone have a workaround for this?
10-30-2017 01:38 AM
As a workaround, you can write a custom action element class and build your response body in java code using as many session data as you want and then set the final body string to a session variable and on the rest client element, use that variable as the body.
10-30-2017 05:12 AM
Thanks Isil,
I am doing exact same thing right now. Body= {Data.Session.RequetString} But when comes to formation of bigger JSON string its a more of work around, if Cisco fix the bug for substitute of session/element data in place of required fields then it would reduce significant time of effort.
11-05-2017 04:08 PM
If you pre-build the HTTP body in a Local Variable and then reference that in the REST Client element you should find substitution works OK.
12-04-2019 09:11 PM
Hi I am trying to call REST service GET method using Rest_client element. I am passing parameters as below
parameterName into Name column and Value in to value column as {Data.Element.1007_Reset_Complete.eApiID} or {Data.Session.eApiID} this is not making successful REST call. whereas if i pass the static value in Value column i am able to make it to REST call and getting response.
What is the format to assign parameterValue here .
Thanks,
Phani
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide