When working with data from web services and making HTTP requests in Zammo, there are some tips we recommend.
Following these tips will help simplify how you work with web services and HTTP requests in your conversational AI solution.
You can't always depend on an API behaving as expected, so it’s crucial to handle API failures gracefully.
One way to do this is to run alternative logic if the statusCode
property of the web service response does not equal 200 (success).
You can implement this by using a Branch: If/else condition. You can see this here:
In this situation, you can guide the user down an alternative branch of the conversation. You can also decide to give them the opportunity to retry.
Your conversational AI might expect data to conform to a specific type—whether it’s a complex object (like JSON) or a primitive type, such as a number or string. The adaptive expressions in the Type Checking category can help you with this. At the time of writing, the following are supported: