Missing Webhook Events for Image Attachments from Mobile App

Originally posted by Anand

We have a custom integration between ServiceM8 and our CRM tool that relies on webhook events to process image attachments. We uploaded 33 photos to the job. Out of which, 3 were uploaded from desktop and we got the webhook events for those. But the other 30 were uploaded from Servicem8 app for which we didn’t receive any webhook event.


Below are our current webhook subscriptions:

[
  {
    "type": "object",
    "object": "Job",
    "callback_url": "https://xxxx/api/v1",
    "fields": [
      "billing_address",
      "status",
      "description",
      "job_address",
      "total_invoice_amount",
      "customfield_site_visit_completed"
    ],
    "unique_id": "",
    "active": true
  },
  {
    "type": "object",
    "object": "jobActivity",
    "callback_url": "https://xxxx/api/v1",
    "fields": [
      "start_date",
      "end_date"
    ],
    "unique_id": "",
    "active": true
  },
  {
    "type": "object",
    "object": "dboAttachment",
    "callback_url": "https://xxxx/api/v1",
    "fields": [
      "file_type"
    ],
    "unique_id": "",
    "active": true
  },
  {
    "type": "object",
    "object": "dboNote",
    "callback_url": "https://xxxx/api/v1",
    "fields": [
      "note",
      "object_name"
    ],
    "unique_id": "",
    "active": true
  },
  {
    "type": "object",
    "object": "Material",
    "callback_url": "https://xxxx/api/v1",
    "fields": [
      "name",
      "active"
    ],
    "unique_id": "",
    "active": true
  }
]

  1. Is the Attachment object fully supported for webhook subscriptions, and are there known issues with events for mobile app uploads?
  2. Are there specific fields other than file_type that we should include in the webhook subscription for reliable attachment event notifications

Hi there,

Thanks for reaching out about the missing webhook events for image attachments uploaded from the ServiceM8 app.

The dboAttachment object is fully supported for webhook subscriptions, and there are no known platform-level issues that would cause mobile app uploads to behave differently than desktop uploads. Both the mobile app and desktop web interface create attachment records via the same underlying API, so webhooks should fire consistently regardless of upload source.

Regarding your webhook subscription configuration, including just the file_type field should be sufficient to receive notifications for attachment changes. However, I’d recommend adding a few more fields to your subscription for better reliability and diagnostic capability:

  1. Consider subscribing to additional fields like attachment_name, related_object, related_object_uuid, and attachment_source. While file_type alone should trigger the webhook, having additional fields in your subscription can help with debugging and ensure you’re capturing all relevant attachment changes.

  2. The attachment_source field in particular can be useful because it indicates the source or type of the attachment (e.g., ‘INVOICE’, ‘QUOTE’), which may help you identify different attachment scenarios.

  3. For photos specifically, the attachment records will also include fields like photo_width, photo_height, lng, and lat (for geolocation), though these are read-only in the API.

A few troubleshooting steps to consider:

  1. Verify your webhook callback URL is correctly handling the verification challenge. When you add or modify a webhook subscription, ServiceM8 servers will make a POST request with mode=subscribe and a challenge parameter. Your callback must return only the challenge value.

  2. Ensure your callback URL returns a HTTP 200 response when invoked by ServiceM8. If your endpoint returns error codes, webhook delivery may be retried or eventually cancelled.

  3. Check that you’re properly handling the webhook payload format. Remember that webhook notifications only include the UUID and the list of changed fields — they don’t contain the attachment object itself or field values. You’ll need to use the REST API to retrieve the full attachment record using the resource_url provided in the webhook payload.

  4. Note that webhook timestamps are in UTC, which differs from most other ServiceM8 timestamps that use the account’s local timezone.

If you’re still not receiving webhooks for mobile app uploads after verifying these points, I’d recommend:

  1. Testing with a fresh webhook subscription to ensure it’s properly registered.
  2. Checking your server logs during mobile uploads to see if webhook requests are being received but failing validation.
  3. Verifying that the mobile app uploads are completing successfully and creating active attachment records (active=1).

Let us know if you continue to experience issues after checking these items, and we can investigate further.

Thanks,
Cody