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
CloudyCloudy 

How to convert a ContentVersion VersionData blob to a Base64Encoded String for Docusign Document

Hi,
I'm trying to get a ContentVersion file (a PDF) via the VersionData field and convert it for a Docusign Rest API Base64Encoded String.

For this I take the VersionData blob and use Encoding Util t get a String that I pass to the JSON DocumentBase64 property
String data = EncodingUtil.base64Encode(body);

But I get an error telling me that the file is not correctly formatted.
How can I transform my VersionData to a a Docusign Document?

thanks
VinayVinay (Salesforce Developers) 
Hi Cloudy,

Check similar reference below to convert contentversion versiondata to string.

https://salesforce.stackexchange.com/questions/231586/how-to-convert-contentversion-versiondata-to-string

Please mark as Best Answer if above information was helpful.

Thanks,