I'm building a headless solution on top of Salesforce and using Community Users to log in.
I want those users to be able to upload files to a case. In experience builder it is calling this endpoint to upload the file: POST https://experience-site/chatter/handlers/file/body with the authentication headers and multipart/form-data.
When I try to do this with Postman and my access token I have from 0Auth2 I get the following:
{
"errormessage": "The action you performed was invalid for your session. Please refresh your page and try again."
}
Using the REST API to POST a new ContentVersion (POST /services/data/v58.0/sobjects/ContentVersion) I get this:
[
{
"message": "You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.",
"errorCode": "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY",
"fields": [
"NetworkId"
]
},
{
"message": "You must have a valid content feature license to publish into a private library.",
"errorCode": "INVALID_ID_FIELD",
"fields": [
"FirstPublishLocationId"
]
}
]
How can I let community users upload files so I get back the ContentVersionId I need to attach it to a Case?