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, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events