Send the content of a file
PUT /files/{uuid}/content
/files/{uuid}/contentSecond step of an upload: stores the bytes of a file declared with create_file and makes it available on its record. The request body is the raw file, not JSON.
When to use: Right after create_file, with its uuid, within 30 minutes. Send Content-Type: application/octet-stream and exactly size_bytes bytes as the body. The response is the file already available. If the response is lost, send the same request again: the same bytes give the same file without storing it twice.
When not to use: To replace the content of a file that is already available: it cannot be done; delete it with delete_file and upload the new one. To rename it, use update_file. There is no multipart or base64 form: the body is the binary itself.
Side effects: The file becomes available and its size is counted in the storage used by the account. A file.uploaded entry appears in the activity of the record, done by the person who owns the token (marked «via Maia» when Maia made the request). The content is checked to be what its extension says (a .pdf must really be a PDF); if it is not, or its size differs from size_bytes, the file is closed as failed, its reserved space is returned and a new create_file is needed. Nothing is sent to anyone, nothing is written to Google and no webhook fires. The call is synchronous: when it returns, the file is stored.
Permissions: Requires a CRM seat and the crm.contacts_companies.write capability. A file inherits the access of the record it is attached to: for a file of an opportunity the user needs the crm.opportunities.work capability and work access to its pipeline instead. A file the user cannot reach is reported as not found, never as forbidden.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the file. Get it from list_files (or from create_file while uploading).
uuidHeader Parameters
Always application/octet-stream. Any other value is refused with 415 before the body is read.
Value in
- "application/octet-stream"
Request Body
application/octet-stream
The raw bytes of the file, exactly size_bytes of them.
TypeScript Definitions
Use the request body type in TypeScript.
binaryResponse Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X PUT "https://api.easymailing.com/files/6e2b8f14-3a7c-4d95-b0e1-8c5a2d7f9341/content" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \ -d 'string'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "record": "/entity/1", "record_type": "contact", "display_name": "string", "description": "string", "original_name": "string", "mime_type": "string", "size_bytes": 0, "source": "upload", "status": "uploading", "previewable": true, "created_by": { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "kind": "user", "name": "string" }, "version": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}