Discussions

Ask a Question
Back to all

DELETE Timeclock Event

(edited)

I am trying to use v2.0 API to DELETE a Timeclock Event, in this case a note. Everything appears to be working properly, except it isn't actually deleting anything. Here is a var_dump of the response I get from doing a GET Timeclock Event on the entry I'm looking at deleting.

(
[status] => 1
[data] => Array
(
[0] => stdClass Object
(
[id] => 233785754
[type] => 6
[timestamp] => 2021-05-10 08:59:00
[clock_time] => 158348890
[data] => stdClass Object
(
[position] => 251478
)

)

[1] => stdClass Object
(
[id] => 233825335
[type] => -3
[timestamp] => 2021-05-10 12:48:56
[clock_time] => 158348890
[data] => stdClass Object
(
[notes] => API Testing
)

)

)

[metadata] => Array
(
)

[token] => blahblahblah
[error] =>
)

Now, after sending the DELETE for the type 3 (note) section, I receive this as a response:

(
[status] => 1
[data] => stdClass Object
(
[status] => Event removed.
)

[metadata] => Array
(
)

[token] => blahblahblah
[error] =>
)

I'm seeing that as a successful delete. No error, status says "Event removed.". Yet when I do another GET for the same thing, it still shows it there and in the web interface I can still see the note. Here is the response from the GET again after the DELETE:

(
[status] => 1
[data] => Array
(
[0] => stdClass Object
(
[id] => 233785754
[type] => 6
[timestamp] => 2021-05-10 08:59:00
[clock_time] => 158348890
[data] => stdClass Object
(
[position] => 251478
)

)

[1] => stdClass Object
(
[id] => 233825335
[type] => -3
[timestamp] => 2021-05-10 12:48:56
[clock_time] => 158348890
[data] => stdClass Object
(
[notes] => API Testing
)

)

)

[metadata] => Array
(
)

[token] => blahblahblah
[error] =>
)

Can anyone help me to understand what I am doing wrong, or is the API not working properly?