====== Google Maps API Key for CareFree ====== Google have made changes to the interface (called an API) which allows products like CareFree to query distance and travel information and to display maps. They have also changed the terms and conditions for using these services and have made it mandatory to enter payment details should customer wish to continue using their services. (They have stated that they expect the service to remain free for the vast majority of users, but they have said that everyone must create a payment account in case free usage limits are exceeded.) In order to continue using Google Maps for mileage calculations you must create an API with a linked payment account and then use our temporary mileage calculation app until we can upgrade your CareFree database. ===== Creating an API Key ===== An API Key must be created for CareFree to make any mileage requests. Once the API Key has been created this must then be entered in your CareFree system. The next 2 sections of this guide will explain how to do this. 1. Go to the link [[https://cloud.google.com/maps-platform/?apis=maps,routes,places|https://cloud.google.com/maps-platform/?apis=maps,routes,places]] {{ :wiki:google_maps_start.png?600 |}} 2. Click **Sign In** in the top right {{ :wiki:google_developer_sign_in.png?400 |}} 4. Log into your Google account\\ If you have forgotten your email/password click Create Account to create a new Gmail account 5. Once you have signed into Google you will be redirected back to the first screen now stating that you are now signed in 6. Click **Get Started** {{ :wiki:google_get_started.png |}} 7. You will then be asked to agree to the Google Cloud Platform Terms of Service. Tick to agree and press **Continue**. {{ :wiki:google_terms_of_service.png?400 |}} 8. Confirm your Indentity Verification and Contact Information. Press **Continue** to accept. 9. The next page will ask you to add payment information for a billing account. Click **Start my Free Trial** when complete {{ :wiki:2018-10-16_11h49_57.png |}}\\ **Please note: Billing information must be entered to allow mileage requests using the API key. You will only be charged if you go over the amount of requests included with your Google API Key (you are given 40,000 requests a month).\\ \\ Remember that once CareFree has queried a journey once, the distance and travel time are stored within the database so queries are only sent to google for new journeys on the rota. For example when new clients are added into the system.** 10. Confirm details about your business to enable the maps platform. Press **Submit** to continue. {{ :wiki:google_enable_platform.png?400 |}} 11. The next page will display your API key. Make a note of this or click the copy icon. Click **Maybe Later** at the bottom of the screen. {{ :wiki:google_api_key.png?400 |}} 12. Now you have the API key, you will need to double check that the required API elements are switched on. Click **APIs** from the left menu. {{ :wiki:google_developer_menu.png |}} 13. Check that the four required APIs are enabled from the list. These are Directions API, Distance Matrix API, Geocoding API and Maps Javascipt API. {{ :wiki:google_api_list.png |}} If these are present, proceed to the [[google_maps_api_key_for_carefree#entering_the_api_key_into_carefree|next section]]. 14. If the required APIs are not enabled, click the hamburger, menu or three lines button at the top left and navigate to **APIs & Services** then to **Library** {{ :wiki:google_api_library_menu.png?400 |}} 15. In the API library click **View All** on the maps category {{ :wiki:google_api_library.png?400 |}} 16. Click on the required API {{ :wiki:google_api_library_maps.png?400 |}} 17. Click **Enable** on the API listing {{ :wiki:google_api_enable.png?400 |}} ===== Entering the API Key into CareFree ===== This section of the guide will explain how to enter your API Key into CareFree. 1. Open CareFree and log in as an administrator 2. Go to **Tools**, click **Options and Settings** then click **Shared Options** {{ :wiki:shared_options.png |}} 3. Click into the **Mileage** category on the left 4. Paste the API Key in the field named **GoogleMaps API Key** {{ :wiki:2018-10-16_12h24_41.png |}} 5. Click **OK** to save this setting