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.

Salesforce Integration Using Rest API Callouts

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.

  1. SOAP API: This API is useful to integrate Salesforce organization data with other application using SOAP.
  2. REST API: This is useful to access objects in your Salesforce organization using REST.
  3. Bulk API: It is based on REST principles and is optimized for loading or deleting large sets of data.
  4. 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.
  5. Tooling API: It is used to build custom development tools or apps for Salesforce Platform applications.
  6. Streaming API: It is useful for applications that require general notification of data changes in an organization.
  7. Apex REST API: This API is useful to build your own REST API in APEX.
  8. Apex SOAP API: This API is useful to create custom SOAP web service. This API exposes Apex Classes as SOAP web service.
  9. 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.
  10. 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.                        

salesforce integration

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.

Salesforce Integration Using Rest API Callouts

                                                        Fig 2.2

  • Create Rest Web Serviceto fetch data based on the requirement of SOURCE org and send it back to SOURCE org.

Salesforce Integration Using Rest API Callouts

                                               Fig 2.3

Step 2: And, for the Source org below pointers needs to be followed.

  • Create an apex controller.

Salesforce Integration Using Rest API Callouts Salesforce Integration Using Rest API Callouts

                                                          Fig 2.4

  • Create a Visualforce page.

Salesforce Integration Using Rest API Callouts

                                               Fig 2.5

  • Create a remote site setting for the URL of Target Org.

Salesforce Integration Using Rest API Callouts

                                                     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

Girikon is an IT service company, headquartered in Phoenix, Arizona with development centres in Noida and Bangalore, India. We provide cutting-edge Salesforce consulting, Salesforce implementation and Salesforce support services to help your business achieve sustainable growth.
About Author
Aayushi Bhatnagar
Aayushi is PD1 certified Salesforce Developer with profound knowledge in Apex Development, Salesforce Admin, CPQ, Integration and Lightning Component. She is an ardent reader and spends her leisure time exploring new technologies.
Share this post on: