What are 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, as shown in Fig. 1.1.

<p><strong><em><u>What are Salesforce APIs?</u></em></strong></p> <p>Salesforce provides programmatic access to the organization’s information using simple, powerful, and secure application programming interfaces [API's].</p> <p>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, as shown in Fig. 1.1. <p><strong><em><u>API Series</u></em></strong></p> <p>We have got a series of APIs, and at present salesforce supports 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.</p> <p><strong>                                       Fig 1.2 </strong>API Series</p> <ul> <li><strong>SOAP API:</strong>It is useful to integrate the Salesforce org data with other application using SOAP.</li> <li><strong>REST API:</strong>REST API is useful to access objects in the Salesforce organization using REST.</li> <li><strong>Bulk API:</strong>It is based on REST principles and is optimized for loading or deleting large sets of data.</li> <li><strong>Metadata API:</strong>Helps to retrieve, deploy, create, update, or delete customizations for the org. Commonly it is usedto migrate changes from a sandbox or testing org to the production environment.</li> <li><strong>Tooling API:</strong>Use to build custom development tools or apps for Salesforce Platform applications.</li> <li><strong>Streaming API:</strong>It is useful for applications that require general notification of data changes in an organization.</li> </ul> <p><strong> </strong></p> <ul> <li><strong>Apex REST API:</strong>It is useful to build your own REST API in APEX.</li> </ul> <p> </p> <ul> <li><strong>Apex SOAP API:</strong>This API is useful to create custom SOAP web service and exposes Apex Classes as SOAP web service.</li> </ul> <p> </p> <ul> <li><strong>Chatter REST API:</strong>These API’s are used for Chatter feeds, users, groups, and followers.It provides programmatic access to files, recommendations, topics, notifications, Data.com purchasing, etc.</li> <li><strong>com API:</strong>It provides 100% complete, high quality data, updated in real-time in the cloud, and with comprehensive coverage worldwide.</li> <li><strong>REST API Callouts</strong></li> </ul> <p>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.</p> <p><strong>                                                    Fig 2.1</strong></p> <ul> <li>GET request (GET is an HTTP method) is the simplest request. As, GET request is similarto 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.</li> </ul> <p> </p> <p><strong><em><u>Salesforce Integration from one org to another using REST API Callouts</u></em></strong></p> <p>For implementing this integration from Source org to Target org, we need to perform some activities in Target Org and Source Org.</p> <p><strong>Step 1:</strong> We need to perform below activities in Target org.</p> <ul> <li><strong>Create a Connected App</strong></li> </ul> <p>In order to authenticate an external application with Salesforce, we need to create a connected app to inform Salesforce about the new authentication entry point. Connected app uses standard OAuth 2.0 protocol to authenticate.</p> <p><strong>                                             Fig 2.2</strong></p> <ul> <li><strong>Create Rest Web Service</strong>to fetch data based on the requirement of SOURCE org and send it back to SOURCE org.</li> </ul> <p><strong>                                          Fig 2.3</strong></p> <p><strong>Step 2:</strong>And, for the Source org below pointersneeds to be done.</p> <ul> <li>Create an apex controller.</li> </ul> <p><strong>                                              Fig 2.4</strong></p> <ul> <li>Create a Visualforce page.</li> </ul> <p><strong>                                             Fig 2.5</strong></p> <ul> <li>Create a remote site setting for the URL of Target Org.</li> </ul> <p><strong>                                                  Fig 2.6</strong></p> <p>In this way, you will be able to get the list of Accounts of Target org into Source org.</p> <p> </p> <p><strong><em><u>Benefits of Salesforce Integration using REST API Callouts</u></em></strong></p> <ul> <li>Salesforce Rest API is easy to work with andhas simple integration and HTTP requests.</li> <li>It has shown remarkable success in the enterprise customer level which cannot be countered.</li> <li>It is a perfect choice of technology that can be used with mobile applications and Web 2.0 projects.</li> <li>It has lightweight requests and responsive framework.</li> <li>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.</li> </ul> <p><strong><em><u>Conclusion</u></em></strong></p> <p>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 differentbenefits; the biggest of them is leaving sales reps with sufficient time so that they can serve their customers in a better way.</p> <p><span style="text-decoration: underline;"><em><strong>About Girikon</strong></em></span></p> <div>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 <a href="https://www.girikon.com/salesforce-support/"><span style="color: #000080;">Salesforce support</span></a> services to help your business achieve sustainable growth.</div>

                                               Fig 1.1

 

API Series

We have got a series of APIs, and at present salesforce supports 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.

Salesforce Integration Using Rest API Callouts

                                        Fig 1.2 API Series

 

  • SOAP API:It is useful to integrate the Salesforce org data with other application using SOAP.
  • REST API:REST API is useful to access objects in the 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. Commonly it is used to migrate changes from a sandbox or testing org to the production environment.
  • Tooling API:Use 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:It is useful to build your own REST API in APEX.
  • Apex SOAP API:This API is useful to create custom SOAP web service and exposes Apex Classes as SOAP web service.
  • Chatter REST API:These API’s are used for Chatter feeds, users, groups, and followers.It provides programmatic access to files, recommendations, topics, notifications, Data.com purchasing, etc.
  • 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 Using Rest API Callouts

                                                    Fig 2.1

  • GET request (GET is an HTTP method) is the simplest request. As, GET request is similarto 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

In order to authenticate an external application with Salesforce, we need to create a connected app 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 Service to 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 pointersneeds to be done.

  • Create an apex controller.

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 and has simple integration and HTTP requests.
  • It has shown remarkable success in the enterprise customer level which cannot be countered.
  • It is a perfect choice of technology that can be used with mobile applications and Web 2.0 projects.
  • It 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 differentbenefits; the biggest of them is leaving sales reps with sufficient time so that they can serve their customers in a better way.

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: