8. SOAP REST
APIs API
CRUD operations X X
Management functions X
Secure sessions X X
XML input/output X X
JSON input/output X
Service definition file X
Binary data access X
9. The Bulk API is a
good fit for bulk data
transfer.
13. Write custom Apex code to consume
synchronous or asynchronous services.
14. Outbound Messaging is great for
sending messages out of
Salesforce.com to external systems.
15. Many tools now integrate with the
Force.com API to make integration easier.
16. Look for the best integration
technique for your solution.
Thank you!
Richard Seroter | seroter.wordpress.com | @rseroter |
Editor's Notes
ProblemCloud infrastructure has never been easier to provision and SaaS makes it easy to quickly build applications
Satisfaction with cloud integration is poorApp integrationData integrationNetwork integrationIdentity integrationUI integrationCannot be an afterthought after a solution goes live
Can create complex systems consisting of data, application and services that span data centers, organizations and geographies
Inbound APIs – SOAP, REST, Batch
SOAP – what is it, when to use it, how to use it (demo)What is itWay to programmatically create, read, update, and delete records using strongly typed contract. Manage users, perform searches, and more.Works with standard and custom objects, standard and custom fieldsCan create entirely custom servicesSynchronous operations, committed automaticallyRespects security settings (object-level, field-level, sharing)When to use itReal-time integration with small chunks of information (messages)Interact with data stored in Salesforce.comConnect on-premises systems (LOB, portals, etc)Build custom services when have unique or composite logic or want to be less chattyHow to use itChoose a WSDL (Enterprise, Partner, or custom)Enterprise for tighter integration with SFDC objectsPartner is for loose typing and targeting multiple orgsGet the WSDLConsume WSDL and generate proxy objectsAuthenticateLog in and get session token good for 60 minutes (from last call)Call!Handle the many faults that can be returned (login, invalid object, invalid field, etc), different exception codes
REST – what is it, when to use it, how to use it (demo)What is itLightweight way to interact with Salesforce.com programmatically through HTTPAccess resources via URI and HTTP verbsHEAD (metadata), GET, POST (new), PATCH (update), DELETEXML and JSON supportOauth for securityWhen to use itEncourages caching, want uniform interface, named resources, multiple data formatsMobile applications, modern apps that don’t easily consume SOAPHow to use itDefine remote access endpointBuild up XML/JSON requestCraft URLGet session tokenCall service
Comparing SOAP vs REST(capabilities, encoding, extensibility, authentication)
Bulk – what is it, when to use it, how to use itWhat is itAPI for loading or deleting large data sets (GET and POST)Query, insert, delete, modifyWorks with binary attachmentsAsynchronously processed on SFDC serversSubmit CSV or XML blocksWhen to use itUsing Data Loader tool to do data migrationLarge data input processesHow to use itAuthenticateCreate “job” record and get back job IDSend batches to server via HTTP POST, processed in parallelSend XML or CSV along with references to binary attachmentsWhen using attachments, send zip with file pointing to attachments, and the attachment themselvesClose the jobCheck status of batch (via API or Console)
Streaming API – what is it, when to use it, how to use it (DEMO)What is itReceive notifications of changes that match SOQL queryReceiving app can be in Salesforce our outsideUses long polling (not WebSockets)When to use itInstead of heavy-polling apps, or for client apps that want to connect instead of pushing to internet-facing endpointDon’t need reliable delivery or guaranteed delivery, don’t need audit trail out of Salesforce, don’t need to get missed records when offlineOne entity per query, no joins, no aggregate queriesHow to use itCreate PushTopicCreate client app that authenticates and then subscribes to topicChoose events (all, create, update), notifications (all, referenced, select, where)
Custom Apex – what is it, when to use it, how to use it (DEMO)What is itWrite code to consume external servicesWhen to use itHave need to control invocation of services synchronously or asynchronous (@future)Mashup interfacesHow to use itAdd controller, add scheduled class, trigger
Outbound Messaging – what is it, when to use it, how to use it (DEMO)What is itWay to specify that changes to SFDC records trigger an asynchronous SOAP call to an external endpointPart of workflow rule (like field updates, send email, create task)When to use itReal-time outbound communication (at least once delivery) with internet-facing endpointWant to stop polling for changes and desire a more event-driven architectureNeed durable outbound communication (vs. triggering async via code)Up to 24 hours in retry queueHow to use itCreate workflow ruleDefine outbound messageGet WSDL and create service that conformsExpect batchesConsider callbacks using session, especially given idempotent needs