Salesforce Certified Platform Developer II — Question 276
Which annotation exposes an Apex class as a RESTful web service?
Answer options
- A. @AuraEnabled
- B. @HttpInvocable
- C. @RestResource
- D. @RemoteAction
Correct answer: C
Explanation
The @RestResource annotation is specifically designed to expose Apex classes as RESTful web services, allowing external systems to interact with Salesforce data. The other options, such as @AuraEnabled, @HttpInvocable, and @RemoteAction, serve different purposes within Salesforce and do not provide RESTful service exposure.