cancel
Showing results for 
Search instead for 
Did you mean: 

How to use memory variables in GET method when calling external API?

arviii
Discoverer
0 Kudos

Hi everyone,

I'm developing a simple chatbot that gives infos about Sales Orders available on our S4 on-premise system.

Connection beetwen convAI and the OData service published on our local system is working pretty well, and i was trying to extract infos of a specific SO starting from the SO number inputed from the user in the chat.

To do so, I thought I had to pass the memory.salesorder-number in the GET method when calling the external API.

What I'm still unable to understand is how can I put a variable in the service url to specify the key of my entityset.

I was expecting to write something like this https://my-machine/odata/SAP/ZINN_SALESBOT_DEMO_SRV/SalesOrderSet('{{memory.salesorder-number}}') but i found out that putting the symbol "{" in the textfield make the entire web-page to freeze forever!

Am i missing something? What's the correct way to specify a key via memory variable for a get_entity to external API?

Thx a lot for your support,

Valerio

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member311453
Discoverer

Hello Valerio,

we are also call S/4 back end system and our API URL is enhanced by memory variables. The result looks like this:

https://OUR_HOST/{{memory.business_object.metadata.serviceURLBase}}{{memory.business_object.metadata...


I hope it will help you.

Regards,

Michal

arviii
Discoverer
0 Kudos

Hi Michal,

thx a lot for your answer.

So that means i correctly understood how to compose the URL.

But the problem still remain, when i input from my keyboard(or copy-paste) the graph parenthesis "{" in any position of the URL field of the API Service configuration the entire CAI web page freezes forever, making me unable to click in any point of the page until i refresh the page on my browser.

Is this maybe a bug of the web-page?

I tried on Chrome, Firefox and IE and the behavior it's always the same.

I created this gif to let you see what happens:

https://imgur.com/a/Rvd3qiI

I first try to add a "(" bracket and it works, than i input "{" and all freezes.

Hope this helps to understand the issue.

Thanks,

Valerio