Profile photo - access contact filebox via API

We are developing a custom API integration. We need to pull a profile photo from each contact. Since that is not a standard field, we plan on using the filebox for each contact.

Currently, we make a request to “List Files” endpoint (/files) and try to fetch file by a specific contact_id. Once the correct file is matched, we try to download it using download_url field. In order to achieve this, the file public property should be set to true. However, all files with the contact_id have the public property equal to false. It is worth noting, when we try to download the file via download_url, the URL returns markup of the login page.

Few questions:

  1. Is there any way to download files with public: false property or change this property to true?

  2. What is the exact relationship between contacts and files?

  3. Since the file has a property contact_id but this id doesn’t match any of contacts id properties, is there a way to get files that are associated with specific contact?

I look forward to your reply.

Files are a way for service providers to distribute content to their clients. For instance, a common case is for someone who gives seminars to attach a PDF book to each Contact who attends their seminar, so that they can download a copy at their leisure. Thus, the contact_id on a File object is the Contact that would be able to access the file. It isn’t intended as a way to generally associate a file with a given Contact identity.

Currently, you can only retrieve Files that are assigned to your particular user context. If the context used to authenticate the application can View Company Files, then you can instead add the file using the COMPANY file association, and retrieve or delete them at a later time.