clockify

Error 500 when retrieving Clockify workspaces


When retrieving workspaces using the GET /workspaces/ API endpoint, I’m getting the following error 500:

{
    "timestamp": "2018-10-18T05:48:29.740+0000",
    "status": 500,
    "error": "Internal Server Error",
    "exception": "java.lang.RuntimeException",
    "message": "java.lang.NullPointerException",
    "path": "/workspaces/"
}

This is the request I'm sending:

curl -XGET -H 'X-Api-Key: <snip>' https://api.clockify.me/api/workspaces/

I hope this is trivial to resolve.


Solution

  • Your example works when using the API key generated on the settings page, i.e.:

    curl -XGET -H 'X-Api-Key: WchCprB5h15WpmvB' https://api.clockify.me/api/workspaces/
    

    (of course that is not a valid key, but I've posted it so you see the format). Make sure you're not adding any additional formatting or using the wrong key. If you're using a JWT token you need 'X-Auth-Token' header instead.