I'm creating a sync engine for a mobile app, and I want to get meta data about the state of a whole lot of different objects in as few API calls as possible. Is it possible to pass more than one SOQL statements in one API call or otherwise combine them? Or would I need to create an Apex class to integrate these different result sets into one Json? Is there a better way?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Perhaps one of the standard APIs can do this - if so hopefully someone will post that answer.
As far as creating your own class, this code compiles:
and in theory will return the query results for each SOQL string passed in with the platform taking care of the serialization (to JSON or XML) using its default algorithms.
But if you care about the URL patterns part of REST, using a POST to just GET data is inappropriate. If you don't need to pass the SOQL in, you can of course hard code the SOQL in the class and just use a GET.