+ Start a Discussion

How to get deleted records info from Salesforce through REST API

We are doing iOS Mobile app integration with Salesforce through REST API. For the syncing prospective we also need to get the deleted records info from SFDC. When we are using SOQL "SELECT IsDeleted,Name FROM Table__c ALL ROWS", it is not fetching the deleted records. Is there any way to achieve this?





I develop Flex-application . In my project I use construction (ActionScript 3.0 code example):


connect = new Connection();

connect.getDeleted( "Table__c ", startDate, endDate, callbackFunction );

Ben PovlichBen Povlich

As far as I know, there is no way to get deleted records using the REST API.  I was also trying to do this and wound up using the SOAP API to implement the piece of code that needed to access deleted records.


Salesforce, can we get an official word on whether or not this is possible? It seems like a huge limitation in the REST API if one is unable to query deleted records.


getDeleted() in the SOAP API is currently the only reliable way to detect all record deletions.



SimonF wrote:

getDeleted() in the SOAP API is currently the only reliable way to detect all record deletions.

That's really disappointing to hear. Why is that and how is one to build meaningful applicaitons using the REST API if there's no way to syncronize deleted objects? We've invested hundreds of hours into a rewrite of the Salesforce Drupal integration using the REST API based on your documentation that states, and I quote,

"Its advantages include ease of integration and development, and its an excellent choice of technology for use with mobile applications and Web 2.0 projects. "


I've looked everywhere for comprehensive comparison of your APIs, and there isn't one, with your own docs stating that they are comparable. Please advise on a path forward for addressing this and if there are other limitations of the REST API we should know about. It's not reasonable to use the REST API for 95% of an application, then switch to the SOAP API for one or two calls. 


Simon, to follow up, you mention the REST API can't "reliably" be used to get deleted records. Would you mind clarifying what you mean by reliable, as in, will it work in some cases?


Also, is adding this ability to the REST API on the roadmap?


Sorry for any frustration, but we've invested a lot time into building a soltution with the REST API, which all signs point to being the way to go. So to hear about a critical feature like this not being supported is tough, and makes me nervous about what else we'll encounter without a comprehensive API comparison.


Thanks, Lev


Any news re: getDelted() for REST API?


An option 'show_deleted' for queries to include contents of the trash can (items w/ IsDeleted=true) would be quite useful.



arvind kumar 89arvind kumar 89
Get deleted Records using  Rest API

Get deleted:
<<https://instance.salesforce.com>> /services/data/v37.0/queryAll/?q=SELECT+Id,+Name+FROM+account+WHERE++LastModifiedDate+>+2017-02-27T05:20:00Z+AND+ IsDeleted+=+TRUE

It includes the deleted records.