Swetrix / selfhosting

37 stars 8 forks source link

Api project? #7

Closed creio closed 2 months ago

creio commented 2 months ago

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.

изображение

Blaumaus commented 2 months ago

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.

creio commented 2 months ago

изображение

Blaumaus commented 2 months ago

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 commented 2 months ago

This issue should be fixed in v3.2.0