File Upload
Upload a file
- Endpoint:
POST /upload
- Allowed for:
Everyone authenticated to the CRM
- Parameter :
Name | Comment | Value |
---|---|---|
type | file type | landlord_document , property_image , user_avatar , client_logo , client_watermark |
Curl example :
$ curl -X POST 'http://api-v2.mycrm.com/upload?type=landlord_document'
- JSON response:
Name | Type | Read-only | Comment |
---|---|---|---|
token | string | yes | Unique identifier, valid for the next 24 hours |
type | string | yes | File's type |
link | string | yes | File's link |
- JSON response example:
{
"upload": {
"token": "azertyuiop",
"type": "landlord_document",
"link": "https://foo.com/bar/image.jpg"
}
}
In case of property_image
type, you will able to read extra fields:
{
"upload": {
"token": "azertyuiop",
"type": "property_image",
"link": "https://foo.com/bar/image.jpg",
"thumbnails": [
{
"format": "thumb",
"link": "https://foo.com/bar/image_thumb.jpg",
"width": 80,
"height": 80
},
{
"format": "medium",
"link": "https://foo.com/bar/image_medium.jpg",
"width": 80,
"height": 80
}
]
}
}
File structure
When a file is uploaded and its token used, it converted to a file object.
- Structure
Name | Type | Read-only | Comment |
---|---|---|---|
id | string | yes | File ID |
link | string | yes | File's link |
created_at | string | yes | Creation date |