Webhook - Job Deleted

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
Carl Hansen
Posts: 17
Joined: Wed Feb 01, 2023 11:57 pm

Webhook - Job Deleted

Post by Carl Hansen » Tue May 30, 2023 2:07 am

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.
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Webhook - Job Deleted

Post by Sindre » Tue May 30, 2023 2:58 am

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
Sindre
API Developer | Simpro Software Group
Carl Hansen
Posts: 17
Joined: Wed Feb 01, 2023 11:57 pm

Re: Webhook - Job Deleted

Post by Carl Hansen » Wed May 31, 2023 12:22 am

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.
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Webhook - Job Deleted

Post by Sindre » Thu Jun 01, 2023 12:29 am

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
Sindre
API Developer | Simpro Software Group
Carl Hansen
Posts: 17
Joined: Wed Feb 01, 2023 11:57 pm

Re: Webhook - Job Deleted

Post by Carl Hansen » Thu Jun 01, 2023 1:08 am

Thanks Sindre,

So does deleting a job count as being 'updated'? If I subscribe to deletions will the 'updated' action be replace with 'deleted'?
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

Re: Webhook - Job Deleted

Post by Sindre » Thu Jun 01, 2023 2:31 am

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.
Sindre
API Developer | Simpro Software Group
Carl Hansen
Posts: 17
Joined: Wed Feb 01, 2023 11:57 pm

Re: Webhook - Job Deleted

Post by Carl Hansen » Thu Jun 01, 2023 4:22 am

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?
Post Reply