Our Blogs
What is Salesforce APIs?
Salesforce provides programmatic access to the organization’s information using simple, powerful, and secure application programming interfaces [API’s].
An API allows different components to interact. Most automation makes heavy use of these lists of commands to connect and integrate. Salesforce can also call API’s to retrieve data from other systems or services.
API Series
We have got a series of APIs and at present Salesforce support 10 API’s and each of them has its different use case. Though, they all have a similar purpose i.e. of accessing data from Force.com or Database.com, yet there are some key differences too which are worth explaining. First, it’s important to note that all these APIs operate identically across Force.com and Database.com.
- SOAP API: This API is useful to integrate Salesforce organization data with other application using SOAP.
- REST API: This is useful to access objects in your Salesforce organization using REST.
- Bulk API: It is based on REST principles and is optimized for loading or deleting large sets of data.
- Metadata API: Helps to retrieve, deploy, create, update, or delete customizations for the org. It is used to migrate changes from a sandbox or testing org to the production environment.
- Tooling API: It is used to build custom development tools or apps for Salesforce Platform applications.
- Streaming API: It is useful for applications that require general notification of data changes in an organization.
- Apex REST API: This API is useful to build your own REST API in APEX.
- Apex SOAP API: This API is useful to create custom SOAP web service. This API exposes Apex Classes as SOAP web service.
- Chatter REST API: These APIs are used for Chatter feeds, users, groups, and followers, Chatter REST API provides programmatic access to files, recommendations, topics, notifications, Data.com purchasing, and more.
- com API: It provides 100% complete, high quality data, updated in real-time in the cloud, and with comprehensive coverage worldwide.
- REST API Callouts
- REST callouts are based on HTTP. Callout request is associated with an HTTP method and an endpoint. And, this HTTP method indicates what type of action is desired.
Fig 2.1
- GET request (GET is an HTTP method) is the simplest request. As, GET request is similar to navigating to an address in the browser. At the time, when you visit a web page, the browser performs a GET request behind the scenes.
Salesforce Integration from one org to another using REST API Callouts
For implementing this integration from Source org to Target org, we need to perform some activities in Target Org and Source Org.
Step 1: We need to perform below activities in Target org.
- Create a Connected App.
Connected App: For an external application that needs to authenticate with Salesforce, we need to create a connected app so as to inform Salesforce about the new authentication entry point. Connected app uses standard OAuth 2.0 protocol to authenticate.
Fig 2.2
- Create Rest Web Serviceto fetch data based on the requirement of SOURCE org and send it back to SOURCE org.
Fig 2.3
Step 2: And, for the Source org below pointers needs to be followed.
- Create an apex controller.
Fig 2.4
- Create a Visualforce page.
Fig 2.5
- Create a remote site setting for the URL of Target Org.
Fig 2.6
In this way, you will be able to get the list of Accounts of Target org into Source org.
Benefits of Salesforce Integration using REST API Callouts
- Salesforce Rest API is easy to work with, has simple integration, as well as simple HTTP requests.
- It has shown remarkable success in the enterprise customer level and cannot be countered.
- It is a perfect technology choice that can be used with mobile applications and Web 2.0 projects.
- Rest API has lightweight requests and responsive framework.
- The API pushes and pulls the information between Salesforce and the desired destination. Data entry is time-consuming and repetitive. If the reps are spending valuable time in data typing instead of helping the customers, anything we can do to give them that time back is helpful.
Conclusion
Now, we understand how Salesforce API Integration works, as well as how it is relatively easy to set up if we know what we are doing. Salesforce APIs can work alongside most of the other apps we use on a regular basis. They can bring several different benefits, the biggest of them, giving time back to the sales reps so they can serve their customers.
About Girikon