How to make a REST API request cause documentation is wrong

Hi. I have a strange problem. I took a sample cURL request from the documentation

curl --request GET \
--url 'https://your-domain.atlassian.net/rest/api/3/events' \
--user 'my@email.com:my_api_key' \
--header 'Accept: application/json'

Simple and easy…NOT

When I try to make this request I get an error

Basic authentication with passwords is deprecated. For more information, see: https://confluence.atlassian.com/cloud/deprecation-of-basic-authentication-with-passwords-for-jira-and-confluence-apis-972355348.html

And this is a bit odd, as this article says that I should use exactly this structure to make a request. Any ideas what I’m doing wrong?

1 Like

@fixianovic,

Works for me. Did you send an API token or your password? If you sent your password, then that’s the right error message.

yes. 100% sure. I generated my API key, set email same like the account for which the key was generated.
to be honest i get the same error regardless what i put there

@fixianovic

Works for me too. Can it be assumed that you also tried encoding your email address + API token pair into a Base64 encoded string, and submitted it in the request header? Refer to the Supply basic auth headers section on the Basic auth for REST APIs documentation page.

Here’s a quick and dirty cURL request, using that method, to check into about yourself:

curl -X GET https://[your_jira_cloud_instance_here].atlassian.net/rest/api/3/myself -H "Authorization: Basic [your_base64_encoded_email_address_and_token_pair_string_here]"