3

I'm trying to figure out how to best retrieve all of the ids returned by calling getUpdated. I'm using the REST API and I don't see anyway of retrieving a list of ids with a single request.

http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#CSHID=intro_usage_rest_resources.htm|StartTopic=Content%2Fintro_usage_rest_resources.htm|SkinName=webhelp

I've considered execution a SOQL query with a condition like Id in ids[] but the ids array is often to large and the request fails.

What is the most efficient way using the REST API to retrieve all updated ids?

  • getUpdated will return up to 200,000 IDs for a given object within a given time range. So, reduce the time range per each call to avoid hitting the limit – cropredy Oct 1 '14 at 0:44
  • the question is not about getUpdated, I'm wondering how do I get the instances given the IDs that come back from getUpdated. I was hoping there was a REST api that let me take the array of IDs from getUpdated and retrieve all of them. But I'm not seeing it. – spoon16 Oct 1 '14 at 1:11
  • did u try using the Bulk APIs which is also REST based... Reference Samples – Vamsi Krishna Oct 1 '14 at 1:23
  • 1
    I'm not aware of such REST service; only SOQL will get 2+ objects and it will be limited by the size of the query string. If you look at the SOAP API salesforce.com/us/developer/docs/api/… you can use retrieve() and pass in the list of IDs and get objects back in one call – cropredy Oct 1 '14 at 1:24
4

I am reasonably certain the REST API allows for only one object per retrieve (?)

The SOAP API however allows you to retrieve up to 2000 IDs per API call!

If you're doing a lot of data loading, the Bulk API may be a better fit for your app. For most other reasonably complex client apps, there may still be enough API differences that you'll benefit from using both the REST and SOAP APIs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.