Page 1 of 1

Error with webhook - Attachment uploads

Posted: Thu Nov 21, 2024 2:17 am
by caine
Up until very recently it was all working well.
Looks like maybe since the change in the mobile app/gallery views in the ui I've seen the issues.

- Webhook received with attachement ID

Code: Select all

{
  "ID": 1148026,
  "folderID": null,
  "attachmentID": "gfliDOIHd1kAH8lDjYu_YfQCzdixRQoQgHUIfB64s7w",
  "attachmentName": "image_20241121_125433_660.jpg",
  "companyID": 3
}
- Send a get request with the attachment ID to get the base64 data.

Code: Select all

https://xxx.simprosuite.com/api/v1.0/companies/3/jobs/1148026/attachments/files/gfliDOIHd1kAH8lDjYu_YfQCzdixRQoQgHUIfB64s7w?display=Base64
- Receiving an attachment not found error.

Code: Select all

{
  "errors": [
    {
      "path": null,
      "message": "Job attachment not found.",
      "value": null
    }
  ]
}
If I resend the request the attachment is found and gets downloaded.
I've now added a 30 second delay to the initial request and it seems to be working.

Re: Error with webhook - Attachment uploads

Posted: Thu Nov 21, 2024 3:47 am
by caine
Still breaks 5% of the time (or 100s of times per day) even with the 30sec delay.
Adjusted to loop and wait for the attachment to sync properly.

Re: Error with webhook - Attachment uploads

Posted: Fri Nov 22, 2024 5:32 am
by SimproAPITeam
Interesting, could you share the build detail that are experiencing this problem to help with our investigation through PM?

Thanks!

Re: Error with webhook - Attachment uploads

Posted: Thu Dec 12, 2024 6:23 am
by caine
Hi,

I've sent the requested details via PM but not received any reply.
Simpro support have suggest I come back here to ask for an update.

Re: Error with webhook - Attachment uploads

Posted: Fri Dec 13, 2024 3:47 am
by SimproAPITeam
Hi caine,
We have replied to your private message regarding the attachments.

Regards

Re: Error with webhook - Attachment uploads

Posted: Mon Dec 30, 2024 11:48 pm
by caine
Still facing issues with this.

Bug can be replicated easily:

Setup webhook for job attachments created.
Setup a trigger based on the webhook to send a GET request using the attachment ID that we were just told is available.
Upload an attachment via the mobile application. (WebUI attachments are not affected by the bug)

Webhook will trigger request to download the attachment.
Simpro will reply that the attachment does not exist and will continue replying this for up to a couple of minutes.

To fix - Don't send the webhook until the attachment is actually synced and available to view/download?

Re: Error with webhook - Attachment uploads

Posted: Tue Jan 14, 2025 10:37 pm
by caine
Hi,
Can we get an update if this is going to be looked into or fixed please?

Re: Error with webhook - Attachment uploads

Posted: Wed Jan 22, 2025 4:25 am
by SimproAPITeam
Hi Caine,
This seems to be related to the mobile app rather than the API as data uploaded through Simpro and the API is returned as expected within a reasonable time.

I will gather the provided information and create a ticket so this can be investigated internally by the right teams.

Please report similar issues through our Simpro help desk in the future. This will help us triage correctly and assign issues to the right teams for faster responses. This will also ensure that you get reference number that can be referenced for future communication.

See more information here.
viewtopic.php?f=3&t=2675

Regards