You need to sign in to do that
Don't have an account?
Ahmad Kharbat
How to download Chatter Files from API?
Hi there.. I'm trying to download Files through the API
When I fetch the File info... the value of the [downloadUrl] is:
/services/data/v29.0/connect/files/069410000002wABAAY/content?versionNumber=1
Calling this endpoint in the API returns null or empty result.
Any idea what should be done here?
When I fetch the File info... the value of the [downloadUrl] is:
/services/data/v29.0/connect/files/069410000002wABAAY/content?versionNumber=1
Calling this endpoint in the API returns null or empty result.
Any idea what should be done here?
1. Make an API call to "connect/files/File-Id"
2. In order to download the file you need to grab its binary content first, and then handle the download yourself. In order to grab the binary content, you need to make an oauth-token-authenticated HTTP request to the downloadUrl provided in the object. For instance You can do this using cURL.
3. Once you grab the content, you can then print it using your programming language, after setting the header to the proper MIME type.
All Answers
Yes. Based on the Chatter Collaboration datamodel (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm) or the Chatter Cheat sheet (http://media.developerforce.com/cheatsheets/SF_chatter_4Pg_HR.pdf) you can find out that it's the ContentDocument table you're looking for if you want to find chatter files. You can query this through SOQL like this:
Using the REST API you can either use the query call
or use the ContentDocument endpoint for describe, recent items or record details
Hope this will help you,
Mark Best ANSWER if its works for you.
Thanks
karthik
It is there a way to stream its content, or generate a download link through the API ?
1. Make an API call to "connect/files/File-Id"
2. In order to download the file you need to grab its binary content first, and then handle the download yourself. In order to grab the binary content, you need to make an oauth-token-authenticated HTTP request to the downloadUrl provided in the object. For instance You can do this using cURL.
3. Once you grab the content, you can then print it using your programming language, after setting the header to the proper MIME type.