You need to sign in to do that
Don't have an account?
Alek Mesarovich 9
REST API: getting deleted records
I'm trying to get a list of deleted records through the REST API but it doesn't seem to be working.
Here is the CURL command I'm using (pretty much straight from the doc).
curl -v 'https://na30.salesforce.com/services/data/v20.0/sobjects/lead/deleted/' \
-H 'Authorization: Bearer <lots of characters>' \
-H 'X-PrettyPrint:1' \
-d 'start=2016-06-19T21:32:42.000+0000' \
-d 'end=2016-08-19T21:32:42.000+0000'
Here's the response I get:
[ {
"errorCode" : "NOT_FOUND",
"message" : "The requested resource does not exist"
} ]* Connection #0 to host na30.salesforce.com left intact
What should this command look like?
Here is the CURL command I'm using (pretty much straight from the doc).
curl -v 'https://na30.salesforce.com/services/data/v20.0/sobjects/lead/deleted/' \
-H 'Authorization: Bearer <lots of characters>' \
-H 'X-PrettyPrint:1' \
-d 'start=2016-06-19T21:32:42.000+0000' \
-d 'end=2016-08-19T21:32:42.000+0000'
Here's the response I get:
[ {
"errorCode" : "NOT_FOUND",
"message" : "The requested resource does not exist"
} ]* Connection #0 to host na30.salesforce.com left intact
What should this command look like?
In this case, you need to call your curl with -X GET. By default if you just call curl without the -X argument, it will be a POST.
Additionally, since this is a GET request, you need to append the start and end as a URI to the URLs.
The start and end string also needs to be in the right format and url encoded.
So the curl command should be something like the following:
curl -H 'Authorization: Bearer <access token>' -X GET 'https://na30.salesforce.com/services/data/v20.0/sobjects/Lead/deleted?start=2016-06-19T21%3A32%3A42%2B00%3A00&end=2016-08-19T21%3A32%3A42%2B00%3A00'
Hope this helps,
Felix