How to use Web-API in conversational flows?

What is web-API?

Web-API is a type of card in conversational flows that allow you to send data you've collected during the flow to an external app or server by using HTTP methods like POST and GET. The response data received from the target is being saved in the current flow as dynamic parameters and you are able to use that data in the next steps of your conversational flow.

Creating a Web-API card

First, go to the sidebar and click on the Web-API option.

Clicking this option will redirect you to the Web-API card editor modal.

On that modal, you will be able to fill in the URL target of your Web-API request and the method you choose to use.

In case you choose to use the Post HTTP method you will have the option to send a customized JSON body content (This field is not required). Underneath the JSON text editor, there is a test button that is used to send a test request to the target URL.

On the upper-right side of the text editor, you have a button that opens a dropdown of parameters that exists in the current flow, you can choose those you wish to insert into the request body content.

Under the "Advanced settings" tab you will have the ability to include request headers to the request.

At the bottom of the modal is the section where you decide what will be the action that will happen after the flow gets the response back from the target URL.

If you choose to send a test post request, a modal will open and you will have to fill a sample data that will replace the parameters that are in use in your JSON body content.

After you send a test request, the response will be shown underneath the test button.

Example card

Let's say you have the mail of the customer and you want to get some additional data such as userId and name of the customer from your API. This is how your card would like at the end:

How did we do?

Powered by HelpDocs (opens in a new tab)