Google API services
Learn how to setup Google APIs in your google account and how to connect it to the system.
Why do I need to connect Google APIs ?
This services are use to: calculate distance between locations, geocode locations, get address suggestions and display a map, thus allowing to calculate the journey price and display journey information during a Web Booking process.
Google account setup
1. Setup account
Register or use your existing Google developer account.
2. Create project
In the account, navigate to APIs & Services -> Credentials and create New project (we recommend using your company name).
3. Enable API Services
Navigate to APIs & Services -> Library and using search option, one by one find and enable services listed below.
- Directions API
- Places API
- Geocoding API
- Maps JavaScript API
- Maps Embed API
a). Navigate to Create credentials -> choose option API key -> click RESTRICT KEY
b). In API name field enter Browser key
c). In section Application restrictions -> select HTTP referrers (websites), then a new option appear Website restrictions
d). In section Website restrictions click ADD AN ITEM ,then in New Item enter two addresses http://example.com/* and https://example.com/* which can be found in Software -> Settings -> Google tab, just hover over or click title Google API Key restrictions configuration. Each URL should be entered in a new row.
f). In section API restrictions click Restrict Key and from drop-down menu select:
– Maps JavaScript API
– Maps Embed API
– Directions API
– Places API
– Geocoding API
g). Copy API keys (available top-right side)
h). Save changes.
j). Now go back to Software -> Settings -> Google -> Google API Key restrictions configuration and paste the API key into fields Maps JavaScript API key and Maps Embed API key.
Click below image to see it in full format.
5. Setup Server key
a). Navigate to Create credentials -> choose option API key -> click RESTRICT KEY
b). In API name field enter Server key
c). In section Application restrictions -> select IP addresses (web servers, cron jobs, etc.), a new option appear Accept requests from these server IP addresses
d). In section Accept requests from these server IP addresses click ADD AN ITEM , in New Item enter Server IP which can be found in Software -> Settings -> Google tab -> click title Google API Key restrictions configuration and copy Server Key.
In software version 3.10.2 and below this Server IP is not display but domain or sub-domain IP address can be founded here. Enter the name in the box and click “Lookup” button.
f). In section API restrictions click Restrict Key and from drop-down menu select
– Directions API
– Places API
– Geocoding API
g). Copy API keys (available at top right hand corner)
h). Save changes.
j). Now go back to Software -> Settings -> Google -> Google API Key restrictions configuration and past the API key into fields Directions API, Places API and Geocoding API.
Click below image to see it in full format.
Note: In case you have any problems please disable API key restriction to see if system works without it. If it does then it means the restriction hasn’t been set correctly.
6. Setup Billing
You have to enable billing profile for your project in Billing -> Overview tab otherwise Google will apply daily limits and the API you have created won’t work. Please see the last screenshot below for more details.
Note: You can read more about limits and charges here.
7. Setup a budget
Avoid surprises on your bill by creating budgets to monitor all your Google Cloud Platform charges in one place. Also stay informed of your expenses by setting up budget alert rules to trigger notifications. Read more about how to set a budget here.
Note: This service is provided by a third party company. We don’t take any responsibility for any changes in how this service operates or works. Any issue with this service you need to discuss directly to company which provide it.
FAQs
Error message appears: "You must use an API key to authenticate each request to Google Maps Platform APIs"
This means that the APIs has not been completed. Go one by one point carefully to check what is missing. We are confident when all settings are setup correctly the system will work.
Error message appears: "This page can't load Google Maps correctly"
Please make sure that Google billing profile is enabled in your Google account and the Browser Key restrictions are setup correctly as per above guide. Once this is done, please try again.
Error message appears: "This IP, site or mobile application is not authorized to use this API key. Request received from IP address X.X.X.X, with empty referer"
This might happen when Google API Server Key restrictions are enabled, but the IP address (X.X.X.X) displayed in the error message is not added to allowed IP addresses list. Sometimes your server might be using few IP addresses to connect to Google API service in the background therefore you will need to list all of these IPs in your Google account. To add missing IPs please go to your Google API Console and edit Server Key and then in “Application restrictions -> IP addresses (web servers, cron jobs, etc.) -> Accept requests from these server IP addresses” section add the IP address displayed in error message (X.X.X.X). See attached screenshot below more details.