Clockify HTTP x-api-key

Hi There I try to connect to Clockify with the HTTP Node. We need to fetch the endpoint TimeRecord per User. So I firstly fetch with the Clockify Node User and Workspace ID

After that I try to GET{{ $json[“activeWorkspace”] }}/user/{{ $json[“id”] }}/time-entries

The Authenthication I tried is

After executing I receive the error:
ERROR: Authorization failed - please check your credentials

{“status”:“rejected”,“reason”:{“message”:“401 - "{\"message\":\"Api key does not exist\",\"code\":4003}"”,“name”:“Error”,“stack”:“Error: 401 - "{\"message\":\"Api key does not exist\",\"code\":4003}"\n at createError (/app/code/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/app/code/node_modules/axios/lib/core/settle.js:17:12)\n at RedirectableRequest.handleResponse (/app/code/node_modules/axios/lib/adapters/http.js:238:9)\n at RedirectableRequest.emit (node:events:525:35)\n at RedirectableRequest.emit (node:domain:489:12)\n at RedirectableRequest._processResponse (/app/code/node_modules/follow-redirects/index.js:356:10)\n at ClientRequest.RedirectableRequest._onNativeResponse (/app/code/node_modules/follow-redirects/index.js:62:10)\n at Object.onceWrapper (node:events:628:26)\n at ClientRequest.emit (node:events:513:28)\n at ClientRequest.emit (node:domain:489:12)”}}

It tells me api key does not exist. But I have checked it 100 Times. It is the api Token generated in my clockify profile.

I also tried to use the predefined credentials from clockify for auth. I got the same error.
But when I try to use the same authorization with a clockify node it works without problems

I found the Issue. Its the URL with the JSON inside. Can you please help on this how I can fix it?

Hi @MatiGdn, welcome to the community!

I believe this isn’t a problem with n8n but with Clockify itself. Even when trying to send your example request using curl (without any n8n involvement) the request would fail, despite using a valid key:

However, after switching out the hostname in my URL and sending my request to instead, this request works as expected:

This also works in n8n combined with data coming from a previous Clockify node. I’ve tested this in version 1.0.5 with the following workflow:

This was the result:

So perhaps you want to give this another go using the updated hostname and let me know if you’re still running into trouble afterwards?

Hi @MutedJam, Thank you very much!
Well especially I tried this too. It is interesting that it works on your site? Do you have the cloud Version of N8N?
In my case I use the on prem Version and I receive the following “White Label” Error:

Hey @MatiGdn,

I am also not seeing this on my test cloud instance or my self hosted instance, The error you are getting back though isn’t an n8n error it is coming back from whatever it is you are talking to which should be Clockify but it could be something else.

Under the options can you set it to Include the response headers and status and never error it will be interesting to see what Headers are coming back.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.