SonarCloud Web API

I’m trying to fetch project badges, but all I am getting is “Project is invalid” svg response, whatever I tried.
Is there anything I’m missing?


use: /api/components/search_projects?ps=50

I can search for projects, get project_analysis, etc. - this all works fine.
But I can’t get badges, all I get is SVG saying “Project is invalid”

<svg xmlns="" height="20" width="105">
<!-- ERROR -->
<linearGradient id="b" x2="0" y2="100%">
    <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
    <stop offset="1" stop-opacity=".1"/>
<clipPath id="a">
    <rect width="105" height="20" rx="3" fill="#fff"/>
<g clip-path="url(#a)">
    <rect fill="#e05d44" height="20" width="105"/>
    <rect fill="url(#b)" height="20" width="105"/>
<g fill="#fff" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11" text-anchor="left">
    <text x="4" y="15" fill="#010101" fill-opacity=".3">Project is invalid</text>
    <text x="4" y="14">Project is invalid</text>

Is your project public or private?

Private project

Hi there. Then this might relate to the fact that badges are currently not available on private projects (see related topic).