Getting the files via api

I want to get All file of the org via api. I am not getting files through api which are attached with particular contacts. is it possible? if yes then please let me know and share the documentation if any.

I already check the “list files” method but it doesn’t return files of particular contacts.

The only option for doing this right now is the REST implementation:

https://developer.infusionsoft.com/docs/rest/#!/File/listFilesUsingGET

@John_Borelli
I already tried this method and this method is not returning the files which are under particular contact. it only returns files which are under “my files” ,“Company files” ,“Company images”.

if I go to any particular contact and attach a file. and then fetching files using all files api https://developer.infusionsoft.com/docs/rest/#!/File/listFilesUsingGET

then I am not getting that file in the list of file I got from the response.

We currently have a story in our backlog to allow permission-specific access to a contact’s files via the API.

@TomScott

Can you let me know is there any way to get those file or I have to wait, if yes then when it will be available?

If you need to retrieve a file and you know it’s id, you can use the FileService.getFile XML-RPC endpoint to get it.
https://developer.infusionsoft.com/docs/xml-rpc/#file-retrieve-a-file

I do not have an ETA for when the contact files will be accessible through the REST API.

Hi Dave!

It’s been awhile since using the XML-RPC library, but I think DataService.Query could potentially do it.

Query the FileBox table using ContactId. Use the returned id to get a link to the file.

Example link format:
https://appname.infusionsoft.com/Download?Id=FileIdHere

https://developer.infusionsoft.com/docs/xml-rpc/#data-query-a-data-table
https://developer.infusionsoft.com/docs/table-schema/
^ checkout the FileBox table

hopefully it works out for you!

@TomScott , @Mark_Price

I understand that and I already tried that and I getting the file using it’s id through REST API as well.
We are integrating salesforce and infusionSoft and we want to fetch all the files which are in infusionSoft to Salesforce so we can’t go to each file and get them using id’s So we Need an api which can return all the files which are in infusionSoft (All means all). I used REST API which is https://developer.infusionsoft.com/docs/rest/#!/File/listFilesUsingGET

as you already know this API doesn’t return the file which are under specific contact as I explain in my previous post.
If there is any way to do this then please let me know.

Thanks

I check the XML-RPC and i make query on file but there is also a limit we can only get maximum 1000 records but we have more 100 thousand files so id there any option to use pagination or offset for that I can query all file records?

Thanks

Hi Dave,

Use the page parameter to return the next 1000 results. Page 0 has 1000 results, Page 1 has 1000 results etc. You’ll probably need to make a for loop to page through results.

hope it helps!

The FileBox table has the ContactId value. Best best is to try XML-RPC library to query that table.