Salesforce Integration with Google Maps

Updated: Jan 17, 2020

To commence with, Integration is calling an external service into our application. Most enterprise-level applications have a need to integrate with other applications used by the same organization. These integration usually cater to different layers, like Data, Business Logic, Presentation and Security, depending on the requirement. This helps organizations achieve greater levels of operational consistency, efficiency and quality.


When we implement anything in Salesforce, we frequently need to integrate it with other applications. In this article we will integrate salesforce with google maps. For this we will use apex callout to tightly integrate with an external service. When we say callout that simply means sending an request to a service and receiving a response. Mainly callouts work in two ways:


1. Web service callouts using SOAP

2. HTTP callouts using REST


We will be doing integration by using HTTP callouts with REST as it is easier to use, requires much less code and it utilize JSON which is easily readable. First thing is, whenever we are making a callout to extenal web service it should be authorized. If it is not, then you will never be able to access that service. Before start anything we will add our approved sites in the remote settings sites page.


We are making calls to following site:

> https://maps.googleapis.com/maps


Authorize above endpoint URLs by following these steps :


1. From Setup, enter Remote Site Settings in the Quick Find box, then click Remote Site Settings.

2. Click New Remote Site.For the remote site name and URL.

3. Click Save.


Before making callout to google