Spring 15 - REST API new features, new resources, and changed resources in version 33.0

Knowledge Article Number

000206806

Description

Please find below the new features, new resources and changed resources in REST API version 33.0

Resolution

Insert and Update Blob Data is now Generally Available

Previously we piloted a REST feature that enabled you to use the SObject Basic Information and SObject Rows resources to upload files with a size of up to 500 MB to Salesforce standard objects. The feature is now generally available, and the maximum file size has been increased to 2 GB for files that are uploaded to Salesforce CRM Content. Now you can manage large file uploads by using REST API.

Use CORS to Access REST API

CORS (Cross-Origin Resource Sharing) is a W3C recommendation that enables Web browsers to request resources from origins other than their own (cross-origin requests). For example, using CORS, a JavaScript script at https://www.example.com can request a resource from https://www.salesforce.com.REST API now supports CORS. To access this API from JavaScript in a Web browser, add the origin that’s serving the script to the CORS whitelist. To add an origin to the CORS whitelist, from Setup, choose Security Controls > CORS. Click New, and then enter an origin URL pattern. The origin URL pattern must include HTTPS and a domain name and may include a port. The wildcard character (*) is supported and must precede a second-level domain name. For example, https://*.example.com adds all the subdomains of example.com to the whitelist. If a browser that supports CORS makes a request from an origin in the Salesforce CORS whitelist, Salesforce returns the origin in the Access-Control-Allow-Origin HTTP header, along with any additional CORS HTTP headers. If the origin isn’t in the whitelist, Salesforce returns HTTP status code 403.

/vXX.X/sobjects/PlatformActionPlatformAction is a virtual read-only object that enables you to query for actions—such as standard and custom buttons, quick actions, and productivity actions—that should be displayed in a UI, given a user, a context, device format, and a record ID.

List Invocable Apex Actions Resource

GET /vXX.X/actions/custom/apexReturns a list of all available invocable Apex actions. Apex invocable actions provide a way to encapsulate pieces of logic in an Apexmethod that can be used anywhere you can use Apex.Response{"actions" : [ {"label" : class_label,"name" : [namespace__]class_name,"type" : "APEX"} ]}

In Spring ’15, only one character is required in the q parameter for Chinese, Japanese, and Korean queries. We’ve also added a limit to the query string of 200 consecutive characters without a space break.

You can now use the query resource to get feedback on how Salesforce optimizes the query for a report or list view. You do this by using a report or list view ID instead of a query string when using the query resource with the explain parameter. Here’s an example using a report ID:

/services/data/v33.0/query/?explain=00OD0000001hCzMMAU

The response from the query resource has been improved to include additional details on Salesforce optimizations. These details are provided in the notes field of the response JSON data. Here’s an example excerpt showing that the IsDeleted field couldn’t be used for an optimization because that field in the Merchandise custom object isn’t indexed in Salesforce:{..."notes" : [ {"description" : "Not considering filter for optimization because unindexed","fields" : [ "IsDeleted" ],"tableEnumOrId" : "Merchandise__c"} ],...}

Process Rules Resource

The Process Rules resource returns all active workflow rules, not all workflow rules as was previously indicated