Your conversational AI application can consume external systems or services by making HTTP requests. The Send an Http Request action contained within UI Builder makes this possible and has support for the following verbs:

This is a available from the Access External Resources menu in UI Builder and can be added like any other action.

In this How To you'll learn how to make a GET request to a publicly available web service, check the Http Status code and output the data in your conversational AI application.

Step 1 - Setting Up The Http Request

Here we create the Http Request action and set the relevant properties. For the purpose of this How To we'll use a free and publicly available API call Cat Facts. This API returns random facts about cats and is invoked using a GET request.

A successful call to this API will return the following JSON:

{
	“statusCode”: 200,
	“reasonPhrase”: “OK”,
	“headers”: 
	{
		“Server”: “nginx”,
		“Transfer-Encoding”: “chunked”,
		“Connection”: “keep-alive”,
		“Vary”: “Accept-Encoding”,
		“Cache-Control”: “no-cache, private”,
		“Date”: “Mon, 11 Oct 2021 18:47:22 GMT”,
		“X-RateLimit-Limit”: “300”,
		“X-RateLimit-Remaining”: “299”,
		“X-Frame-Options”: “SAMEORIGIN”,
		“X-XSS-Protection”: “1; mode=block”,
		“X-Content-Type-Options”: “nosniff”
		},
			“content”: 
				{
				  “fact”: “The ancestor of all cats is the African Wild Cat which exists today.”,
				  “length”: 83
				}
}
  1. Add a new Send an Http Request by clicking on the + node in the designer canvas: