SAP-archive / SAPConversationalAI

✨ 🤖 🤖 Build your own conversational bot on our Collaborative Bot Platform! 🤖🤖 ✨
https://cai.tools.sap
284 stars 68 forks source link

Webhook documentation for "Custom Body" #82

Closed Toinne closed 6 years ago

Toinne commented 6 years ago

Hey,

Having some trouble figuring out the correct way to define a custom body.

In custom HTTP request bodies, you can reference conversation variables (like memory variables, NLP information, etc.) in place of hard-coded values, for example, {{memory.person.raw}}. In https://recast.ai/docs/concepts/code-and-webhook

I cannot figure out to use other variables beside the ones from memory. I would very much like to configure the senderId of the participients in the custom body, is this possible / and how ?

dbousque commented 6 years ago

If you want to uniquely identify conversations/users, you can use the conversation_id field. This is an example body :

{
  "custom_data": "data",
  "conversation_id": "{{ conversation_id }}"
}
Toinne commented 6 years ago

And would the original id (service specific id) of the sender be possible ?

I would very much like to implement facebook's handover protocol and for this you need the service id.

Would like to avoid the 2 api calls, the 1ste in order to fetch the details of the conversation and the 2nd for the recipient data.

dbousque commented 6 years ago

You also have access to participant_data, in which you will have channel specific user info, like the user id on Messenger, use {{ participant_data }}.