Rest API
Last updated
Last updated
While running the conversation flow you have the option to call any API. Just define the Method to be used, the API Url, and, if you prefer, the Parameters and Type of Parameters to be sent.
If you want to handle the API return response, you can use Javascript code. The response will be available through the variable: response__x.
If the return is a Javascript object (JSON format), when treating it in the code remember to check if it is not Null to avoid errors. And if the return is a string and you want to use it in the code as JSON, remember to convert it to JSON using the JSON.parse (response__x)
If you want to save the return in some custom object field, remember that the JSON format is not allowed as field type. So you'll have to convert it to String, using the JSON.stringify (return_example) method, and then save it. Then, if you want to use this field in the future, remember to convert it back to JSON using the JSON.parse method (return_example)
There is a 15-second execution timeout. So if you pass this limit the API call will be interrupted and an error will be returned that can be queried in the conversation history.