Page 1 of 1

Job attachment webhooks

Posted: Tue Jun 20, 2023 5:25 pm
by michelle
Hi team,

We would like to start using the job attachment webhooks in order to ensure that the job cards get sent where they need to go:

"job.attachment.created"
"job.attachment.updated"
"job.attachment.deleted"

However, when we ran a test we were a bit disappointed to see that there is no information on which job the attachment is for? Is there an endpoint that will allow us to get this data as I'm only aware of the ones that require a JobID.

Also, does adding an attachment trigger a job.updated webhook or has it been moved solely to these webhooks?

Code: Select all

    {
        "ID": "job.attachment.updated",
        "name": "Job",
        "build": "xxxxxx.simprosuite.com",
        "action": "attachment.updated",
        "description": "Attachment #fn5hgCfBRCg9UmygH6qtozdiD8w8hsIJ7xa0eJfMnN8 has been updated.",
        "date_triggered": "2023-06-20T15:58:38+01:00",
        "reference": {
            "companyID": 0
        }
    },
    {
        "ID": "job.attachment.created",
        "name": "Job",
        "build": "xxxxxx.simprosuite.com",
        "action": "attachment.created",
        "description": "Attachment #s2oFbaMkm657T_wRMYSmtzecXTiptUkCrYH4Nkw695M has been created.",
        "date_triggered": "2023-06-20T16:11:16+01:00",
        "reference": {
            "companyID": 0
        }
    },
    {
        "ID": "job.attachment.deleted",
        "name": "Job",
        "build": "xxxxx.simprosuite.com",
        "action": "attachment.deleted",
        "description": "Attachment #R6HAo7cF9LC5hcnk7LYY7OEXHGqm-hQH1wGXRQpLjf8 has been deleted.",
        "date_triggered": "2023-06-20T16:30:56+01:00",
        "reference": {
            "companyID": 0
        }
    }
Thanks
Michelle

Re: Job attachment webhooks

Posted: Wed Jun 21, 2023 4:40 am
by Sindre
Hi Michelle,
The attachment webhook should have more information such as job id, folder and attachment ID in the reference column. This should be available for created, updated and deleted.

Here is an example:

Code: Select all

{
  "ID": "job.attachment.created",
  "build": "xxxxxxx",
  "description": "Attachment #N6JWxPwoZ3nG7kTSpm4winDhWEzuBaiHQrSKhNLb34c has been created.",
  "name": "Job",
  "action": "attachment.created",
  "reference": {
    "ID": 12345,
    "folderID": null,
    "attachmentID": "N6JWxPwoZ3nG7kTSpm4winDhWEzuBaiHQrSKhNLb34c",
    "attachmentName": "xxx.png",
    "companyID": 0
  },
  "date_triggered": "2023-06-21T14:32:06+10:00"
If you are subscribing to the job updated webhook you should receive this as well as job.attachment.updated.

Regards

Re: Job attachment webhooks

Posted: Wed Jun 21, 2023 2:50 pm
by michelle
Hi Sindre,

I posted the information we were receiving from those webhooks, that was all the information we received. Could you please check on your side? I'll send you the client build via private message.

Also, you didn't quite confirm. Does an attachment added to a job trigger the job.updated webhook?

Thanks
Michelle

Re: Job attachment webhooks

Posted: Wed Jun 21, 2023 10:58 pm
by Sindre
Hi,
Send their build details and I'll see what version they are on and test.

If you subscribe to the job webhooks, you will receive job updated webhook as well when you add, update or delete attachments.

Regards