How to connect with Google Service credentials? - SoftFx/AlgoBots GitHub Wiki

How to login and setup Google Cloud console?

100YearPortfolioBot uses Google Sheets to work. The file stores the settings of the bot and the bot’s status is displayed there.

To launch the bot you need:

  1. Log in to your Google account;
  2. Open the bot file with the default configuration;
  3. Make a copy of the bot file: File -> Make a copy;

Make a Copy

Make a Copy 2

  1. Configure access to the bot file: File -> Share -> Share with others;

Share with others

  1. In the “General access”, select Anyone with the link and the Viewer role;

Manage Access

How to enable Google Sheets API?

  1. Open the Google Cloud console (Google account must be logged in);
  2. Click Select a project -> NEW PROJECT;

NewProjectButton

  1. Fill in the Project name field and click CREATE. New project

  2. Select the created project;

SelectNewProject

  1. In the Navigation menu, select APIs & Services -> Enabled APIs & Services;

EnableApiNavigation

  1. Click ENABLE APIS AND SERVICES;

EnableApiMenu

  1. In the opened API library, select Google Sheets API;

API store

  1. Click ENABLE.

GoogleSheetsAPI

How to create Google Service account?

  1. Select Credentials -> CREATE CREDENTIALS;

CreateCredentialMenu

  1. Select Service account from the list;

CreateServiceAccount

  1. Fill in the required fields in the “Service account details” and click CREATE AND CONTINUE. *The fields in “Grant this service account access to project” and “Grant users access to this service account” are optional;

CreateAccountDialog

  1. Click DONE.

CreateAccountDialog2

How to generate a Service credentials file?

  1. Add a key for the generated service account by opening the created e-mail;

NewAccountTable

  1. Go to the KEYS tab and in “ADD KEY” select Create new key;

AddKeyMenu

  1. Select the JSON key type and click CREATE;

NewCredFile

  1. The private key will be generated and downloaded automatically;

SaveKeyFile

How to setup Google Sheet with Service credentials?

  1. Copy the created e-mail to register it in the configuration file;

CopyServiceEmail

  1. Go to the document with the bot settings, open the Share window (Share button in the upper right corner or File -> Share-> Share with others). Insert the e-mail, select the Editor rights and click Share.

AddServiceSheet

How to connect Service credentials to Algo bot?

  1. Copy the link to the document with the configuration;

CopySheetLink

  1. Paste the copied link into the SheetLink field in the New Bot Instance window. *The CredsFile parameter is not required for launching the bot, in this case the status will not be written in the configuration file;

SetupWindowLink

  1. In the CredsFile field, select the previously automatically downloaded credentials file;

SetCredFile

  1. Launch the bot.