Trello Api: Create a New Map from PHP Code

I would like to create a new Trello map when a new user signs up for our web application.

To do this, I asked for a "read, write" token (name it "myToken") for my user, and I have my own application key (let's call it "myKey").

Since I could not find PHP-Wrapper, I first used Fiddler to check the HTTP message. In particular, I tried the following:

HTTP-POST URL: http://api.trello.com/1/cards Request-Headers: User-Agent: Fiddler Host: api.trello.com Content-Length: 177 Request Body: key=myKey&token=myToken&name=newCardName&desc=newCarddescription&idList=myListId 

However, this does not work. I am returning HTML code that shows a website that tells the user to log in! What am I doing wrong?

+4
source share
1 answer

Thanks @Daniel LeCheminant. I made two mistakes:

1.) I used http instead of https 2.) I put the variables in the request body. Although this is a mail request, trello expects variables in the url itself

This solution works for me:

 https://api.trello.com/1/cards?key=myKey&token=myToken&name=newCardName&desc=newCarddescription&idList=myListId 
+4
source

All Articles