REST API

REST API includes new and changed resources and enhanced cache validation support.

New Resources

Relevant Items
/vXX.X/sobjects/relevantItems
Gets the current user’s most relevant items. Relevant items include records for objects in the user’s global search scope and also most recently used (MRU) objects.

Changed Resources

Actions
/vXX.X/sobjects/actions
Beginning in v35.0, the Batch resource now supports Actions, /vXX.X/actions/, to improve your application’s performance.
For more information on invocable actions, see the Actions Developer’s Guide.
Search
/vXX.X/search/?qs=search string (Beta)
Added the qs parameter to allow simple searches using the GET method.
POST method is also now supported for more complex searches using the qs parameter.
This release contains a beta version of the qs parameter that is production quality. You can provide feedback and suggestions for this parameter on the IdeaExchange. For information on enabling this feature for your organization, contact Salesforce.
SObject Tree
/vXX.X/composite/tree/SObjectName
Previously we piloted the SObject Tree resource, which you can use to create nested records. The SObject Tree resource is now generally available, and XML support has been added. This resource is available within 24 hours after the Winter ’16 release.
Search Suggested Records
vXX.X/search/suggestions?q=search string&sobject=object type
The resource that auto-suggests records before you perform a full search was expanded with filters for groups, communities, topics, and users. The following request parameters were added:
  • fields
  • groupId
  • networkId
  • topicId
  • type
  • userId
  • where
The requested lookup fields’ values are returned in the response as part of the attributes element.
In the absence of a standard Name or Title response field, the main identifying field is used. For example, in cases, the Case Number is used.
Notes about usage and examples were updated to reflect current functionality.

New and Changed Headers for Cache Validation

We’ve enhanced support for cache validation through the introduction of HTTP entity tags (ETag) on SObject Rows results and two request headers that leverage them, If-Match and If-None-Match. We’ve also added a new, time-based validation request header, If-Unmodified-Since, and expanded support for If-Modified-Since.

ETag
The ETag header is a response header that’s returned when you access the SObject Rows resource. It’s a hash of the content that’s used by the If-Match and If-None-Match request headers in subsequent requests to determine if the content has changed.

Example request: /v35.0/sobjects/account/001D000000LFhvhIAD

Example response header: ETag: "U5iWijwWbQD18jeiXwsqxeGpZQk=-gzip"

ETag is supported only for account records.

If-Match
The If-Match header is a request header for SObject Rows that includes a list of ETags. If the ETag of the record you’re requesting matches any ETag specified in the header, the request is processed. Otherwise, a 412 Precondition Failed status code is returned, and the request isn’t processed. For example, let’s say you attempt to update the record from the previous example. In the request, if you include the If-Match header with the ETag returned in the previous response, the record is updated.

Example request header:

If-Match: "Jbjuzw7dbhaEG3fd90kJbx6A0ow=-gzip", "U5iWijwWbQD18jeiXwsqxeGpZQk=-gzip"
Example response:
HTTP/1.1 204 No Content
Record is updated
But if you include the If-Match header without the returned ETag, the record isn’t updated.
Example request header:
If-Match: "Jbjuzw7dbhaEG3fd90kJbx6A0ow=-gzip"
Example response:
HTTP/1.1 412 Precondition Failed
If-Match is supported only for account records.
If-None-Match
The If-None-Match header is a request header for SObject Rows that’s the inverse of If-Match. If the ETag of the record you’re requesting matches any ETag specified in the header, the request isn’t processed. A 304 Not Modified status code is returned for GET or HEAD requests, and a 412 Precondition Failed status code is returned for PATCH requests. For example, let’s say you attempt to GET the record data from the ETag example. If you include the If-None-Match header with the ETag returned in the response, a 304 Not Modified status code is returned.
Example request header:
If-None-Match: "Jbjuzw7dbhaEG3fd90kJbx6A0ow=-gzip", "U5iWijwWbQD18jeiXwsqxeGpZQk=-gzip"
Example response:
HTTP/1.1 304 Not Modified
But if you include the If-None-Match header without the ETag, the record data is returned.
Example request header:
If-Match: "Jbjuzw7dbhaEG3fd90kJbx6A0ow=-gzip"
Example response:
HTTP/1.1 200 OK
Record data
If-None-Match is supported only for account records.
If-Unmodified-Since
The If-Unmodified-Since header is a request header that’s the inverse of If-Modified-Since. If you make a request and include the If-Unmodified-Since header, the request is processed only if the data hasn’t changed since the specified date. Otherwise, a 412 Precondition Failed status code is returned, and the request isn’t processed. The If-Unmodified-Since header is supported for the same resources that support If-Modified-Since.
Example request header: If-Unmodified-Since: Tue, 10 Aug 2015 00:00:00 GMT
If-Modified-Since
The SObject Rows, Invocable Actions, and Describe Global resources now support the If-Modified-Since header.

Documentation Changes

Actions
/vXX.X/sobjects/actions
Actions can be created in versions 32.0 and later. For more information on actions, see the Actions Developer’s Guide.