cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1872
Views
0
Helpful
7
Replies

Rest_Client Element

phanivenigalla
Level 1
Level 1

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"

},

1 Accepted Solution

Accepted Solutions

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.

ss1.PNG

View solution in original post

7 Replies 7

janinegraves
Spotlight
Spotlight

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 { }

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}

},

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?

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.

ss1.PNG

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.

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.

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