When working with data from web services and making HTTP requests in Zammo, there are some tips we recommend.
Use these to make working with data from web services and HTTP requests simpler in your conversational AI solution.
You can’t always depend on an API behaving as expected.
A good practice to get into is to create logic that handles an API failure 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 might also decide to give them the opportunity to retry
Sometimes your conversational AI solution will expect data to belong to a specific datatype.
This might be a complex object (JSON) or a primitive type such as a number.