(401) Unauthorized returned when try to create card

Just starting my venture to consume the Trello rest api. I am using a static key and token because this is an internal process only employees within the network will be able to consume.

I was able to list boards/lists/cards/etc… but once I tried to do a write process I get the 401 unauthorized return message.

As mentioned before, this will be on an internal server and not sure how I would do a ‘origins’ as asked for on the https://trello.com/app-key page. People within the organization will go to the page by doing something like, so is that what I would enter into https://trello.com/app-key to allow this to create new cards?

Thanks in advance for any information you can provide.


Regarding 401 unauthorized return message:

  1. Make sure the app’s token has read, write permissions.

  2. Make sure the app’s key has permission to write on the boards you’re trying to write on. For example, your app might need to first “join” the board before you can make API write calls to it. Your app might not have permission by default to write on your coworker’s boards.

As for the ‘Allowed origins’ → you can list the local host.

Thanks for the info. Where do we change permissions for a token?

At trello.com/accountname/account, under applications I have the following for Server Token:

read and write access on your account
read and write access on all your boards
read and write access on all your Workspaces

Approved: Apr 20 at 2:46 PM
Never expires

At trello.com/app-key I have added the ‘Current Origins’?

Still getting same error.

Ended up figuring it out. My post string was this:
Dim sCreateNewCardPOST As String = “?key={0}&token={1}&name={2}&desc={3}&pos=top&idList={4}”

I changed to this:
Dim sCreateNewCardPOST As String = “key={0}&token={1}&name={2}&desc={3}&pos=top&idList={4}”

1 Like