2

I'm using the SObject Rows API to get the fields values of a given record. It works fine on existing records but when used on deleted records it returns with an error of {"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}.

As the docs note, Accesses records based on the specified object ID. Retrieves, updates, or deletes records.

Can I retrieve deleted records with this API? if not, is there a way to retrieve the deleted records field values/data for a given record ID?

0

1 Answer 1

1

QueryAll

QueryAll will return records that have been deleted because of a merge or delete. QueryAll will also return information about archived Task and Event records. QueryAll is available in API version 29.0 and later.

URI

https://ap1.salesforce.com/services/data/v31.0/queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account

For retrieving additional query results if the initial results are too large:

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_queryall.htm


Edit

Query Based on Id

/services/data/v35.0/queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account+WHERE+Id‌​='0019000001cH0ud'
5
  • But QueryAll does not let me query by a specific record, am I right? I don't want to query ALL my deleted records, just the ones I define by their ID Commented Jan 11, 2016 at 8:31
  • @AlonWeissfeld try with queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account+WHERE+Name='test'
    – Ratan Paul
    Commented Jan 11, 2016 at 8:32
  • I only have the ID, not any of the other fields Commented Jan 11, 2016 at 8:34
  • @AlonWeissfeld then use Id field /services/data/v35.0/queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account+WHERE+Id='0019000001cH0ud'
    – Ratan Paul
    Commented Jan 11, 2016 at 8:36
  • @AlonWeissfeld let me know if you have any issue here?
    – Ratan Paul
    Commented Jan 11, 2016 at 8:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .