cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
201
Views
0
Helpful
6
Replies
Highlighted
Beginner

Rest_Client Element

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
Beginner

Re: Rest_Client Element

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

6 REPLIES
Rising star

Re: Rest_Client Element

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

Beginner

Re: Rest_Client Element

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}

},

Rising star

Re: Rest_Client Element

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?

Beginner

Re: Rest_Client Element

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

Beginner

Re: Rest_Client Element

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.

Cisco Employee

Re: Rest_Client Element

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.

CreatePlease to create content
Ask the Expert- Webex Hybrid Services Solutions