Files
Adds files by URL to a deal, contact or company. The files are saved at once with your URL as src and importStatus pending, and copied to PaintScout's storage in the background. Read the record again later to see each file's final src and importStatus. The request fails with a 400 if it has more than 10 files, or if a URL is not https or resolves to a private address.
The document ID to attach files to
The document type (deal, contact, or company)
Array of created files
The unique ID of the File
The title of the File
The URL of the File. For a file added by URL, this is the URL you gave until the background copy finishes (importStatus pending) or fails (failed), and the PaintScout copy once it is stored.
The MIME type of the File (e.g. image/jpeg, application/pdf)
The file format/extension (e.g. jpg, pdf, png)
The visibility of the File
Where the background copy of a file added by URL stands. pending: not finished, src is your URL. stored: src is the PaintScout copy. failed: the file was refused or could not be fetched, src stays your URL and importError says why.
Why the background copy failed, as a fixed sentence (for example, the file type is not supported, the file is too large, or the copy could not be started). Set only when importStatus is failed.
Bad Request
Not Authorized
Not found
Unexpected error
POST /v2/files?docId=text&docType=deal HTTP/1.1
Host: openapi.paintscout.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 95
{
"files": [
{
"url": "https://example.com/photo.jpg",
"title": "Site Photo",
"visibility": "visible"
}
]
}[
{
"id": "abcd1234-abcd-1234-abcd-abcd1234abcd",
"title": "Site Photo",
"src": "https://example.com/files/photo.jpg",
"type": "image/jpeg",
"format": "jpeg",
"visibility": "visible",
"importStatus": "pending",
"timestamp": {
"created": 1672531200,
"updated": 1672617600
}
}
]Last updated
Was this helpful?

