API Integrations Cheat Sheet
SALESFORCE.COM How to
think like a
Sales Rep for
an API
About integration.
Salesforce is the CRM market leader helping organizations collect and
Analyze customer data. When your application is either generating or
Accessing customer data, it’s vital that you build an integration to
connect your app to Salesforce CRM.
This integration is especially valuable if you're looking to access
customers / accounts, contacts / leads, opportunity, sales revenue data
back in your app.
AUDIENCE
This guide is for App Developers building integrations to your product and
CRM System Administrators who are setting up new users from another
application.
Salesforce has two APIs = REST & SOAP - supporting JSON across all endpoints.
LEARN
ABOUT THE
There are very few limitations when working with Salesforce. It has a very robust query
language (SOQL). It is also consistent in its naming conventions (upper camel case with
ENDPOINT all resources and fields).
Although they are building out REST capabilities, the SOAP APIs has more complete functionality.
www.salesforce.com/us/developer/docs/api/ and www.salesforce.com/us/developer/docs/api_rest/
Sign up
GET IN THERE.
Get a trial account for a developer sandbox. You can sign up for a free, 30-day trial
of the developer environment here:
TRY IT OUT.
developer.salesforce.com/signup
Salesforce has two different mechanisms: OAuth2, and session based
AUTHENTICATE
DETERMINE MECHANISMS
authentication. OAuth 2 is becoming standard, and is great when individual
users are connecting into Salesforce. Session based authentication is used when
you’re looking to authenticate an administrator account into your application.
www.salesforce.com/us/developer/docs/api_rest/Content/quickstart_oauth.htm
Here is a high-level view of typical OAuth 2 workflow:
cloud-elements.com/using-oauth-cloud-elements-platform/
Salesforce has a method to discover all of the data objects in an instance. You can also discover all of
DISCOVER the fields that belong to a given object, as well as their data types and the access permissions on that
field (readable, writable).
& SELECT Salesforce will often be the master for customer data in many companies, which can lead to 100+ data
objects. The most popular are Account, Opportunity, Lead and Contact.
Data about percent that use custom fields and objects. See reverse side for handling.
SALESFORCE API Cheat Sheet
response time gotch-ya’s key learning bulk uploads
Salesforce uses batch
Planned maintenance When querying SFDC If you have more than two
uploads to help with
nearly every weekend, using SOQL, you cannot custom fields in your large payload efforts.
but besides that, great put single quotes around object, then you are
up-time. any date/time fields. limited to a max page API Usage Limits:
size of 200. http://help.salesforce.com/HTViewHelp
Doc?id=integrate_api_rate_limiting.htm
Salesforce supports custom objects and custom fields.
Custom All CRUD operations are supported with custom objects, as well as search.
data Based on the Salesforce edition you have, there are some constraints to number of
custom objects and fields that an instance can have. Learn more here:
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008jylIAA
Salesforce search capability is extremely robust. Using the Salesforce query language
SEARCH (SOQL) you can run almost full SQL queries on any object in your system.
& Query It even gives the ability to 'explain' the SOQL query you're using so you can see what
it's doing in Salesforce and why it's, potentially, performing slowly.
Below are some example queries, exercising many of SOQL's features:
- Select Id, Name from Opportunity where
- LastModifiedDate < 2014-04-05 and Status='Open'
- Select count(Email) from Contact where CreatedDate > 2014-04-01
- CreatedDate < 2014-05-01 limit 100 offset 0
Overall, the API performs fairly well. It's not the fastest API out there,
performance but some of this is because many times you're working with large objects,
so that can slow things down somewhat in your application.
events Salesforce support event synchronization using custom Apex triggers. You can
have any event that occurs in your Salesforce instance trigger an external HTTP
SYNCHRONIZATION call. You can also add triggers to send emails when a certain event occurs in
Salesforce.
Webhook API Makes a HTTP POST Request:
developer.salesforce.com/forums/ForumsMain?id=906F00000009AtaIAE