Examples

You can find some example webhook implementations below.

Latitude and Longitude from Google Maps

With the Google Maps Geocoding API, you can pass the address of a lead and receive back the latitude and longitude of that address in a JSON response.

Note: Be careful when implementing this, as the free tier of the Geocoding API has a limit of 2500 API calls per day, which could easily be exceeded if you’re not careful.

Here’s the basic configuration of our Webhook:

GeoCode

Our full URL looks like this:

https://maps.googleapis.com/maps/api/geocode/json?address={{lead.Address:default=edit me}}&key=<your API Key>

For our response mappings, we’ve created two custom fields, “Address Latitude” and “Address Longitude.” To pull these values from the response, our mappings look like this:

Mappings

For reference, the Geocoding API produces a response formatted like this:

We’re trying to retrieve the highlighted pair of values, so to get the mapping, we need to enter the results array, get the first entry, enter the geometry object, then the location, and get the lat and lng properties. This gives us results[0].geometry.location.{property}