List all files filtering for category Documents doesn't filter correctly

Hey there… I am having a lot of inconsistent results using filtering for the v2 files endpoint.

Have been trying to get a full list of all the files uploaded into contact list boxes. It’s not been clear exactly how to filter for these, but from what I can tell so far the category===DOCUMENTS is what I need to target, with most having file_box_type of CONTACT, IMAGE or APPLICATION.

However I don’t seem to be able to filter on the DOCUMENTS category. It just seems to ignore it, whereas others (e.g. HIDDEN) work fine. And depending the filters in the request it will even ignore is_public boolean.

The docs seem incomplete, and just wondering if I am doing something wrong or if there is a bug, or if I can dop something differently to get what I need.

CONTACTS covers most of the files, but I want to make sure I get them all. And some appear to be have different file_box_type.

For example first record returned when I filter on DOCUMENTS but it just accepts and then ignores. I try other categories and they work as expected

/crm/rest/v2/files?page_size=1000&filter=category%3D%3DDOCUMENTS



--- RAW FIRST RECORD (keys + sample) ---
{
"id": "343",
"file_name": null,
"is_public": false,
"contact_id": "0",
"category": "HIDDEN",
"created_by_id": "0",
"remote_file_key": null,
"file_box_type": "ATTACHMENT",
"file_size": 0,
"created_time": "2010-04-28T20:27:55.000Z",
"updated_time": "2014-01-01T05:00:00.000Z"
}

Hi Mark,

Thanks for bringing this to our attention. We’ll take a look at this internally to see what’s going on with the filtering behavior, and I’ll provide you with an update as soon as I have more information.

Thanks Omar. I am not a dev, but done a lot of this type of integration/API work so I think I covered my bases looking for mistakes at my end.

I need to export the file box files for each contact for a client, and make sure we keep track of the files for each contact, but there is no way to do this from UI. I was hoping to avoid running through each contact by ID, but might be my best option to make sure we don’t miss any files. Seems most contact files are in the contacts file box, but not all (some are in image and application not sure about any other file boxes). If only I cuuld filter on contact_id != 0 :slight_smile: