"unauthorized" bei API Call

Liebes Forum,

wir wollen Awork Daten in PowerBI nutzen, scheiterten jedoch an allen verfügbaren Authentifizierungsverfahren.

Aus diesem Grund haben wir versucht die Abfrage erstmal über Postman zu starten, laufen hier aber in den error code „unauthorized“ & „permission are invalid“.

Wir geben in der Abfrage den API-Key mit (startet mit ey, also nicht das secret).

Ist bei den hinterlegten API-Keys nicht generell ein Adminzugriff hinterlegt? Wo muss das sonst gesteuert werden? In der Rechteverwaltung finde ich keinen Eintrag zu dem Account (wobei ich meine, dass da mal ein war…)

Wahrscheinlich ist es ein super dämlicher Anwenderfehler, aber ich komme leider auch mit den verfügbaren Ressourcen nicht weiter. Über eine Idee würde ich mehr freuen.

Hi @niklasjvr, could you paste your request as a cURL and remove the token? This way it’s easier to see what you are sending. The request generally looks good but the response looks unfamiliar to me.

Could you also paste the trace id from the response header? Thanks

Hey Sebastian,

thanks for your reply, this is the curl:

curl --location ‚https://api.awork.com/api/v1/projects‘ \

–header 'Authorization: Bearer ey

Hey Sebastian,

this is the curl:

curl --location ‚https://api.awork.com/api/v1/projects‘ \

–header 'Authorization: Bearer ey

Edit:

I dont get any values for the traceid back.

Can you confirm you followed these steps to generate the key? Authentication — awork API | Documentation

Your cURL looks oddly formatted so I’m not sure what the issue is to be honest.

Can you try it with this?

curl --request GET \
  --url 'https://api.awork.com/api/v1/projects' \
  --header 'Authorization: Bearer ey...'

I have imported your formatting as curl in postman - same result. It is really weird.

And yes we have followed the documentation. Also if i use a wrong key, i dont get access. So the authentication itself is definetly working. I don’t understand how the permissions can be missing - Is the api key not automatically an admin?

It is admin automatically. I just saw a similar report in the forum so I’ll check if there is anything else I’m missing.

@niklasjvr I identified and solved the issue. You will need to delete and recreate the API key, but then it should work. Let me know if you still have issues. Thanks and sorry for the inconvenience.