cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Chatbot - API Response JSON can't use because dot is problem

01-21-2022 2:09 PM
baris61 Explorer
1612 views 5 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

The api response is as follows in Postman.

I can get answer when I try to connet API. I can reach body. As follows;

But i can't reach other field in body. Because the dot in the directory name is the problem(ZCRM_MOB_LOGON.Response). As follows;

I'm stuck with this problem. Can you help me?

Best Regards.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

JonasB
Advisor
Advisor

Hi Baris,

alternatively you should also be able to access it as

{{api_service_response.kullanici.body.[ZCRM_MOB_LOGON.Response]}}
Regards
Jonas
baris61
Explorer
0 Likes

Hi Jonas,

Thanks for answer. This is works.

Answers (1)

Answers (1)

JonasK
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Baris,

you could use the "lookup" helper like this:

{{lookup api_service_response.kullanici.body "ZCRM_MOB_LOGON.Response"}}

Make sure you use quotes around the second parameter.

Here you can find the documentation of all helpers.

Best regards,

Jonas

baris61
Explorer
0 Likes

Hi Jonas,

Thanks for answer. I tried like your code. I got invalid JSON the error. "ZCRM_MOB_LOGON.Response" actually is api's body. For example I want to reach "E_KOD" in "ZCRM_MOB_LOGON.Response". It did not work. My opinion is because "ZCRM_MOB_LOGON.Response" is the body. Maybe it would work for the "E_KOD" space.

Best Regards,
Baris.

JonasB
Advisor
Advisor
0 Likes

Hi Baris,

looks like the JSON node you would like to access is an object/array, which requires you to use the "json" helper to output it as JSON:

{{json (lookup api_service_response.kullanici.body "ZCRM_MOB_LOGON.Response") }}

Regards

Jonas