I’m having an issue when a form is created “outside” of a job; the form response is linked to “regardin_object = inboxMessage”, the record shows that a “document_attachment_uuid” exists however when trying to retrieve the attachment using the api call https://api.servicem8.com/api_1.0/dboattachment/{uuid}.json I get an error code 404 “record not found”
I have tried to update the form response to associate it to a job, which in the ui gives me access to a pdf version of this completed form but I still can’t access that same attachment through the API.
In the API, a FormResponse’s document_attachment_uuid is intended to be the UUID of the document attachment generated from that form response (a PDF stored as an attachment).
When you call GET /dboattachment/{uuid}.json, a 404 means the requested record doesn’t exist (or has been deleted).
To confirm whether that UUID actually exists as an Attachment record in your account, try listing attachments with a filter on the UUID.
Example: GET /attachment.json?$filter=uuid eq '{document_attachment_uuid}' (URL-encode the $filter expression in your real request).
Because your FormResponse is linked to an Inbox Message (regarding_object = inboxMessage), it’s also worth fetching the inbox message itself via GET /inboxmessage/{uuid}.json and checking whether the PDF is referenced there instead.
If your goal is to associate the message (and its attachments) to a job, the API also supports attaching an inbox message to an existing job via POST /inboxmessage/{uuid}/attach-to-job.json.
If you still see document_attachment_uuid populated but it’s not returned by /attachment.json and /dboattachment/{uuid}.json is 404, email support@servicem8.com with the FormResponse UUID and the document_attachment_uuid and we’ll investigate what’s happening in that specific case.
I have gone in a tried a few more things and will try and clarify what was done as I feel there might be a glitch or I might be glitchy myself.
My original workflow objective and actions - I’m trying to save all our completed "pre-starts & T5” forms to our SharePoint for compliance:
I started with an API Call /formresponse.json?$filer={form_uuid}eq ‘{the pre-start form uuid}’
Saved responses to Sheet
Attempt to retrieve the {document_attachment_uuid} and am faced with the following issues:
When forms are completed outside of a job, the response is placed in the inbox as it should, the API calls returns a {document_attachment_uuid} but when attempting to retrieve the said attachment using dboattachment/{document_attachment_uuid}.json I receive the 404 response “record not found”
As a side note it appears that within the inbox, {document_attachment_uuid} records disappear after about a year - I assume that there is an automatic archive of older messages
Following your advices I have used 1 of the form as an example and then tried to:
POST /inboxmessage/{uuid}/attach-to-job.json - I can see the form now appears in the UI against that job but the pdf doesn’t seem to have been generated.
running an API call to retrieve form response Get formresponse/{uuid}.json I confirmed the document_attachment_uuid and that the form response is now in regarding_object = Job
Running API call to retrieve the attachment and am faced with the same issue
@Cody is this something I could try differently? Is there an issue with the api and retrieving pdf from inboxmessage? is there an API call to generate a pdf using a form’s answers? Any additional suggestions I could try to achieve my primary goal?
Many thanks for the help to date and looking forward to solving this curly one!
From the API side, document_attachment_uuid on a FormResponse is intended to link to the PDF document attachment generated from that form response.
If GET /dboattachment/{document_attachment_uuid}.json is returning 404, that means the attachment record doesn’t exist (or has been deleted).
A couple of quick checks that usually narrow down what’s happening:
Confirm you’re filtering FormResponses using the documented $filter syntax (not $filer), for example: GET /formresponse.json?$filter=form_uuid eq '{your_form_uuid}' (and URL-encode in your real request).
Confirm the attachment record exists by listing attachments and filtering by UUID: GET /attachment.json?$filter=uuid eq '{document_attachment_uuid}'.
For forms completed “outside a job”, also pull the Inbox Message detail record (GET /inboxmessage/{uuid}.json) as this is designed to return the message details including attachments.
On the “disappearing after a year” side note: inbox messages can be archived (is_archived), and the list endpoint supports a filter=archived option, so it’s worth checking whether older items are archived rather than removed.
Also worth noting: POST /inboxmessage/{uuid}/attach-to-job.json attaches an inbox message to an existing job, but it doesn’t generate (or regenerate) a PDF from a FormResponse as part of that operation.
If you’re still seeing document_attachment_uuid populated on the FormResponse but (a) /attachment.json?$filter=uuid eq '...' returns nothing and (b) /dboattachment/{uuid}.json is 404, that looks like a data integrity issue we’ll need to inspect within your account.
Email support@servicem8.com with the FormResponse UUID, the document_attachment_uuid, and the InboxMessage UUID you’re seeing it under, and we’ll dig into that specific case.
Many thanks for taking the time to respond and help me with this one Cody, I have tried all that you’ve suggested and still having issues so I will take it to support.