Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot use API-token with cURL

Carsten Stepan
Contributor
March 15, 2024 edited

I tried everything from Basic auth for REST APIs (atlassian.com) to get my request working:

 

I created an API-token on the application. Then I crated a string  in the form "myuser:mytoken" and encoded it using base64. Finally I used that string as authorization-header within cURL:

 

curl https://myintance.atlassian.net/rest/api/2/project -H "Authorization: Basic <base64string>"

 

However it keeps returning an empty array, wile it should get me my JIRA-projects.

 

I also tried to provide the API-token as bearer-token as described here: Using Personal Access Tokens | Atlassian Support | Atlassian Documentation

 

curl https://myintance.atlassian.net/rest/api/2/project -H "Authorization: Bearer <base64string>"

 

but that gave me this:

 

{"error": "Failed to parse Connect Session Auth Token"}

1 answer

1 accepted

4 votes
Answer accepted
Carsten Stepan
Contributor
March 15, 2024

Okay, now it works... created completely new token. Seems like the previous one was broken ;(

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events