Trello API Pertaining to creating a card from an external source

Alright, so at current I'm looking for where I'd send the JSON Table containing a card's information from a Lua Engine.

Currently, using the Engine's HTTPService I am able to post sets of data to websites in which I can access, which does not allow me to use the "Trello.put" method as demonstrated by the trello developer website.

The precedent I had been working off of, which I found to be outdated, sent the JSON table to the following to create a card;

https://api.trello.com/1/cards?key=[APPKEY]&token=[TOKEN]

With my various attempts, I have found this to be outdated or incorrect, as the error "404 Not Found" or "Bad Request" is returned.

If I could possibly be informed of the correct URL in which to send the JSON Table to create a card, that would be wonderful.

1 answer

0 vote
Bentley Cook Atlassian Team Jun 07, 2017

Just to make sure I'm understanding correctly, you made a PUT request to: https://api.trello.com/1/cards?key=[APPKEY]&token=[TOKEN]? If so, it is expected for you to get an error. PUT requests are used for updating objects that already exist. For instance, you'd use PUT to change the description of a card in Trello.

To create a new card, you'll want to make a POST request to: https://api.trello.com/1/cards?key=[APPKEY]&token=[TOKEN]. This endpoint is documented here: https://developers.trello.com/advanced-reference/card#post-1-cards.

As the documentation mentions, you'll want to make sure that your request's body contains an idList. This should be the ID of the list in which you want to create your new card. Additionally, you should have write permissions for the board that you are trying to add a card to. The easiest way to test this quickly (assuming you are using a token for your personal account) is to see whether you can add a card on the board via the web client.

 

Bentley,

 

I appreciate your assistance this matter, though it appears your misunderstand. Allow me to clarify;

 

With the Engine I'm using, there is no "Put" or "Post" requests, just a singular method to send data to a specified URL.

I am aware that what I'm asking is very possible, as I've seen it in use currently within the engine, though the precedent I had been going off of appears to be outdated.

The error returned is "Bad Request"  which upon further research by myself, had something to do with Syntax or the formatting of the URL.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 3 hours ago in Trello

Alice Camilla on organizing your work/life/fandoms with Trello!

@Alice Camilla is a university student, currently writing her MA thesis in Archaeology. She's also a freelance blogger and content creator, writing about geeky stuff from productivity apps to JR...

28 views 1 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you