Upload
salesforce-developers
View
556
Download
2
Embed Size (px)
Citation preview
Enterprise API New Features and Roadmap
Jay Hurst Director, Product Management [email protected] @extraidea
Charlie Fineman Architect – Enterprise API [email protected] @SalesforceEng
Safe Harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Jay Hurst Director - Product Management, Salesforce [email protected] @extraidea
Charlie Fineman Architect – Enterprise API [email protected] @SalesforceEng
The Salesforce Enterprise API
With the variety of APIs available on the Salesforce Platform, may times it can be challenging to find the correct API for your task
Raise your hand if you:
• Have used the SOAP, REST, or Bulk API in Salesforce
• Have run into some limitation in these APIs that you would like to see filled
• Want to learn more about what features we have planned for these APIs
What is the Enterprise API?
Salesforce1 Enterprise APIs The Salesforce “Data” APIs
• Allow programmatic access to your salesforce data through various API technologies
• Many different APIs to suit your specific needs
Rest APIs
Access and manipulate data with a RESTful pattern with JSON and XML payloads
Soap APIs
Access and manipulate data using SOAP.
Streaming APIs
Subscribe to updates using a Bayeux / CometD HTTP Streaming API.
Bulk APIs
Perform Bulk Queries, Inserts, Updates, and Deletes Asynchronously.
Comprehensive Suite of APIs and Toolkits
Web Service Endpoint
Web Service Endpoint
Apex WS/REST
Outbound Messaging
Business Logic
Sync Bulk API
Streaming API Topic
CRUD
Data
Bayeux Client
Applications and Middleware
Java SDK Ruby gem PHP Toolkit
Mobile SDK
Mobile SDK
3rd Party Adapters
Apex Callouts
Summer ‘15 Features
Data Loader for Mac
Data Loader is a client tool to load and extract data through the Partner API • SOAP API
Mac support one of the largest Ideas on success.salesforce.com • 16K points to date
• Prior to Summer ‘15, only Windows support
Limitations are • No UI changes, just a mac installer and support
• Java 1.6 is required
New Integration Tools team will be advancing the feature over the upcoming releases
Batching REST Resource
• Resource which accepts multiple REST calls to execute • A single Batch REST request can execute up to 25 sub-requests
• Sub-requests contains the resource (URI) and the method to execute
• Each sub-request is an unrelated API call
• Sub-requests are executed serially, in order, and as the running user
• As each sub-request completes, the call is committed
• Has one optional parameter • haltOnError - indicates if the batch should stop on any error that is encountered
• The response will be a JSON object of responses from the sub requests
Traditional REST API Diagram
Batch REST API Diagram
TreeSave REST Resource (GA Winter '15) • Creates SObject trees with the same top level object type
• A recursive data structure that contains a root record, its data, and its child records represented as other SObject trees
• The REST resource manages all of the ID creations and mapping
• Create an Account, Contact, Opportunity, and Note in a single call
• The request can contain the following: • Up to a total of 200 records across all trees
• Up to five records of different types
• SObject trees up to five levels deep
• You can create 200 top level records, by only providing the top level
TreeSave REST Resource (cont.) • The Developer provides the record relations via a reference ID
• ReferenceId is used to link related records and to return errors
• Only Insert is supported
• Triggers, processes, and workflow rules fire separately for each of the object levels
• EX – All triggers fire for all the top level records, then all fire for the second level records, then third, etc…
• All records are rolled back on any error • Error will indicate which referenceId had the error so that the developer
can take the appropriate action
Winter ‘16 Features
ETag Support in REST • ETags allow Optimistic Concurrency Control (OCC) on your API calls
• OCC allows you to verify that you will not overwrite changes to records
• We currently support version number based ETags and time-based ETags • Version number based ETags are supported on the Account object, and Time-Based are supported
on all objects
• "ETag" and "Last Modified Time" values are returned on SOBject Rows resources
• Support for "If-Match", "If-None-Match", "If-Modified-Since", and "If-Unmodified-Since"
• For example
• User B gets information about Account Acme, Inc. • Result contains an version number based ETag and a last modified date
• User A makes changes to the record, which updates the ETag and Timestamp
• When User B updates, the update fails, as the ETag and Timestamp differ
ETag Support
Retrieving records from the sObject resource will
return a Last-Modified, and/or an ETag
Admin can update the dashboards used in the Engagement Console
Using If-Modified-Since or If-Match (for ETags), will allow the update to go
through if the record has been updated since the
date passed in.
Using If-Unmodified-Since will allow the update to go through if the record has not been updated since
the date passed in
Create Audit Fields/Update with Inactive Owners
• Create Audit Fields provides the ability to set the Audit Fields for records
• Last Modified By, Last Modified Date, Created By, Created Date
• Only available when creating records through the API
• Previously only available to enable through a support ticket • Update with Inactive Owners allows you to update records that have an
owner who has been deactivated
• By default, many records cannot be updated if the owner is inactive, because of cascading actions and sharing implications
• Two new profile permissions to control this behavior
• Admin can enable and disable as they need
Create Audit Fields/Update with Inactive Owner
Admins can now enable the Create Audit Fields Feature from
the User Interface Setup
Once enabled in the user interface, you can assign Setting the Audit Fields and Updating Records with inactive owners to user profiles and perm
sets
Once enabled in the user interface, you can assign Setting the Audit Fields and Updating Records with inactive owners to user profiles and perm
sets
Through the API you can set the Audit field when
creating records
Audit fields can be retained when migrating
data
Enterprise API - Roadmap
Looking toward the horizon
Supporting the push towards mobile
• Looking at API composition
• Support for offline
• Asynchrony
• More efficient use of limited bandwidth (caching, alternate transport)
“API First”
• Improved App Cloud support for creating and managing APIs for internal and external API developers
• Consistent APIs and integration patterns across SFDC
• Standardized interactive API documentation
• Rate Throttling and Shaping rather than Limiting
• Improve operational dashboards
Looking toward the horizon (cont.)
Bulk API Enhancements
• API completeness (retrieve job status, cancel jobs, delete jobs)
• Relationship Queries
• Bulk JSON
Higher volume APIs for Big Data and IoT (and App Cloud too!)
• Looking at our ingestion pipeline
• Different data stores (e.g. BigObjects in HBase, Wave)
• Pull vs push
Streaming API Enhancements
• Expand coverage of SObject support in Streaming Push Topics
• Support relationship streams and sub queries
• Data synchronization
What did we Learn?
What is the Enterprise API
Summer '15 Features
• Data Loader for Mac
• Batching API
• TreeSave API
Winter '16 Release
• ETag Support
• Create Audit Fields/Update with Inactive Owner
Future of Enterprise API
• Push Towards Mobile
• API First
• API Enhancements
Q&A
Share Your Feedback, and Win a GoPro!
3 Earn a GoPro prize entry for each completed survey
Tap the bell to take a survey 2Enroll in a session 1
Thank you
Appendix Batch API and TreeSave API Requests and Responses
Example Batch Request
{"batchRequests" : [
{"method" : "POST",
"url" : "v34.0/sobjects/account/",
"richInput" : {"Name" : "NewName", "Industry" : "Tech"}},
{"method" : "GET",
"url" : "v34.0/sobjects/account/describe/"},
{"method" : "GET",
"url" : "v34.0/query?q=select id, name, industry from account order by createddate desc limit 10"
}]
}
Example Successful Batch Response {"hasErrors" : false, "results" : [{ "statusCode" : 201, "result": {"id" : "001B0000003xiArIAI”, "success" : true, "errors" : [ ]} }, { "statusCode" : 200, "result": {"actionOverrides" : [ ], "activateable" : false, ..., "undeletable" : true, "updateable" : true} },{ "statusCode" : 200, "result": {"totalSize" : 10, "done" : true, "records" : [{ "attributes" : {"type" : "Account”, "url" : "/services/data/v34.0/ sobjects/Account/001B0000003xiArIAI”}, ... }] } }] }
Example Unsuccessful Batch Response {"hasErrors" : true, "results" : [{ "result" : [{"message" : "Required fields are missing: [Name]”,"errorCode" : "REQUIRED_FIELD_MISSING", "fields" : [ "Name" ]}], "statusCode" : 400 },{ "result”:[{"message”:"Cannot access this resource in a batch request”, "errorCode”: "INVALID_BATCH_REQUEST”}], "statusCode" : 400 },{ "result" : [{ "message" : "\nselect ids, name, industry from account\n^\nERROR at Row: 1:Column:8\nNo such column 'ids' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.”, "errorCode" : "INVALID_FIELD"}], "statusCode" : 400 }]}
Example TreeSave Request {"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" : "[email protected]" }, {"attributes" : {"type" : "Contact", "referenceId" : "ref3"}, "lastname" : "Evans”, "title" : "Vice President”, "email" : "[email protected]”}] }}, {"attributes" : {"type" : "Account", "referenceId" : "ref4"}, "name”: "SampleAccount2”, "phone”: "1234567890”, "website" : "www.salesforce2.com", "numberOfEmployees”: "100”, "type" : "Analyst”, "industry" : "Banking”}] }
Example Successful TreeSave Response
{ "hasErrors" : false, "results" : [ { "referenceId" : "ref1", "id" : "001B0000003xiAwIAI" }, { "referenceId" : "ref4", "id" : "001B0000003xiAxIAI" }, { "referenceId" : "ref2", "id" : "003B0000003l3L5IAI" }, { "referenceId" : "ref3", "id" : "003B0000003l3L6IAI" } ] }
Example Unsuccessful TreeSave Response
{
"hasErrors" : true,
"results" : [ {
"referenceId" : "ref4",
"errors" : [ {
"statusCode" : "REQUIRED_FIELD_MISSING",
"message" : "Required fields are missing: [Name]",
"fields" : [ "Name" ]
} ]
} ]
}