McMain icon

McMain

Interact with McMain API

Work Order → Add Documents

AI-generated

Summary

Add Documents to a Work Order

Inputs

  • id (required) — ID of the work order to which documents will be added.
  • documents — Collection of documents to upload; each document includes a fileName and base64 Data field.
  • requestOptions — HTTP request configuration including batching settings, SSL verification, proxy, and timeout.

Output shape

A JSON response object from the McMain API indicating success or failure, typically containing a status field or created resource details.

The exact shape may vary; errors return an error envelope, while successful calls may include created document IDs.

Examples

Example 1: Add a single document to a specific work order

Provide the work order ID, add one Document with fileName and Data, optionally set batchSize to 1.

Example 2: Add multiple documents in batches

Set batchSize to 50 and batchInterval to 1000 to send up to 50 documents per batch with a 1-second pause.

Discussion