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
Jose Da SilvaJose Da Silva 

Error "You do not have access to the Apex class named: OutboundInterfaceRunRestService"

Hi, I'm trying to make a REST API call at:

https://....salesforce.com/services/apexrest/...

but I'm getting this error:

{'message': 'You do not have access to the Apex class named: OutboundInterfaceRunRestService', 'errorCode': 'FORBIDDEN'}

It works if I use an admin user, but not with another user. What permissions should I give this user?
 
Best Answer chosen by Jose Da Silva
Raj VakatiRaj Vakati
Check the below permission 
  1. At profile level check API Enabled administrative permission enabled  or not ..( this is an optional ) 
  2. Users must also have access to the Apex classes that provide the Apex REST services. You can control security settings for Apex classes via the Apex Classes setup page in Salesforce. Go to Apex Class securities add this apex class to the profile 

You can specify which users can execute methods in a particular top-level class based on their user profile or permission sets. You can only set security on Apex classes, not on triggers.
To set Apex class security from the class list page:
  • From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
  • Next to the name of the class that you want to restrict, click Security.
  • Select the profiles that you want to enable from the Available Profiles list and click Add, or select the profiles that you want to disable from the Enabled Profiles list and click Remove.
  • Click Save.
To set Apex class security from the class detail page:
  • From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
  • Click the name of the class that you want to restrict.
  • Click Security.
  • Select the profiles that you want to enable from the Available Profiles list and click Add, or select the profiles that you want to disable from the Enabled Profiles list and click Remove.
  • Click Save.
To set Apex class security from a permission set:
  • From Setup, enter Permission Sets in the Quick Find box, then select Permission Sets.
  • Select a permission set.
  • Click Apex Class Access.
  • Click Edit.
  • Select the Apex classes that you want to enable from the Available Apex Classes list and click Add, or select the Apex classes that you want to disable from the Enabled Apex Classes list and click Remove.
  • Click Save.
To set Apex class security from a profile:
  • From Setup, enter Profiles in the Quick Find box, then select Profiles.
  • Select a profile.
  • In the Apex Class Access page or related list, click Edit.
  • Select the Apex classes that you want to enable from the Available Apex Classes list and click Add, or select the Apex classes that you want to disable from the Enabled Apex Classes list and click Remove.
  • Click Save.

All Answers

Raj VakatiRaj Vakati
Check the below permission 
  1. At profile level check API Enabled administrative permission enabled  or not ..( this is an optional ) 
  2. Users must also have access to the Apex classes that provide the Apex REST services. You can control security settings for Apex classes via the Apex Classes setup page in Salesforce. Go to Apex Class securities add this apex class to the profile 

You can specify which users can execute methods in a particular top-level class based on their user profile or permission sets. You can only set security on Apex classes, not on triggers.
To set Apex class security from the class list page:
  • From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
  • Next to the name of the class that you want to restrict, click Security.
  • Select the profiles that you want to enable from the Available Profiles list and click Add, or select the profiles that you want to disable from the Enabled Profiles list and click Remove.
  • Click Save.
To set Apex class security from the class detail page:
  • From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
  • Click the name of the class that you want to restrict.
  • Click Security.
  • Select the profiles that you want to enable from the Available Profiles list and click Add, or select the profiles that you want to disable from the Enabled Profiles list and click Remove.
  • Click Save.
To set Apex class security from a permission set:
  • From Setup, enter Permission Sets in the Quick Find box, then select Permission Sets.
  • Select a permission set.
  • Click Apex Class Access.
  • Click Edit.
  • Select the Apex classes that you want to enable from the Available Apex Classes list and click Add, or select the Apex classes that you want to disable from the Enabled Apex Classes list and click Remove.
  • Click Save.
To set Apex class security from a profile:
  • From Setup, enter Profiles in the Quick Find box, then select Profiles.
  • Select a profile.
  • In the Apex Class Access page or related list, click Edit.
  • Select the Apex classes that you want to enable from the Available Apex Classes list and click Add, or select the Apex classes that you want to disable from the Enabled Apex Classes list and click Remove.
  • Click Save.
This was selected as the best answer
Jose Da SilvaJose Da Silva
It works Raj, thanks!
Salesforce BlitzSalesforce Blitz
Is it possible to verify when a profile/class has been added/removed from class/proifle. Any specific object which saves this data.
Janet Chadwick 16Janet Chadwick 16
@Salesforce Blitz, you can check View Setup Audit Trail to see who has modified the profile and when.  It isn't a proper version history, though, and only shows the last 6 months. 
murphy momurphy mo
@janet Chadwick 16
Excuse me, could you kindly assist me in how to access @AuraEnabled decorated methods without user login?