Button with API POST request ?
Asked by Laurent Lacoste:

Hi,

Is it possible to add a button on a trello card to send a POST request to an external API with data coming from this Trello card?

Thanks

L.


Answers:
author: milynnus
body: [@Laurent Lacoste](/t5/user/viewprofilepage/user-id/5048901)

Definitely. Doing it all the time.   

I have now an app that handles certain services that are either not available in Trello automation. The difference is that this app is your own http request api server/gateway (if you want to integrate to other software).   
<https://alpha.deta.space/discovery/@milynnus/space_butler>

comments: author: Laurent Lacoste
body: ok thanks.

but what is this app exactly?

I don't know her.


author: milynnus
body: [@Laurent Lacoste](/t5/user/viewprofilepage/user-id/5048901)

This app is a collection of code snippets that I have written to help solve some of the more complex Trello automation requirements. Now with the offering Deta, I am able to put this together as an app in which anyone can use. It sits in your personal cloud do not need to your your credentials with anyone. The services will either return results as {httpresponse} and you can use it in your Trello automation or effect some change on the board. The plus is that you do not need any server to host the app.

(1) eg if you do a lookup of card, you will not be able to use the CF of the card you found because the is no {{%foundcustomfieldname}}. Now you can get it from {{httpresponse.customfieldname}}

(2) You want to use a sticker from another card and add it to yours. Now you can.

(BTW due to a software upgrade, I suspect it created a problem on the app. Note, as you can see from the url, the offering by this company is in alpha)


author: Laurent Lacoste
body: Ok I see.

So by default, with trello, it's not possible to get custom fields values to insert them in a http post request?

because I have found this : <https://support.atlassian.com/trello/docs/issuing-http-requests/>


author: milynnus
body: [@Laurent Lacoste](/t5/user/viewprofilepage/user-id/5048901)

I am not suggesting that you can't. In some use cases like lookup or after you create new card or a copy, you would have problems with the CF from the source card. It depends on what you need to do.   

Trello automation is able to handle most automation scenarios. Sometimes it is more cumbersome and it can involve a combination of rules/commands.


author: milynnus
body: [@Laurent Lacoste](/t5/user/viewprofilepage/user-id/5048901)

The http request is what you use to call the app but if you need other logic between call, a native call using api is not enough. That is will you will need to call and endpoint and have it do all the if else stuff for you.


author: Laurent Lacoste
body: Yes I see perfectly.

But just to do basic tests to start, do you know where can I find card variables for default fields and custom fields?

I mean, how can I call them in http post request?


author: Laurent Lacoste
body: ok I found this : <https://support.atlassian.com/trello/docs/butler-variables/>


author: milynnus
body: [@Laurent Lacoste](/t5/user/viewprofilepage/user-id/5048901)

That's a must use page when you have to work with Trello variables in general.


author: Laurent Lacoste
body: Ok understood , many thanks ?


Tags: api

automation

butler

button

card