A company has a native iOS order placement app that needs to connect to Salesforce to retrieve consolidated information from many different objects in a JSON format. Which is the optimal method to implement this in Salesforce?
When an external application needs to request data from Salesforce, you must expose an endpoint. Since the requirement specifically mentions JSON format and a native mobile app (iOS), an Apex REST web service (Option D) is the optimal choice. REST (Representational State Transfer) is the industry-standard architecture for mobile-to-cloud integrations because it is lightweight, uses standard HTTP methods, and natively supports JSON.
By using the @RestResource and @HttpGet annotations in an Apex class, a developer can create a custom endpoint that performs complex logic, such as querying multiple objects (Accounts, Orders, Line Items), and returns a single, consolidated JSON response. This is far more efficient than the standard REST API if the mobile app would otherwise need to make multiple sequential calls to gather the same information.
Options B and C are incorrect because "callouts" are used when Salesforce requests data from an external system, not the other way around. Option A (SOAP) is a heavier, XML-based protocol that is less efficient for mobile development and does not use the JSON format natively. Therefore, a custom Apex REST service provides the best performance and flexibility for mobile integrations.
==========
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit