Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Trello API Pertaining to creating a card from an external source

DeverusLazvari June 6, 2017

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 votes
bentley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 7, 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.

 

DeverusLazvari June 7, 2017

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
TAGS
AUG Leaders

Atlassian Community Events