Posts

Salesforce REST API: How to Expose Apex Classes as REST API Endpoint - POST

Image
Looking for Salesforce Training & HandsOn Projects? Trailblazer Profile  |  LinkedIn  |  Salesforce Blog  |  Facebook  |  Youtube Channel  |  WhatsApp Community This article is in continuation of my previous article  How to Expose Apex Classes as REST Web Services - GET Operations  where I have explained how to implement a GET Operation.   In this article, we will look into the detailed implementation of exposing Apex class as REST Web Service offering a POST operation to delete records from Salesforce Object(s).    To start with the demo, I have set up some of the data in Accounts Object (Standard Object) which has Invoices Record as its Child   Step-1 & 2:  I have added an Account  “acr001”  in Accounts Object Step-3 & 4:  I have added a few  “Invoice Records”  which are associated with Customer  “acr001”   Step-5 & 6:  If we click an...

Salesforce REST API: How to Expose Apex Classes as REST API Endpoint - GET Operations

Image
Looking for Salesforce Training & HandsOn Projects? Trailblazer Profile  |  LinkedIn  |  Salesforce Blog  |  Facebook  |  Youtube Channel  |  WhatsApp Community Salesforce allows developers to expose Apex classes and methods so that external applications can access your code and your application through the REST architecture.   Calls to Apex REST classes count against the organization's API governor limits. All standard Apex governor limits apply to Apex REST classes. For example, the maximum request or response size is  6 MB for synchronous Apex or 12 MB for asynchronous Apex . Apex REST supports the following authentication mechanisms: OAuth 2.0 Session ID   In this article, we will look into the detailed implementation of exposing Apex class as REST Web Service offering a GET operation to read data from Salesforce Object(s).   To start with the demo, I have set up some of the data in Accounts Object which we wi...

Salesforce REST API: How to Execute Bulk API Operations Using Composite Batch Resource

Image
Looking for Salesforce Training & HandsOn Projects? Trailblazer Profile  |  LinkedIn  |  Salesforce Blog  |  Facebook  |  Youtube Channel  |  WhatsApp Community Composite resource offered by Salesforce allows used to execute a series of REST API Requests in single call. Each of the child request is called as Subrequest. After the execution we will get Response Bodies & corresponding HTTP status for each subrequest with in the same call. Using this design pattern has a huge advantage of reducing number of API Calls to Salesforce. Since the whole series of requests counts as single call towards the API Limits. Possibilities are limitless so plan your solutions using the best design pattern at hand for the given piece of problem. In this blog we will discuss the implementation of “Composite/Batch” design pattern to solve a business problem. To start with this demo I am having a scenario where I need to Post some “Invoices” ...