Hi,
My requirement is to set a few custom fields whenever a job gets created. I have setup a webhook on "Job Created", however when I try to set the fields, the job is locked by the user so the requests fail.
The only way I can see is to build an asynchronous workaround, where I store the job ID from the web hook, then attempt the custom field update at a later time. But there's still no guarantee they haven't left it open overnight.
Is there any way to force an API call if the user has a job open? Or is there another way I haven't considered. The custom fields must be set before the job changes state, because we have SMS notifications going out that require these custom fields.
Thanks
Webhook called, but job is still locked, how best to deal with this?
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.
Webhook called, but job is still locked, how best to deal with this?
Software engineer building AI automations and cloud integrations on Simpro. Need to integrate another tool or do something custom? Slide into the DMs
-
SimproAPITeam
- Posts: 831
- Joined: Wed May 01, 2024 2:31 am
Re: Webhook called, but job is still locked, how best to deal with this?
Hi,
Thanks for reaching out! There is actually a way to handle this — SimPRO has an unlock job endpoint in the REST API that you can call programmatically. https://developer.simprogroup.com/apido ... 8dbc6e93ec
Your workflow would look like this:
1. Receive the "Job Created" webhook
2. Call the delete job lock endpoint to release the lock
3. Set your custom fields via API
4. The job returns to its normal state
Hope this helps.
Regards
Thanks for reaching out! There is actually a way to handle this — SimPRO has an unlock job endpoint in the REST API that you can call programmatically. https://developer.simprogroup.com/apido ... 8dbc6e93ec
Your workflow would look like this:
1. Receive the "Job Created" webhook
2. Call the delete job lock endpoint to release the lock
3. Set your custom fields via API
4. The job returns to its normal state
Hope this helps.
Regards
Simpro API Team | Simpro Software Group
DEVELOPER CENTER