Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,701
Community Members
 
Community Events
184
Community Groups

XRay cloud REST API Authorization error 401

I'm trying to use REST API for Jira-Xray Cloud. I looked through this pages https://docs.getxray.app/display/XRAYCLOUD/Authentication+-+REST+v2 and https://docs.getxray.app/display/XRAYCLOUD/Global+Settings%3A+API+Keys

I only found this page https://id.atlassian.com/manage-profile/security/api-tokens for creating a user token. And I cannot see Client Id and Client Secret there. I only have the token created. 

Then I tried a REST API request with the token created, but got 401 "Invalid JWT: JsonWebTokenError: jwt malformed".

What am I doing wrong?

Xray_1.png

1 answer

1 accepted

1 vote
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 04, 2023

Hi @Zakhar Yermakovich - welcome to the community,

Do you have admin permission in your system?

The settings for API client & secret need to be set in admin section of the site. 

Click the coq icon in the upper right corner and select "Apps". This will lead you into the admin console where apps/plugins are managed. In the left menu bar scroll down until you reach the xray section. There you´ll find a dedicated menu item for API keys (see screenshots below).

image.pngimage.png

Hope this was helpful.

Best
Stefan

Thank you for the answer.

I do not have admin permissions in my system. But do I have to have them? I thought I only need a token to connect to the REST API and I created a token...

May be I just use the token incorrect way?
The error message in response is says "jwt malformed"...

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 04, 2023

In this case (to store an xray api token): Yes admin rights are needed.

You created a token for the jira REST API. As you would like to authenticate to XRAY REST API you would need a separate token for that API.

If you don´t have admin rights please contact your site/jira admin and clarify the use case behind. I´m sure they will find a solution.

Best
Stefan

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 05, 2023

Any update? could you contact your jira admin?

Best
Stefan

Zakhar_Ermakovich
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!
Apr 05, 2023

Hi Stefan! 
(This is my second account)

I appreciate your help. It looks like you are right.

I still didn't reach the admin, he is at a vacation.

But I created a support ticket and they said almost the same as you did.

Like Stefan Salzl likes this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 05, 2023

I do a lot of support and answering questions related to xray as a community leader. The api key topic is kinda confusing for many users and the question was asked frequently. (and I‘m a heavy xray user and admin as well).

Please consider to hit the accept button next to the answer. This will mark the posting as solved and makes it easier for other users to find the right solution for their problems.

Best
Stefan

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events