Issuing HTTP requests

Butler allows you to issue GET, POST, and PUT HTTP requests to external systems from Trello.

In Butler Rules, Card Buttons, and Due Date commands, the get, post to, and put to actions are available on the Content tab.

In Board Button and Calendar commands, these actions are available on the Other tab. 

POST and PUT requests

POST and PUT requests allow to specify custom headers to send along with the request:

Headers are specified as a JSON object, for example:

{"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.

Response

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

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 command will post a comment with data extracted from a JSON file that is retrieved with a GET request:

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:

{
relatedMovies:[
  {title: 'Movie 1'},
  {title: 'Movie 2'},
 ],
};

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