I’m having trouble donwloading regularity report by API.
I created a token using two diferent methods, but both are returning Forbidden and other erros:
-
My-ogranization->Access → Scoped Organization Tokens.
-
My account => Access Tokens.
$ export SONAR_TOKEN=*****
$ curl --request GET \
--url 'https://api.sonarcloud.io' \
--header "Authorization: Bearer $SONAR_TOKEN" ; echo
{"message":"Forbidden"}
$ curl -s --request GET \
--url 'https://api.sonarcloud.io/enterprises/my-organization/regulatory-reports?projectKey=my_proyect_key' \
--header "Authorization: Bearer $SONAR_TOKEN" \
--header 'accept: application/zip' \
--output regulatory-report.zip
{"message":"Invalid key=value pair (missing equal-sign) in Authorization header (hashed with SHA-256 and encoded with Base64): '*****='."}