REST API

REST API includes new and changed resources.

New Resources

Composite Resources
Salesforce introduces two composite resources for improving your application’s performance by minimizing the number of round trips between client and server.
Batch
vXX.X/composite/batch
The Batch resource lets you execute a sequence of independent subrequests. For example, you can update the name on an account and get the account’s field values in a single request.
{
"batchRequests" : [
    {
    "method" : "PATCH",
    "url" : "v34.0/sobjects/account/001D000000K0fXOIAZ",
    "richInput" : {"Name" : "NewName"}
    },{
    "method" : "GET",
    "url" : "v34.0/sobjects/account/001D000000K0fXOIAZ"
    }]
} 
The response contains the status codes of each subresponse and the responses themselves.
{   
"hasErrors" : false,
"results" : [
    {     
    "statusCode" : 204,
    "result" : null
    },{
    "statusCode" : 200,
    "result" : { Account attributes }
    }] 
}
The Batch resource supports batching for the following resources and resource groups.
Versions
/
Resources by Version
vXX.X
Limits
vXX.X/limits
SObject resources
vXX.X/sobjects/
Query
vXX.X/query/?q=soql
QueryAll
vXX.X/queryAll/?q=soql
Search
vXX.X/search/?q=sosl
Connect resources
vXX.X/connect/
Chatter resources
vXX.X/chatter/
SObject Tree
vXX.X/composite/tree
Note

Note

The SObject Tree resource is available through a pilot program. For information on enabling this resource for your organization, contact Salesforce.

The SObject Tree resource lets you create multiple sObject trees that share a root record type. An sObject tree is a collection of nested, parent-child records with a single root record. Once the request is processed, the records are created and parents and children are automatically linked by ID. In the request data, you supply the record hierarchies, required and optional field values, each record’s type, and a reference ID for each record.
{
"records" :[{
    "attributes" : {"type" : "Account", "referenceId" : "ref1"},
    "name" : "SampleAccount",
    "phone" : "1234567890",
    "website" : "www.salesforce.com",
    "numberOfEmployees" : "100",
    "type" : "Analyst",
    "industry" : "Banking",
    "Contacts" : {
      "records" : [{
         "attributes" : {"type" : "Contact", "referenceId" : "ref2"},
         "lastname" : "Smith",
         "title" : "President",
         "email" : "sample@salesforce.com"
         },{         
         "attributes" : {"type" : "Contact", "referenceId" : "ref3"},
         "lastname" : "Evans",
         "title" : "Vice President",
         "email" : "sample@salesforce.com"
         }]
      }
    },{
    "attributes" : {"type" : "Account", "referenceId" : "ref4"},
    "name" : "SampleAccount2",
    "phone" : "1234567890",
    "website" : "www.salesforce2.com",
    "numberOfEmployees" : "100",
    "type" : "Analyst",
    "industry" : "Banking"
     }]
}
Upon success, the response contains the IDs of the created records.
{
    "hasErrors" : false,
    "results" : [{
     "referenceId" : "ref1",
     "id" : "001D000000K0fXOIAZ"
     },{
     "referenceId" : "ref2",
     "id" : "001D000000K0fXPIAZ"
     },{
     "referenceId" : "ref3",
     "id" : "003D000000QV9n2IAD"
     },{
     "referenceId" : "ref4",
     "id" : "003D000000QV9n3IAD"
     }]
}
If an error occurs while creating a record, the entire request fails and the response contains only the reference ID of the record that caused the error and the error information.

A single request can contain up to 200 records. Because an sObject tree can contain a single record, you can use this resource to create up to 200 unrelated records of the same type.

Changed Resources

Describe Global
/vXX.X/sobjects
The If-Modified-Since HTTP request header is now supported, enabling you to determine if an object’s metadata has changed. You can include the If-Modified-Since header with a date in EEE, dd MMM yyyy HH:mm:ss z format when you use the Describe Global resource. If you do, response metadata is returned only if an available object’s metadata has changed since the provided date. If no metadata has been modified since the provided date, a 304 Not Modified status code is returned with no response body.
Suggest Article Title Matches
/vXX.X/search/suggestTitleMatches
The Suggest Article Title Matches resource now suggests Salesforce Knowledge articles whose titles contain the entire query string, except stopwords, such as “a,” “for,” and “the.” Results now include articles if their titles contain words from the query string in a different order.