Whether to write custom REST API or use standard salesforce REST API

We have use case where user would enter information on IVR system and based on that we would like to fetch user details and transfer it to the agent. While we can use standard SOQL query REST API that is provided by salesforce, we are contemplating if we should right custom REST API instead. While using standard SOQL query makes development faster but it requires caller to know the salesforce object details and things like that vs custom REST API all caller needs to know is the interface which hides salesforce details from caller.

I am interested in any recommendation between the two approaches.

Answer

The answer really depends on many factors

1)Data volumes .How much data volumes are we querying against and how many rows are we retrieving or expecting at maximum

Out of box will be preferred if the following concerns apply:

2)Pagination need if large rows are returned

No custom code as out of box rest API provides pagination support.

Use of offset for custom build gono slow down API

3)availablity of apex developers if we need custom build .Lot of code to maintain in future

4)How flexible is the third party system that calls SFDC to write soql and parse XML or JSON.SFDC dev resources can write necessary soql for caller if needed

5)security -Custom services will allow you to be flexible(use with or without sharing) while standard will always follow platform sharing and security rules.

Out of box REST API definitely will have good performance .

Attribution
Source : Link , Question Author : adesai , Answer Author : Adrian Larson

Leave a Comment