0

I am sending a SOQL query through the REST API @ <baseurl>/services/data/v55.0/query/?q=<query>

I need to get deleted contacts. I just deleted a contact as a test and I cannot query it.

SELECT+Id+FROM+Contact+WHERE+IsDeleted+=+true

returns 0.

SELECT+Id+FROM+Contact+WHERE+IsDeleted+=+true+ALL+ROWS

When adding ALL ROWS I always get a "malformed query" error, stating that ALL ROWS not allowed.

1 Answer 1

2

You should be using the QueryAll REST resource instead.

Executes the specified SOQL query. Unlike the Query resource, QueryAll returns records that are deleted because of a merge or delete. QueryAll also returns information about archived task and event records. This resource is available in REST API version 29.0 and later.

Also remember to filter deleted records with the IsDeleted field like in your second example.

0

You must log in to answer this question.

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