Missed Team ’24? Catch up on announcements here.

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

Trello simulate a post request to get token

omi October 14, 2018

Hello,

I'm trying to get a trello token by simulating a post request to https://trello.com/1/token/approve

but trello response me with a message: member not authenticated,

Maybe I'm missing  something, but I can't figure it out, the python code is below

 

import requests


data = {
"requestKey": "e06ffc8448981a72e9f2238d992c46b",
"signature": "1242539370258/19254ccdb38731b158958caa2f7b3344a10bf9d38804a4bb41f0sd67f2d4b680",
"approve": "Allow"
}


r = requests.post("https://api.trello.com/1/token/approve", data=data)

# Get the raw body text back
body = r.text
print("body: " + body)   // trello response:  Member not authenticated

 

1 answer

0 votes
matt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 17, 2018

Hi There  👋

I think you found us in the Trello Community Slack, but I figured I'd also answer here in case its helpful to other folks.

The issue here appears to be that that route is the final part of the implicit OAuth consent flow. You should direct a user to the authorize URL: https://trello.com/1/authorize with an appropriate set of query params. After which, if they approve, you’ll be granted a token. You purposefully can’t programmatically generate a token without the user’s consent.

If you go with the implicit flow, usually the way to get the token back to your service is to have some javascript on the page you set as the return_url that reads the token and POSTs it to your service.

Another option if you want to avoid the client-side javascript route, is to use Oauth1.0a, generally with a library for your language of choice, and the routes documented at https://developers.trello.com/authorize

Lastly, if you are just looking to get a one time token to use for yourself, you will find there is a link to generate one for yourself from the https://trello.com/app-key page.

Hope that helps. And feel free to continue to reach out with questions in the Trello Community Slack.

omi October 17, 2018

Thank you very much Matthew, I will take a try at Oauth. ;)

Rita Wayne December 4, 2018

I'm having the same issue with multiple users on my team. I'm so lost. Mine works fine and we all have the same rights etc. What should I tell them to do? or is it me who should "approve" something? Any step by step would be so helpful!!

omi December 5, 2018

Hi Rita,

I finally solved problem by this workflow. I hope it can help you.trello_approve_xml_-_draw_io.png

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events