/rules/search?languages=c# or /rules/search?languages=csharp

SonarQube Community Edition v7.7.23042

I am trying to access the SQ API to extract the rules for our compliance and audit reports.
With the same credentials I am able to see it through the UI

I am not able to extract C# rules
Rules = Invoke-RestMethod -Headers {header} -Uri “${SONARQUBEDOMAIN}/sonar/api/rules/search?languages=csharps” -Method Get;

image

I am able to get Java rules.
Rules = Invoke-RestMethod -Headers {header} -Uri “${SONARQUBEDOMAIN}/sonar/api/rules/search?languages=Java” -Method Get;

Hi.

The correct id for C# is cs. Please use ....api/rules/search?languages=cs

Hi Felipe
Yes that works. Thanks

Can you provide the documentation on what is the language key I can use for each language SQ scans against?

The highlight would be the current preference, I would like to create a report for all the languages
image

Unfortunately I’m not sure if it’s documented anywhere. I went to the “Rules” page, selected the language and looked at the URL. :smiley: