Forums

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

Xray request issue

Martha Sanchez March 31, 2022

I tried to make a get request with axios. I am implementing Xray in my project. 

 

var config = {
       method: 'get',
       url: 'url',
       headers: {
      'Authorization': 'token',
      'Content-Type': 'application/json',
       },
       data : data
       };
                                                   
        axios(config)
        .then(function (response) {
         console.log(JSON.stringify(response.data));
         })
         .catch(function (error) {
          console.log(error);
         });

I added my app to allowlist in Jira for avoiding the following issue:

3.PNG

This solution works fine for Jira Rest APIs but not for  Xray Rest APIs.

I tried to modify headers.

 

 

1 answer

0 votes
Stefan Salzl
Community Champion
March 31, 2022

Hi @Martha Sanchez and welcome to the community,

as you mentioned that it works with jira API:

did you create the specific xray token in jira administration? Jira and Xray APIs are using different tokens and also different types of authentication.

Unfortunately I‘m not familiar with axios. I‘m working with curl calls. Would one of these calls help? (they are working on my side)

Best
Stefan

Martha Sanchez April 1, 2022

Hi Stefan ^^

I appreciate the quick response.. I tried to create a xray token, but my menu doesn't have an API Token option . 

xray menu.PNG

Do you know another way to create a xray token for Jira Server? 

Stefan Salzl
Community Champion
April 2, 2022

Hi @Martha Sanchez 

the settings in your screenshot are the project related xray settings. API tokens are set in the xray app administration (as far as I know this needs admin permission). 

if you click the jira settings/admin button (in cloud this is in the upper right corner) and then choose „apps“ there should be a separate section for xray (I can send a screenshot later as I‘m nit at my notebook currently).

Best
Stefan

Stefan Salzl
Community Champion
April 4, 2022

image.pngimage.pngimage.png

Suggest an answer

Log in or Sign up to answer