External requests open your bot up to the world of external services!

Here's a list of free APIs to get an idea of the type of things you can do with external requests.

In this article I'm going to show how to implement a slash command that uses an external request to get a cat fact.

I'm going to save the cat fact to a member field called Cat Fact. So if you're following along, make sure you create this member field first! Learn more about member fields here.

Here's what my slash command looks like.

Pick the external request action.

Add the URL for cat facts...

https://catfact.ninja/fact

and click "Test the request".

You should now see a cat fact in the response body.

Next, we're going to use Response Mapping to get that cat fact and save it to a member field.

Response Mapping

If you notice in the Response, the cat fact is at the key named "fact". In order to access "fact", we use this path:

$.fact

Learn more about accessing paths here.

And then save that fact to the "Cat Fact" member field.

Then, reply to the slash command with the cat fact! I moved the "Reply to Slash command" step down to be AFTER the external request step.

Did this answer your question?