Overview
HTTP request actions come into play when you need to reach out to other platforms in your story. In this article, we'll go through a checklist, including some tips of building out an HTTP request action.
Tines references
Before getting started, we recommend familiarizing yourself with the surrounding functionality this article covers:
Tines Tip: Need some inspiration with building out your story? Check out our story library!
Make it happen
✅Check one: Is there a Tines template?
It may be possible that a template has already been created for the API call you're looking to make.
Grab from the templates on the bottom left and drag into the story.
Then select the task from the template you'd like to use.
✅Check two: Does the platform offer API documentation?
Visit the platform's API documentation to explore the types of calls can be made. Let's look at an example using Slack:
Using your search engine, enter the platform's name and API documentation.
Select the API documentation (i.e. Slack documentation). From there you should be able to identify the task you are trying to complete. For our Slack example, here's a screenshot of all the possible
chat
API calls:Continuing with our Slack example, let's look at
chat.delete
:
✅Check Three: Is there a cURL example of the API call?
Platform API documentation will sometimes offer a cURL example of the API call. Whether you understand how to build a cURL command from scratch or copy it from platform docs, you can paste the command directly onto your storyboard in Tines and it will automatically create an HTTP action with that command's configuration. We call this feature curl2Tines. Here we can see what a cURL request example looks like.
When you paste it into the story it'll look something like this:
Tines Tip: Make sure to double-check for any additional action configuration modifications required to make the API call.
💡Or, build an HTTP request action from scratch
Identify the URL Endpoint (i.e. look at the platform's API docs to see the URL we are making the request to). Continuing with our Slack example, let's look at the
reactions.list
API call:Pull an HTTP request action into your story.
Create a unique name that describes what you're trying to accomplish
Set the URL in the action to the URL from the API docs
Update the method of the action to whatever is mentioned in the API docs. In our Slack example, this API call is using a
GET
method.The parameters of an API call are the specifics of that request. Generally there will be requirements that the vendor needs in the request to provide a successful response. There are also typically optional fields that you can send over in your request. In this example we have "token" as a requirement, and "user" as an optional field we'll be adding.
Tines Tip: Set up your basic config, then get your API key / token for testing. This makes it so you can have most of the action configured and then get the final item of the API key. If you are unable to acquire the API key for a service, now is a good time to reach out to your team to make a formal request for it.