1

We're trying to allow Customer Community Users to upload files using our portal.
When I try to use the REST API to upload a file I get a 403 Forbidden response. The response body has message":"API is disabled for this User","errorCode":"API_CURRENTLY_DISABLED
The profile has read, create and edit privileges on the object to which we are trying to attach the file.

  • Isn't it available as default functionality? Why you creating your own rest api? – LetMeCodeYou Jul 29 '18 at 12:07
  • Because we are using a Site with our own JS frontend to upload the files to SF. – AvailableName Jul 29 '18 at 12:18
  • I think you're going to want to have an API user assigned to the actual integration to your web site where the upload is going to (that's what I think you're saying you're doing as opposed to using Salesforce Sites). I'd recommend trying configure it to use Named Credentials or something similar. You'll then need to create permissions to allow your community users to access the service. – crmprogdev Jul 29 '18 at 12:52
  • I think it may be because I'm missing some kind of configuration to my site and/or community. For example, I can't share an existing file with a community user. Not via the Files tab (can't find any Community user) nor creating a ContentDocumentLink in code (INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY). – AvailableName Jul 29 '18 at 13:07
1

I was somehow able to resolve this.
I don't know exactly what did it (I was trying a lot of different things) but I can now use the REST API to upload files as a Customer Community User. It is probably a combination of the following:

  • Activating Apex REST Services on the user profile
  • Activating API Enabled on the user profile
  • Activating Portal User Visibility in the Sharing Settings
  • Activating Community User Visibility in the Sharing Settings
  • Adding the Files tab to the profile and to the community
    (Probably not this one)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.