Page 1 of 1
Webhook - Job Deleted
Posted: Tue May 30, 2023 2:07 am
by Carl Hansen
When A job is deleted, the webhook action shows as 'updated', the action should show as 'deleted' otherwise the subsequent request fails as the job no longer exists.
Re: Webhook - Job Deleted
Posted: Tue May 30, 2023 2:58 am
by Sindre
Hi Carl,
Is the actual job being deleted or is it a part of a job, for example a section being deleted? This would trigger job updated webhook beause a part of the job has changed.
I did a quick test and deleting a job should trigger the job deleted webhook.
If you are experiencing something else please send be a personal message with your build, the delete request and a screen shot of the webhook triggered and I will investigate.
Regards
Re: Webhook - Job Deleted
Posted: Wed May 31, 2023 12:22 am
by Carl Hansen
Hi Sindre,
I sent you a PM, the job that comes through with a status of 'updated' cannot be found by request or by manually searching simPRO.
Re: Webhook - Job Deleted
Posted: Thu Jun 01, 2023 12:29 am
by Sindre
Hi Carl,
I did some investigation and it seems like there are two webhook subscriptions for jobs. They are both subscribing to create and update events but not delete events.
So if a job is updated you get the webhook, but not when the same job is deleted. If you do any logic based on this add the deleted event to your subscriptions so you will receive the job.deleted event.
Regards
Re: Webhook - Job Deleted
Posted: Thu Jun 01, 2023 1:08 am
by Carl Hansen
Thanks Sindre,
So does deleting a job count as being 'updated'? If I subscribe to deletions will the 'updated' action be replace with 'deleted'?
Re: Webhook - Job Deleted
Posted: Thu Jun 01, 2023 2:31 am
by Sindre
Hi,
No, deleting will not replace an update webhook. So when you received the update webhook someone have updated something on the job. And then it has probably been deleted afterwards but you haven't been notified as there was no webhook.
And you can't go back to see what has been updated in the logs as it's been deleted.
Re: Webhook - Job Deleted
Posted: Thu Jun 01, 2023 4:22 am
by Carl Hansen
The logic makes sense, this would mean that the job was deleted in between the Webhook being sent and the job being deleted, meaning that the webhook was delayed in being sent?