0

I'm getting a 501 response from the clockify API when trying to create a Time Entry using CreateTimeEntryRequest

I've verified I can query the API and get data from it, so I'm using the correct X-Api-Key, I've resolved a few issues with bad datetime formats, but I'm still getting the error.

URL I'm posting to:

https://api.clockify.me/api/workspaces/REMOVED/timeEntries/

My POST request header looks like this:

{"x-api-key": REMOVED, "Content-Type": "application/json"}

The body of the request is (For example):

{"start": "2019-01-28T14:53:04Z", "billable": false, "description": "Test Time Entry", "projectID": null, "taskID": null, "end": "2019-01-28T15:53:04Z", "tagIds": []}

I'm getting:

{"message": "Entity not created.", "code": 501}

And the time entry is not being created. I expect some kind of success message

1 Answers1

0

It has something to do with the "End" variable. If you remove it, it'll work. This of course means the timer will be running (also you will get a 400 error if you already have a timer running), so if you want to stop it, you'll have to immediately call PUT /workspaces/{workspaceId}/timeEntries/endStarted or if you want the stop time to be at some point in the past, you'll have to update the timer with PUT /workspaces/{workspaceId}/timeEntries/{id}. However the update doesn't seem to work either (same issue). My guess is they made a change to the endpoint (perhaps renamed the "end" variable), because I'm about 75% sure I used this API within the last month or so and it worked.

Hopefully someone from Clockify will see this and give an update. I had a similar issue happen with the "me" field in the GetSummaryReportRequest object. It stopped working and removing the field fixed it.