Working with attachments

Work orders can have document attached to them. Documents can be attached by either you or your customer. In a typical scenario your customer may attach pictures of the problem that they want fixing and you may attach pictures of the completed work.

📘

WebHook notification available

For information about details of the notifications received, see Attachment added and Attachment removed.

Receiving attachments with a new work order

Work order received notification can include information about files that a customer attached during creation of a work order. These files are represented by the Attachment model that describes a file itself but does not contain file content.

If you are not using WebHook, call GET /api/attachments method to return a list of attachments added to a work order.

🚧

Attachments deletion

A customer can delete attachments at any time. If a customer deletes an attachment, the Attachment removed notification is sent. If you are not assigned to WebHook notifications, you can use GET /api/attachments method to get the up-to-date list of attachments.

Uploading files

To attach a file to a work order, use POST /api/attachments method of CorrigoPro Direct API.
Upload a file by using multipart/form-data, and add information about the attachment.

❗️

Important

  • You cannot attach files to a work order in statuses Rejected and Recalled.
  • The size of a file cannot exceed 20 MB.
  • You cannot modify the added attachment.

A request form data must have the following structure:

NameTypeVerificationDescription
FileFileMandatoryAttachment to be uploaded.
WorkOrderIdintMandatoryA unique identifier of a work order in the CorrigoPro system.
NameStringMandatoryAttachment name with the extension of the file.
DocumentTypeStringOptionalType of attachment ('Document', 'Picture', 'Signature', 'InvoicePrintout', 'ServiceContract', 'Misc')
MessageVisibilityStringOptionalDefines target of message ('None', 'CruOnly', 'CruSubs', 'CruLeads', 'CruLead', 'All'). 'All' by default.
MimeTypeStringMandatoryType of the attachment.
PerformedBy.NameStringMandatory,
Maximum length 100
Name of a person who uploads a file.
MessageIdStringOptionalPhone number of the person who uploads a file.
StringMandatory, Maximum length 36A unique identifier of the request.

If a request is successful, the AttachmentId is returned as a part of the response body.

The following is a response body example:

{
    "AttachmentId": "1eb17468-1272-4e2c-856f-1ce6c62ff094",
    "MessageId": "a5c7a3ca-5b1d-4701-817f-81f18b5d88f7"
}

Downloading files

To download an attachment, use GET /api/attachments/downloadUrl API method.
AttachmentId and WorkOrderId must be provided as parameters. As a result, you will get a temporary download link to the file.

❗️

Important

You can download the attached file from the obtained URL within 15 minutes after the link is provided. DO NOT SAVE THIS LINK!

Updating files

To update a file attached to a work order, use PUT /api/attachments method of CorrigoPro Direct API.

A request form data must have the following structure:

NameTypeVerificationDescription
WorkOrderIdintMandatoryA unique identifier of a work order in the CorrigoPro system.
AttachmentIdStringMandatoryAn attachment unique identifier
NameStringMandatoryAttachment name with the extension of the file.
DocumentTypeStringOptionalType of attachment ('Document', 'Picture', 'Signature', 'InvoicePrintout', 'ServiceContract', 'Misc')
MessageVisibilityStringOptionalDefines target of message ('None', 'CruOnly', 'CruSubs', 'CruLeads', 'CruLead', 'All'). 'All' by default.
MessageIdStringMandatory, Maximum length 36A unique identifier of the request.

If a request is successful, the MessageId is returned as a part of the response body.

The following is a response body example:

{
    "MessageId": "0f8fad5b-d9cb-469f-a165-70867728950e"
}

Deleting files

To delete a file attached to a work order, use DELETE /api/attachments method of CorrigoPro Direct API.

A request form data must have the following structure:

NameTypeVerification
WorkOrderIdintMandatory

If a request is successful, the MessageId is returned as a part of the response body.

The following is a response body example:

{
    "MessageId": "0f8fad5b-d9cb-469f-a165-70867728950e"
}