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

Upload Content Document Through API



I am looking for a way to upload a document to a workspace. It does not seem that it can be done in the same way as uploading to the Documents tab or Attaching to a record. There is no body field accessible through the standard API so how to send to the content?


I came across the Bulk API, but this seems to be designed for uploading multiple records rather than ContentDocuments as there would be no exposed body field.


Any ideas on how to programatically contribute a local document to a workspace?





You create a ContentVersion object, setting the VersionData field to be the actual document contents.


Can you guide me, if I am using Adobe Flex to upload the content files, how I can get data for versionData field if the ContentVersion object from my FileReference. Plesae guide.