13.07.2015 Views

Database.com REST API Developer's Guide - Salesforce.com

Database.com REST API Developer's Guide - Salesforce.com

Database.com REST API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using <strong>REST</strong> <strong>API</strong> ResourcesGet a List of Deleted Records Within a Given TimeframeExample for updating a recordcurlhttps://na1.salesforce.<strong>com</strong>/services/data/v25.0/sobjects/Line_Item__c/LineItemExtID__c/456-H "Authorization: Bearer token" -H "Content-Type: application/json" -d @updates.json-X PATCHExample JSON request body updates.json fileThis assumes another Merchandise__c record exists with a MerchandiseExtID__c value of 333.{}"Merchandise__r" :{"MerchandiseExtID__c" : 333}JSON example responseHTTP status code 204 is returned if an existing record is updated.Note that if your relationship type is master-detail and the relationship is set to not allow reparenting, and you try to updatethe parent external ID, you will get an HTTP status code 400 error with an error code ofINVALID_FIELD_FOR_INSERT_UPDATE.Get a List of Deleted Records Within a Given TimeframeUse the SObject Get Deleted resource to get a list of deleted records for the specified object. Specify the date and time rangewithin which the records for the given object were deleted. Deleted records are written to a delete log (that is periodicallypurged), and will be filtered out of most operations, such as SObject Rows or Query (although QueryAll will include deletedrecords in results).Example usage for getting a list of Merchandise__c records that were deleted between May 5th, 2013 and May 10th,2013/services/data/v29.0/sobjects/Merchandise__c/deleted/?start=2013-05-05T00%3A00%3A00%2B00%3A00&end=2013-05-10T00%3A00%3A00%2B00%3A00Example request bodyNone requiredJSON example response body{}"deletedRecords" :[{"id" : "a00D0000008pQRAIA2","deletedDate" : "2013-05-07T22:07:19.000+0000"}],"earliestDateAvailable" : "2013-05-03T15:57:00.000+0000","latestDateCovered" : "2013-05-08T21:20:00.000+0000"40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!