"Invalid Token" error

_REDACTED_ _REDACTED_
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 4, 2024

G'day world,

I just started to try the Trello API for one of my project, but the issue is the following:

Despite sending the correct url, i keep getting the 401 "invalid token" error.

https://api.trello.com/1/members/me/boards?key={myAPIKeyhere}&token={myAPITokenhere}

 After checking 3 time, it's the right key and token from https://trello.com/power-ups/{mypowerupID}/edit/api-key.

 

Maybe i'm doing something wrong, again i'm new to this, but i've followed the documentation, and there's nothing i found to solve this..

 

image_2024-06-05_105429105.pngimage_2024-06-05_105510083.png

3 answers

1 accepted

1 vote
Answer accepted
_REDACTED_ _REDACTED_
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 6, 2024

Hey, thanks for the reply,
i've found the issue, i wasn't using the right token.

I was using the API "Secret" and not the "Token", i realised i had to click on that little text mentioning the "token" generation.

Now it's working just fine, but thanks anyway for your help.

3 votes
Rasmus Wulff Jensen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 5, 2024

Please see this video on how to get the API key and Token: https://youtu.be/ndLSAD3StH8?si=LcdBtoj7CmeJ6TBz (the url you describe is not the normal way to do it)

1 vote
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2024

Hello @_REDACTED_ _REDACTED_ 

That Trello REST API request URL path is completely valid and will work perfectly, provided you use a valid Key and Token.

Maybe you left the placeholder left and right brackets { } in the request path, wrapped around the Token, thereby invalidating it?

You just put the Key and Token in directly, like this...

https://api.trello.com/1/members/me/boards?key=11d2ff3c23e92d32543137blahblahblah&token=22a658cd2a6b02083ddeeff90cb720f7de68blahblahblah

You haven't said how you are making the request to the endpoint (IE using what tool / language / library etc.) for your 'project', but if you do that GET request directly via a web browser, you'll know straight away if it's a valid request or you have something wrong in your code.

If you plan to become a Programmer / Developer, you need to learn to use API test tools like Postman or similar to test your requests first, to isolate problems with the request as opposed to coding mistakes.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events