cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to send json payload with Post Request in SAP conversational AI

2,168

Hi Experts ,

i am implementing a crud operation using conversational AI , i am successfully able to connect S/4 HANA to conversational AI through ODATA provisioning and able to read the data from ODATA service , Now my doubt is in creation/updation of record at S/4 HANA i want to send the Json payload from conversational AI along with my ODATA Service URL , but i am not getting any documents or blog how to do it .

Accepted Solutions (1)

Accepted Solutions (1)

Hi Nitin,

In Action tab, before passing the JSON payload data to SAP using POST call, we need to fetch the X-CSRF token first, for this we need to make a dummy call using GET method as below screen.

Once CSRF token is fetch need to make a POST call and provide below required information.

capture1.pngcapture2.png

similar way you can pass the payload data to SAP.

Answers (3)

Answers (3)

Yogananda
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi nitssaxena2608

Try to use webhook method and build it through python/nodejs script calling odata service and upload it BTP cloud foundry service.

you can see many examples from blogs :

https://cai.tools.sap/blog

0 Likes

Hi Rajesh ,

How you were able to read Empid and Notes from Bot , can you please tell me how you created entity, skills and actions to read the Value from Bot , as i can see you are passing multiple value dynamically , I have same type of requirement i want to read the multiple input from Bot in order to create the record in S/4 HANA , currently i am hardcoding all the value in my Body section and using Post request

0 Likes

json-payload.pngHi Rajesh ,

OData service URL is only accepting post request , i am using standard API of sales order simulate where i am doing pricing simulation ,i am able to get the data but not able to Post .

One more issue i am getting data in XML Format in OData service as a response $format=json is not supported and Bot only understand the json format , from where i can change the data in Conversational AI from XML to json ? can we write script any where in BOT

i am passing below URI in Consume API in Actions of conversational AI and passing the json payload in Body

gattumahesh_at
Explorer
0 Likes
where you able to post mutiple records in POST ?