Document Management
Verified against source (5)
attachment/Attachment.csapplication/GenericObject.csAttachment/Attachment.ashx.csExtensions/AttachmentExtensions.csExtensions/AttachmentExtensions.cs
Documents are Attachment records. Operations follow the standard QBO route pattern:
/api/attachment/{operation}runs synchronously on the web server./api/attachment/queue/{operation}queues the operation (for example on SQS) for an app server. Use it for long-running work such as bulk generation or large transfers.
Classes and interfaces
Section titled “Classes and interfaces”| Type | Purpose |
|---|---|
Attachment |
A single document, bound to a parent through Object / ObjectID. |
AttachmentTemplate |
Behavior for a kind of document: Method (data), AttachmentService (generator), FileObjectAssembly (storage). |
IGenerator |
Renders a document from data (mail merge, delimited, Parquet, and so on). |
IFileObject |
Reads, writes, lists, and deletes files in a storage location. |
IDelivery |
Prepares and tracks delivery of mailed documents. |
Generate a document
Section titled “Generate a document”GET /api/attachment/generate?Template=Welcome Letter&Object=Contact&ObjectID=1Pass the template by name (Template) or ID (TemplateID), plus the parent Object and ObjectID. QBO fetches the template’s data, runs its generator, and saves the result as an attachment on the record.
For large batches, queue it:
GET /api/attachment/queue/generate?Template=Welcome Letter&Object=Contact&ObjectID=1Upload a file
Section titled “Upload a file”Upload in chunks of up to 500 KB. Small files fit in a single chunk:
POST /api/attachment/uploadchunk?Object=Organization&ObjectID=1&X-File-Name=Test.pdf&X-File-Size={size}{raw file bytes}The response includes finish and upload_name. If finish is false, send the next chunk with X-File-GUID={upload_name}, and repeat until finish is true.
Download or view
Section titled “Download or view”GET /api/attachment/download?ID=7GET /api/attachment/view?ID=7download tells the browser to save the file; view sends its MIME type so the browser can display it.
Copy, transfer, move, and watch
Section titled “Copy, transfer, move, and watch”| Operation | Copies the file | Repoints the attachment | Deletes the original |
|---|---|---|---|
copyfile |
Yes | No | No |
transferfile |
Yes | Yes | No |
movefile |
Yes | Yes | Yes |
GET /api/attachment/copyfile?ID=1988,1989&FileObject=SAN&PathURL=/{Object}/{ObjectID}/{Guid}.{Uri.Extension}GET /api/attachment/watch?FileObject=ClientAOut&Path=/ToQBO/&TransferTo=AmazonS3&Object=LoanPathURL supports substitutions such as {Guid}, {Year}, {Month}, {Uri.FileName}, {Uri.Extension}, and any Attachment column.
Process documents
Section titled “Process documents”| Operation | What it does |
|---|---|
ocrtodescription |
Extracts text into Attachment.Description for searching |
convert / convertsave |
Converts a document (for example to PDF) |
unzip |
Extracts a zip into one attachment per file |
aiclassify |
AI chooses the attachment template, running OCR first if needed |
aitranscribe |
AI transcribes an audio file (mp3) to text |
getduplicates |
Finds attachments with an identical file hash |
savefilehash |
Calculates and stores a file hash (optional Algorithm, e.g. SHA1) |
GET /api/attachment/getduplicates?ID=6&CompareID=13,27,28GET /api/attachment/savefilehash?ID=6&Algorithm=SHA1