Get projects badges

Hi,

I’m looking the way to get private project badges using the sonarsource 's web api.
The documentation from https://sonarcloud.io/web_api/api/project_badges says i need to provide a security token but i don’t know how to generate it.
I have tried with a token from my account but it did not work.

How do i create those token ?
The purpose is to provide projects status in our teams dashboard.

Thanks

Ced

Hi @CedricConnes

Private project badges URLs are available in the Information menu of your project (there’s the token generated there as well)

You can then invoke the web api with the relevant information to grab it again.

HTH,
Mickaël

Hi Mickael,

So there is no way to automate the fetch of the project badge with a lot of project: i have to go in each project to copy this url every time a new project is created ?
This url can not be obtained by the api ?

Cedric

Token are per-projects for now, for security purposes, so i’m afraid this is the only way right now.

Mickaël