ECM | Uploading Attachments to Imaging Invoices
  • 17 Oct 2024
  • 3 Minutes to read
  • Dark
    Light

ECM | Uploading Attachments to Imaging Invoices

  • Dark
    Light

Article summary

Introduction

This document will outline the best practices and processes that should be followed when using CMiC’s ECM APIs.

ECM Endpoints

ECM offers several APIs meant for a multitude of use cases for uploading files and/or linking attachments to a CMiC pre-posted voucher/invoice. Below is a list of available APIs.

ApplicationEndpoint
AP Registered Invoice + Attachmentecm-rest-api/jersey/v1/UploadData/uploadApRegInvoice
Linking Existing AP Voucher to attachmentecm-rest-api/jersey/v1/uploadDoc/upload
Subcontract Invoice + Attachmentecm-rest-api/jersey/v1/UploadData/uploadRegPayRequest
Purchase Order Invoice + Attachmentecm-rest-api/jersey/v1/UploadData/uploadPoInvoice
Imagingecm-rest-api/rest/v1/ImgSources
ecm-rest-api/rest/v1/ImgSourceDocTypeV
ecm-rest-api/jersey/v1/UploadData/createDoc

Considerations

APIs 2, 3 and 4 were designed for their corresponding objects in CMiC. The APIs have built-in validations (shown as error messages) to indicate when required data is missing from the payload. The sample payloads seen in the screenshots include the required fields, but also other additional ones.


NOTE: Any field exposed on the flysheet in the Imaging Setup can be sent in via the API to include data on the flysheet. Limitations to front-end UI fields do not apply. This rule applies to APIs 2 through 5.


Step-by-Step Process

  1. Call /ecm-rest-api/rest/v1/ImgSources
    1. This web service is used to retrieve the list of Imaging Sources.
    2. Find the source you plan to upload to and make note of the ImgsVUuid value.

    NOTE: This cannot be the “All Sources” source.


  2. Call /ecm-rest-api/rest/v1/ImgSourceDocTypeV
    1. This web service is used to retrieve the list of all available Document Types.
    2. Find the document type you plan to upload to and make note of the ImgsdtDocTypeUuid value.
      1. This document type must be linked to the source you will be uploading to. It can be verified on the front end.

Once you have these details, there are five options for uploading web services, depending on your use case. 


NOTE: For these web services, the Content-Type MUST be multipart/form-data, where the flysheet payload data is passed in as fileDetails and the Imaging document as document-content-file.


  1. /ecm-rest-api/jersey/v1/uploadDoc/upload
    1. This is used to link a new attachment via CMiC Imaging to an existing voucher in CMiC.
    2. It is commonly used by Textura integration.
    3. Refer to the Developers Guide: Linking Attachments to an existing AP Voucher
    4. The payload enclosed in fileDetails would take on the structure as shown in the screenshot below:

    NOTE: This API is linked to existing vouchers in the system, so the payload only consists of the shown five fields. Anything else that gets passed in the payload will be ignored.


  2. /ecm-rest-api/jersey/v1/UploadData/uploadPoInvoice
    1. This is used to upload a new document with associated PO invoice data.
    2. Pre-requisite: The PO Invoice header and detail flysheets must be set up on the document type in CMiC Imaging to upload the backup attachment.
    3. Refer to the Developers Guide: Linking an attachment to PO invoice under CMiC Imaging.
    4. The payload enclosed in fileDetails would take on the structure as shown in the screenshot below:
  3. /ecm-rest-api/jersey/v1/UploadData/uploadRegPayRequest
    1. This is used to upload a new document with associated Registered RFP data.
    2. Pre-requisite: A registered RFP header and detail flysheets MUST be set up on the document type In CMiC Imaging to upload an attachment.
    3. Refer to Developers Guide: Linking an attachment to a Registered Pay Request under CMiC Imaging.
    4. The payload enclosed in fileDetails would take on the structure as shown in the screenshot below:
  4. /ecm-rest-api/jersey/v1/UploadData/uploadApRegInvoice
    1. This is used to upload a new document with associated Registered Invoice data.
    2. Pre-requisite: A Registered Invoice header and detailed flysheets MUST be set up on the document type in CMiC Imaging to upload an attachment.
    3. Refer to Developers Guide: Creating an AP Registered Invoice with attachment in CMiC Imaging.
    4. The payload enclosed in fileDetails would take on the structure as shown in the screenshot below:
  5. /ecm-rest-api/jersey/v1/UploadData/createDoc
    1. This is used to upload a new document and flysheet data for custom user-defined flysheets.
    2. Refer to Developers Guide: Creating a new attachment and custom flysheet in CMiC Imaging.
    3. The payload enclosed in fileDetails would take on the structure as shown in the screenshot below:

Additional Resources