Apex Classes as REST Web Services in Salesforce
Introduction to Apex REST Salesforce platform is amazing and its lets your create your own lightweight REST API using Apex. You can use this REST API to access force.com data, by authenticating the caller/consumer of API using standard oAuth and return data format support JSON/XML, purely depends how you want return back the data A few useful bits of information related to these REST APIs: Use standard HTTP verbs: GET, POST, PUT, PATCH, DELETE, and HEAD. You can use either HTTP or HTTPS. Use standard security to authenticate your REST calls via OAuth 2.0. Serialize your data in either XML or JSON format. This is done by defining your Apex class with the @RestResource annotation to expose it as a REST resource. Similarly, add annotations to your methods to expose them through REST. For example, you can add the @HttpGet annotation to your method to expose it as a REST resource that can be called by an HTTP GET request. Ap...