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
A request form data must have the following structure:
Name | Type | Verification | Description |
---|---|---|---|
File | File | Mandatory | Attachment to be uploaded. |
WorkOrderId | int | Mandatory | A unique identifier of a work order in the CorrigoPro system. |
Name | String | Mandatory | Attachment name with the extension of the file. |
DocumentType | String | Optional | Type of attachment ('Document', 'Picture', 'Signature', 'InvoicePrintout', 'ServiceContract', 'Misc') |
MessageVisibility | String | Optional | Defines target of message ('None', 'CruOnly', 'CruSubs', 'CruLeads', 'CruLead', 'All'). 'All' by default. |
MimeType | String | Mandatory | Type of the attachment. |
PerformedBy.Name | String | Mandatory, Maximum length 100 | Name of a person who uploads a file. |
MessageId | String | Optional | Phone number of the person who uploads a file. |
String | Mandatory, Maximum length 36 | A 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:
Name | Type | Verification | Description |
---|---|---|---|
WorkOrderId | int | Mandatory | A unique identifier of a work order in the CorrigoPro system. |
AttachmentId | String | Mandatory | An attachment unique identifier |
Name | String | Mandatory | Attachment name with the extension of the file. |
DocumentType | String | Optional | Type of attachment ('Document', 'Picture', 'Signature', 'InvoicePrintout', 'ServiceContract', 'Misc') |
MessageVisibility | String | Optional | Defines target of message ('None', 'CruOnly', 'CruSubs', 'CruLeads', 'CruLead', 'All'). 'All' by default. |
MessageId | String | Mandatory, Maximum length 36 | A 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:
Name | Type | Verification |
---|---|---|
WorkOrderId | int | Mandatory |
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"
}
Updated over 4 years ago