selfhosting icon indicating copy to clipboard operation
selfhosting copied to clipboard

Api project?

Open creio opened this issue 2 years ago • 4 comments

Hello, why doesn't the projects API work?

curl -i -X POST https://api.example.com/v1/project -H "X-Api-Key: ${SWETRIX_API_KEY}" -H "Content-Type: application/json" -d '{"name": "test pub","public": true}'

{"message":"Cannot POST /v1/project","error":"Not Found","statusCode":404}

and another thing is that the wrong URL is being substituted in the settings.

изображение

creio avatar Aug 09 '24 09:08 creio

Hi! I just realised I forgot to add v1 prefix for project-related endpoints on self-hosted version.

Can you try to use curl -i -X POST https://api.example.com/project -H "X-Api-Key: ${SWETRIX_API_KEY}" -H "Content-Type: application/json" -d '{"name": "test pub","public": true}' instead?

This issue will be fixed in the next selfhosted release.

Blaumaus avatar Aug 09 '24 19:08 Blaumaus

изображение

creio avatar Aug 09 '24 20:08 creio

I found the issue, the API keys will not work on project related endpoints, it was an oversight on our side. I'll fix this and try to release a new version this / next week. Sorry for that

Blaumaus avatar Aug 10 '24 13:08 Blaumaus

This issue should be fixed in v3.2.0

Blaumaus avatar Aug 11 '24 14:08 Blaumaus