# API Error! "api/measures/component?metricKeys=coverage&component="

**URL:** <https://community.sonarsource.com/t/api-error-api-measures-component-metrickeys-coverage-component/92753>\
**Category:** SonarQube Server / Community Build\
**Tags:** api, web\_api, coverage\
**Created:** [June 16, 2023, 3:03pm UTC](https://community.sonarsource.com/t/api-error-api-measures-component-metrickeys-coverage-component/92753 "2023-06-16T15:03:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Truber](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@Truber](https://community.sonarsource.com/u/Truber)\
**Post date:** [June 16, 2023, 3:03pm UTC](https://community.sonarsource.com/t/api-error-api-measures-component-metrickeys-coverage-component/92753/1 "2023-06-16T15:03:50Z")

</div>

Hello!

i have a api returns problem! when i try to get some results of “api/measures/component?metricKeys=coverage&component=mysonarproject”, some projects returns full data of search normaly, but some projects returns an error mensage:

{“errors”:[{“msg”:“Component key \u0027’mysonarproject’\u0027 not found”}]}

a try to find breaks on background tasks, but both projects with error on api and no error, have all of background tasks finished status ok. I cant post imgs, but both have same status finished without erros.

someone can help me with this error?

My enviroment:  
sonarqube enterprise 9.6  
bamboo server 8.2  
same user to all pipelines with same access for all projects.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [June 19, 2023, 6:11am UTC](https://community.sonarsource.com/t/api-error-api-measures-component-metrickeys-coverage-component/92753/2 "2023-06-19T06:11:44Z")

</div>

Hey there.

These are the same API calls used when browsing the SonarQube UI, so I would suggest browsing those projects while following [this guide](https://community.sonarsource.com/t/how-to-reverse-engineer-the-sonar-web-api/66810) to see what query parameters are being used. Maybe you’re accidentally using the project name instead of the project key?

---

<div class="post-metadata">

**Author:** ![Truber](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@Truber](https://community.sonarsource.com/u/Truber)\
**Post date:** [June 19, 2023, 11:56am UTC](https://community.sonarsource.com/t/api-error-api-measures-component-metrickeys-coverage-component/92753/3 "2023-06-19T11:56:45Z")

</div>

it’s funny when you ask a question that at the time seems far-fetched and complex and by the end it was so obvious that you were dodged by the pressure of deliveries, but you solved the riddle! We have a particularity in our environment where an identification of the organization to which the project belongs is applied to the project key, this is a pattern so ingrained that remembering that whoever created the project may not have applied it went unnoticed. in the end, it was just applying the correct projectkey in the query and we ended up finding a gap of projects that were created non-standard without the organization in the project key.

a problem solved and a new problem to start solving.

thank you very much for the contribution @colin!

problem solved!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [June 26, 2023, 11:57am UTC](https://community.sonarsource.com/t/api-error-api-measures-component-metrickeys-coverage-component/92753/4 "2023-06-26T11:57:36Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
