Forums

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

REST API call to get all components of project

Angel Urumov May 18, 2022

Hello,

I want to get all of the components of a given project via API call.

Basic auth is disabled, we are using Kantega, I have a token and I am adminitator of the intance so permissions are not the issue.

I can successfuly open the the REST url in the browser

I've tried the following:

` curl -XGET -H "Authorization: OAuth <myTOKEN>" -H 'Accept: application/json' https://jiraqa.comapny.com/rest/api/latest/project/PRojectKey/components`

`curl -XGET -H "Authorization: OAuth <myTOKEN>" https://jiraqa.comapny.com/rest/api/latest/project/XXX/components`

 

Both return

{"errorMessages":["No project could be found with key 'XXX'."],"errors":{}}%

1 answer

0 votes
Stefan Salzl
Community Champion
May 21, 2022

Hi @Angel Urumov and welcome to the atlassian community,

the url needs to contain the correct key of your project you want to get the components from. As I see the project key that your call is calling is „XXX“. Is this key correct? Does a project with the key XXX exist?

Best
Stefan

Angel Urumov May 23, 2022

Hello Stefan,

'XXX' is a placeholder. In the API call I am using the real key and as I mentioned it works when I try via browser with same URL as the API call.

 

Regards,

Angel

Stefan Salzl
Community Champion
May 23, 2022

One more thing I found during some research was that there can be set several restrictions (eg IP range). see the link below:

https://kantega-sso.atlassian.net/wiki/spaces/KSE/pages/235601943

Could you please check if anything is set there?

Best
Stefan

Angel Urumov May 25, 2022

The IPs from which I am accessing are allowed.

 

Regards,

Angel

Suggest an answer

Log in or Sign up to answer