You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying the ContentVersion object, the "VersionData" field that is returned is in the form of a URL such as
"services/data/v56.0/sobjects/ContentVersion/0688c000008XvddAAC/VersionData"
Anthony,This is working perfectly for me! Thank you so much!-CameronOn Jan 24, 2023, at 11:27 AM, Anthony Reilly ***@***.***> wrote:
Added a few things to 4.0.0-Beta to do this, some usage examples below:
SfContentVersion cv = await client.QuerySingle<SfContentVersion>("SELECT Id,VersionData FROM ContentVersion WHERE ID = '0688W00000kkHmSQAU'");
SfContentVersion cv2 = await client.GetObjectById<SfContentVersion>(SfContentVersion.SObjectTypeName, "0688W00000kkHmSQAU");
Stream resultStream = await client.BlobRetrieveStream(SfContentVersion.SObjectTypeName,"0688W00000kkHmSQAU","VersionData");
Stream resultStream2 = await client.BlobRetrieveStream("/services/data/v50.0/sobjects/ContentVersion/0688W00000kkHmSQAU/VersionData");
using (MemoryStream memoryStream = new MemoryStream())
{
await resultStream.CopyToAsync(memoryStream);
byte[] binary = memoryStream.ToArray();
}
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
When querying the ContentVersion object, the "VersionData" field that is returned is in the form of a URL such as
"services/data/v56.0/sobjects/ContentVersion/0688c000008XvddAAC/VersionData"
This url is apparently the sObjectBlobRetrieve. See below StackExchange article as well as Salesforce documentation
https://salesforce.stackexchange.com/questions/300845/download-contentversion-versiondata-in-python
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_blob_retrieve.htm
According to Salesforce if a user wants to actually get the File, they need to make a web request to this url like
httpClient.GetByteArrayAsync
This should be a method in the ForceClient class
The text was updated successfully, but these errors were encountered: