Forums

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

How do i get the user in jira rest api?

Ibarts Ltd
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!
February 22, 2019

When i try to get the user by passing the access token in header (Authorization : Bearer ***********) it shows 403 Forbidden error. ("error": "Failed to parse Connect")

How do i get the user?

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 1, 2019

Hey there,

I'm going to make a couple assumptions:

  • You're using a valid API token you generated from id.atlassian.com
  • The API endpoint you're calling is <yourinstance>.atlassian.net/rest/api/3/user as outlined in the REST API documentation

It's a good idea to check and make sure everything is in order by running a call with your username, Jira Cloud URL, and API token. This is easy with cURL and we provide an example call with cURL's -u option handling the authentication:

curl -D- \
   -u fred@your-domain.atlassian.net:freds_api_token \
   -X GET \
   -H "Content-Type: application/json" \
   https://your-domain.atlassian.net/rest/api/2/issue/createmeta

Assuming that works and you want to proceed with passing that in to a header yourself, you need to base64 encode what is being added to the header. The value is a combination of your email address and the API token (the token itself is not enough). An example:

fred@acme.com:F4981KJN391NMXZP

encoded, this will be the value to put in the header:

ZnJlZEBhY21lLmNvbTpGNDk4MUtKTjM5MU5NWFpQ

Hope that helps!
Daniel | Atlassian Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events