function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
raviendiran p 9raviendiran p 9 

need to download attachments from accounts in salesforce using REST C#

Hi all,

need some sample code to download attachments from accounts in salesforce using REST API in c#
Daniel BallingerDaniel Ballinger
The basic curl example is available in Get Attachment Content from a Record (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_blob_retrieve.htm).

Create a System.Net.HttpWebRequest to the REST SObject Blob Retrieve (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_blob_retrieve.htm) resource. Add the Authorization header with the request with "Bearer" followed by the SessionId.

Call GetResponse() on the request and read in the response stream as binary data.