English

⌘K
  1. Home
  2. English
  3. Flow Designer
  4. Assign API output to a slot variable

Assign API output to a slot variable

To be able to use the output of an API call, you can assign any property of the object returned from the call to a slot, by following this procedure:

Test your API:

How to try the API call

Get the response JSON object:

the API response

If you want to insert the data you received from the API call into a slot, in order to reuse it later, you can assign it to the slot the value of one of the properties returned from the call.

Use the JSONPath syntax, as shown in the image below:

How to assign the API value to chatbot variable

Give the slot name a meaningful name and a return value from the call:

How to assign the API output response value in a custom chatbot variable

From the “bot calls an external API” block your assignment will be added:

chatbot slot assignment

To use the value, simply recall the name of the slot you created:

chatbot replies with slot value

NB: Assign the values of the data received in the response to the bot’s slots, so that it knows how to use them. Indicate the answer keys in jsonpath format.