XRay GET teststatuses results in a 404 error

Ikigai
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!
May 22, 2020

Hi,

 

I started testing the XRay REST API as a trial first.

I created the API Key and put it in the POST Request 

xray.cloud.xpand-it.com/api/v1/authenticate

Then I used the created token and put it in the GET Request Header as (Authorization Type: Bearer Token using Postman).

GET xray.cloud.xpand-it.com/rest/raven/1.0/api/settings/teststatuses 

Response: 400 Cannot GET /rest/raven/1.0/api/settings/teststatuses

 

What is wrong? Did I forget a step?

Regards

 

 

 

3 answers

0 votes
David Boo
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!
April 13, 2022

I have the same issue when I am using Server/DC API.

Cloud API works for me, but this API is very limited. And Jira native API doesn't provide the methods that I need. For example, get the iterations of steps.

404 "null for URI": xxxxxx, this issue is an error that Jira sends when the API doesn't exist and is not managed by Jira native API. 

@Rogério Paiva - Xray Xporter , @Deepak Sharma want to use Server/DC, like me, because Xray documentation says clearly 

To use CLOUD API:

To use SERVER+DC API:

  • The URIs for resources have the following structure:

     https://<site-url>/rest/raven/<api-version>/api/<resource-name>

         For example, http://yourserver/rest/raven/2.0/api/test/TEST-123/step

@Deepak Sharma says clearly that the issue is when he uses the API */raven/*, As you can see Xray CLOUD API documentation, CLOUD API doesn't use this extension within the API URL.

 

Please, Has someone been able to execute XRay Server/DC API outside the Jira test ('https://sandbox.xpand-it.com/rest/raven/2.0/api') environment?

 

Thanks

0 votes
José Domingues _Xray_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 5, 2020

Hi Ikigai,

The correct documentation for the REST API is the one found here, which is the latest documentation.
The error you are getting means the request you made was not correct, probably it was not correctly set up.

Please contact us through our support channel and send us screenshots of the request so that we can investigate and assist you.

 

Best regards,

Team Xray

Deepak Sharma June 15, 2021

I am also trying to connect with Xray using API mentioned in document but everytime I am getting 404.

My sample URL: "htttps://xxxxx.atlassian.net/rest/raven/2.0/api/teststatuses

However all the rest API, non raven one I am able to access:

Example: "htttps://xxxxx.atlassian.net/rest/api/2/issue/test-123/editmeta

Everytime I am trying to access non-raven api, same host is giving result but all the APIs mentioned in xray documentation with raven, I am getting 404.

Could you please help me with the same. 

cristiano.cunha June 15, 2021

Hi,

The test status you are referring to is the one present in this documentation: https://docs.getxray.app/display/XRAY/Tests+-+REST#TestsREST-GettingallTestsstatuses, that means you are using Server/DC version of Xray (we also have the Cloud version that differs in some aspects due to limitations in each version).

 

If that is the case please make sure that you are authenticating, not with token, but passing the user in the curl command as defined in the above documentation:

Example Request

curl -H "Content-Type: application/json" -X GET -u admin:admin http://yourserver/rest/raven/1.0/api/settings/teststatuses

 

Hope it helps.

Deepak Sharma June 15, 2021

Thanks for the response.

I tried with below combinations:

requests.get("https://{server}.atlassian.net/rest/raven/1.0/api/settings/teststatuses", auth=("{username}","{API_Token}"))                                                                         
Response: 404


requests.get("https://{server}.atlassian.net/rest/raven/1.0/api/settings/teststatuses", auth=("{username}","{Password}"))

Response: 401



However:

requests.get("https://{server}.atlassian.net/rest/api/2/issue/{issue_id}/editmeta", auth=("{username}","{API_Token}"))

Response: Metadata JSON (As expected)


In both the cases raven API is not connecting with Xray, Please let me know, what I am missing.
Like Alex Garcia likes this
Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2021

Hi @Deepak Sharma 

 

From your description, you are using Xray Cloud.

And Xray Cloud is a different app from Xray DC/Server.

You must have been looking at Xray DC/Server documentation, but the REST API is different from the Xray Cloud.

This REST API endpoint doesn't exist in Xray Cloud:

https://{server}.atlassian.net/rest/raven/1.0/api/settings/teststatuses

 

In Cloud, you need to GraphQL API instead. Please check the cloud documentation:

https://xray.cloud.xpand-it.com/doc/graphql/getstatuses.doc.html 

https://docs.getxray.app/display/XRAYCLOUD/GraphQL+API

 

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Like Alex Garcia likes this
0 votes
Ikigai
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!
May 29, 2020

Nobody can help here?

Documentation Versioning is very confusing. The mentioned endpoints are different depending of the documentation version.

But trying the 2 endpoints give still 404 error...

The only requests which are working for me are the ones without the raven in path like:

: https://xray.cloud.xpand-it.com/api/v1/authenticate

Meghana Mallineni January 16, 2023

Hi I need help with the TestNG setup. The results are not getting imported. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events