Hi Everyone i am working on a usecase where Partner Community (Experience Cloud) user is unable to create a ContentVersion record using the Salesforce REST API. i have a LWC Component and a button named preview, which upon click
A callout is made to an external system to generate the preview document.
After receiving the document, the application sends a POST request to the Salesforce REST API (/services/data/vXX.X/sobjects/ContentVersion) to create a ContentVersion record.
The REST API request fails with the following error:
Troubleshooting Performed
- The user has a Partner Community license.
- API Enabled permission has been granted to the user.
- Authentication is successful, and the REST API request reaches Salesforce.
- The user is the owner of the parent record (FirstPublishLocationId).
- Organization-Wide Defaults (OWD) have been changed to Public Read/Write for testing.
- The issue persists even after these changes.
is this salesforce Limitataion or i am missingsomething. Please guide.
Could you please try including the NetworkId of the Experience Cloud site in the ContentVersion POST request body?
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contentversion.htmThanks!