Sunday, 7 May 2023

Salesforce Standard API vs Custom API

When it comes to integration requirements, it's always a significant question, and external teams often wonder why we should invest time in building a custom API when Salesforce already provides a standard API.

Here are the points that can be used to make a design decision based on the business requirement.

Standard API:

Pros:

  • Readily available for immediate use without any additional setup time or effort required
  • Maintenance-free
  • Optimal performance can be expected as it's a built-in standard feature

Cons:

  • Highly interdependent. If any changes are made to the schema, they must also be reflected in the external system, otherwise it will result in failure (e.g., modifying or removing a field's API name)
  • The absence of error handling adversely impacts investigation and troubleshooting
  • Native support for monitoring and alerting is absent, but custom logic can be added to the object trigger to provide this functionality if necessary
  • "Retrieving nested child object data for a parent requires individual calls to each child object, rather than being able to retrieve it in a single call. As an example, this would apply to Account --> Case and Contact
  • The system only follows the platform's sharing and security rules and does not permit the use of 'with' or 'without' sharing principles flexibly
  • Modifying the response received from the standard API is not possible, even if we need it in a different format. In such cases, a Salesforce case must be raised, but there is no guarantee that the response will be changed according to custom requirements
  • It is not feasible to implement any custom logic such as validations and mapping

Custom API:

Pros:

  • Custom APIs offer a high degree of customization, effectively addressing all the limitations of the standard API mentioned above.
  • There is not a significant variation in performance between custom and standard APIs

Cons:

  • Building a custom API demands development efforts and subsequent ongoing maintenance in accordance with business requirements


No comments:

Post a Comment