====== Setting up Google services ====== **This page is written for Vizy software version 0.1.102 or greater. The older documentation can be found [[wiki:google_cloud_setup|here]].** Vizy uses several Google services such as Google Photos, Google Sheets, and Gmail to communicate to the outside world and share its findings. The main advantage of these is that they are all free and robust services that many of us are familiar with. ===== Creating a Google account ===== It's strongly recommended that you create a new Google account exclusively for your Vizy camera instead of using a personal Google account. If you have multiple Vizys, they can easily share a single Google account. Using a separate account for your Vizy(s) will prevent any thorny security issues if the credentials are compromised for some reason (theft, loss of Vizy, etc.) Particularly, you should keep all personal information (passwords, credit card numbers, etc.) free and clear of this account. You can create a new Google account [[https://accounts.google.com/SignUp|here]]. You will use the Gmail address of this account in the next sections. ===== Creating an API key ===== The Google cloud services (Photos, Gmail, Drive, Sheets, etc.) require an API key. This is a key that identifies the application that's making the API requests. You need to create your own key because there are restrictions that make it impractical for us to provide one for you. Fortunately, creating your own API key isn't too difficult. It only takes a few minutes, and once you've created the key, you can use it with multiple Vizys. Start by going to the [[target=_blank^https://console.cloud.google.com/projectcreate|Google Console key creation page]]. If you're not logged into a Google account, it will ask you to log in. **Use the account that you just created for Vizy. If it doesn't ask you to log in, make sure that you're logged in the account that you just created for Vizy. If you're logged in under a different Google account, log out and log in with the Google account that you created.** Next, follow along with the video below, pause as necessary. It's a bit of a process... :-) {{wiki:gcloud.mp4|1024x576}} After following along with the video, you should now have a JSON file with your API key. It's name will look something like ''client_secret_.apps.googleusercontent.com.json''. Bring up the Google Cloud from the ☰ menu in the top right corner of Vizy's browser tab: {{wiki:image_1009.jpg}} And either drag and drop the JSON file into the dotted-line area, or click to choose the file from your file system. {{wiki:image_1008.jpg}} ===== Authorizing ===== If Vizy likes the looks of your API key, you should be presented with the dialog: {{wiki:image_1011.jpg}} Click on **Authorize**. This will create a new browser tab, so if you have popups disabled, you may need to provide Vizy permission to bring up the new tab. Within the new browser tab, you will be asked which account you want to use -- **choose the Google account that you created for your Vizy**. It will likely require that you type in the username and password. If you added Vizy's Google account as a "Test User" you should get the message below, which is a good/expected: {{wiki:image_1012.jpg}} Click on **Continue** Next, give Vizy access permissions to whatever it's asking for (check all boxes): {{wiki:image_1015.jpg}} Click on **Continue**. {{wiki:image_1016.jpg}} Copy the code as shown above and paste into the text box in Vizy's browser tab: {{wiki:image_1017.jpg}} Click on **Submit**. If everything has proceeded without a hitch, you can now test your Google API key and authorization by clicking on **Upload test image** or **Send test email...**. Note, photos/images will appear in [[https://photos.google.com|Google Photos]] page of the Google account that you created. And emails will originate from the same Google account. (It's almost as if Vizy were alive, yes?) {{wiki:image_1019.jpg}} If the tests are successful, your Vizy now has access to its very own Google account -- nice work! You can remove Vizy's access at any time by clicking on the **Remove authorization** button in the **Google Cloud** dialog. And you can remove the API key by clicking on **Remove API key**. (So Vizy had better behave...)