What is the difference between @RestResource and @InvocableMethod?

RestResource Annotation 
The @RestResource annotation is used at the class level and enables you to expose an Apex class as a REST resource. @RestResource is at the class level. It is used to expose a class as rest source.

Example - http://www.infallibletechie.com/2017/08/simple-inbound-rest-api-using-apex-in.html

InvocableMethod Annotation 
Use the InvocableMethod annotation to identify methods that can be run as invocable actions. Invocable methods are called with the REST API and used to invoke a single Apex method. Invocable methods have dynamic input and output values and support describe calls. @Invocable Method is used at the method level. these are called with REST API and it is used to invoke a single method.

Example - http://www.infallibletechie.com/2016/08/invocable-method-in-salesforce.html

No comments:

Post a Comment