Easymailing
Files

List the files of a record

GET /files

GET/files

Lists the files attached to one contact, company or opportunity, newest first, with name, type, size and who uploaded them.

When to use: To see which documents are kept on a record (contracts, proposals, images) before downloading one, renaming it or deciding whether another upload is needed.

When not to use: You must name the record: there is no list of all the files of the account. To read one file whose UUID you know, use get_file. To know how much storage the account has left, use get_file_storage_usage. For text written about a record, use list_notes.

Filters: Exactly one of contact, company or opportunity is required, with the UUID of the record; an empty value counts as not sent. A UUID that does not exist, or that the user cannot see, gives 404.

  • created_by: only files uploaded by that person or system, by the created_by.uuid of another file; unattributed returns the files nobody is attributed with.
  • search: files whose display_name contains the text, ignoring case; %, _ and ! are searched literally. Up to 100 characters after trimming; blank means no search. Only available files are listed: a file whose content has not been stored yet, or was refused, does not appear. The order is fixed (newest first); there is no order parameter. Pagination: files are paged with itemsPerPage (default 30, maximum 100) and an opaque cursor[gt]: to read the next page, call again with the same filters and the cursor[gt] of the hydra:next link of the previous response. The response gives the number of files that match the filters in hydra:totalItems; keep following hydra:next until a page comes back empty.

Permissions: Requires a CRM seat and the crm.contacts_companies.read 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.read capability and read access to its pipeline instead. A file the user cannot reach is reported as not found, never as forbidden.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Query Parameters

contact?string

UUID of a contact: its files. Send exactly one of contact, company and opportunity.

Formatuuid
company?string

UUID of a company: its files. Send exactly one of contact, company and opportunity.

Formatuuid
opportunity?string

UUID of an opportunity: its files. Send exactly one of contact, company and opportunity.

Formatuuid
created_by?string

Only files uploaded by this person or system: the created_by.uuid of another file, or unattributed for files nobody is attributed with.

search?string

Text the file name must contain, ignoring case. Up to 100 characters.

Lengthlength <= 100
itemsPerPage?integer

Files per page. Default 30, maximum 100.

Range1 <= value <= 100
Default30
cursor[gt]?string

Opaque cursor of the next page, taken from the hydra:next link of the previous response. Use it only with the same filters.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://api.easymailing.com/files?contact=3a9e1f52-6c47-4d08-b1a3-9e2d7c5f8a40&company=7f3c2a10-5b8e-4d1a-9c2e-3a6f0b9d4e21&opportunity=5d8a3c16-9e2b-4f70-a1c4-6b0e7d3f2a95&created_by=b7d3a1e6-5c28-4f90-8e14-2a6c9d0b3f57&search=proposal&itemsPerPage=30&cursor%5Bgt%5D=eyJ2IjoxfQ" \  -H "X-Auth-Token: YOUR_API_KEY"
[  {    "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"  }]