Issue HTTP requests

Automation lets you send GET, POST, and PUT HTTP requests to external systems from Trello. This is useful if you want to get deeper into the technical side of Trello’s automation features. If you just want to send a message or email, try the post comment or send an email notification actions instead.

Send a POST or PUT request

To create an automation to send an HTTP request:

  1. Add a trigger to your automation. This determines what even triggers the automation’s actions.

  2. Find the HTTP request action in the Contet tab (for automation rules, card buttons, and due date automation) or the Other tab (for board buttons, and schedule automation)

  3. Choose the method (get, post to, put to)

  4. Add the URL where you want to send the request

  5. Add the action to your automation rule by selecting the plus button (+) next to that action

  6. Save the automation

Set custom headers for POST and PUT requests

Choose with payload or with headers. Choosing with headers will also let you add a payload.

Headers are specified as a JSON object, for example:

1 {"Content-Type": "text/plain", "X-My-Custom-Header": "My header value"}

The payload's content-type for POST and PUT requests is application/json by default, but you can override it by specifying a custom header.

Variables that are used in the URL are automatically URL-encoded to create valid URLs; variables used in the payload are automatically escaped to be part of a valid JSON string.

Retrieve the response

After issuing an HTTP request with Automation, the results are stored in the {httpresponse} variable, which can be used as part of the next action(s) in the automation. 

When the response is a JSON object, this variable offers an access notation to retrieve properties within the object. For example, {httpresponse.myproperty}.

Example:

The following Card Button automation will post a comment with data extracted from a JSON file that is retrieved with a GET request:

1 2 get url "https://example.com/movie-search?q={cardname}", and post comment "Result count: {httpresponse.relatedMovies.length} \n\n First result: {httpresponse.relatedMovies[0].title}"

The {httpresponse} variable will contain the following:

1 2 3 4 5 6 { relatedMovies:[ {title: 'Movie 1'}, {title: 'Movie 2'}, ], };

After Automation executes, it will add the following comment to the card:

A card comment with the result count and first result values from the HTTP request in the automation.

Still need help?

The Atlassian Community is here for you.