Hello,
as per Basic username/pass authentication was deprecated, I have used this guide and tried with API token.
https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/
However, the curl call in example ends with a message:
HTTP/1.1 401 Unauthorized
< Date: Fri, 14 Oct 2022 12:48:26 GMT
< Content-Type: text/plain
< Server: globaledge-envoy
< X-Envoy-Upstream-Service-Time: 1
< Expect-Ct: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/atlassian-proxy", max-age=86400
< Strict-Transport-Security: max-age=63072000; preload
< X-Content-Type-Options: nosniff
< X-Xss-Protection: 1; mode=block
< Atl-Traceid: 32a85b1cbe7d6957
< Report-To: {"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}
< Nel: {"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
<
Basic authentication with passwords is deprecated. For more information, see: https://developer.atlassian.com/cloud/confluence/deprecation-notice-basic-auth/
So how are we supposed to use the API authentication?
Thanks
What headers are you passing with your curl command? You can authenticate with the below method on the cloud, either by using basic auth that's base64 encoded
curl --headers 'Authorization: Basic anZYxxxxx'
OR
Email + API token combination
curl --user 'email@example.com:APITOKEN'
Passing the correct headers, request method etc above prior to running the curl command
Hi,
what you mention is exactly what Im doing.
curl -v https://SITE.atlassian.net/rest/api/latest/project --user MYEMAIL:MYTOKEN
or
curl -D- -X GET -H "Authorization: Basic MYSTRING" ...
Always end up with the message above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Leos, what turned out to be the "right" token? Is it the one you got from the API token management screen in your profile?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
sorry for late response. I found out there are two screens where you can configure API tokens. The first is in Administration menu and the second is in your account settings->security.
The second one was the right one to use.
Rg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am really pissed off from atlassian team. I wasted 4 hours to figure out why my api is not working. Guess what because atlassian team thinks API to be created at two different places and don't guide the users which one to use. Pathetic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.