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:
- Log in to your Google account;
- Open the bot file with the default configuration;
- Make a copy of the bot file: File -> Make a copy;
- Configure access to the bot file: File -> Share -> Share with others;
- In the “General access”, select Anyone with the link and the Viewer role;
How to enable Google Sheets API?
- Open the Google Cloud console (Google account must be logged in);
- Click Select a project -> NEW PROJECT;
-
Fill in the Project name field and click CREATE.
-
Select the created project;
- In the Navigation menu, select APIs & Services -> Enabled APIs & Services;
- Click ENABLE APIS AND SERVICES;
- In the opened API library, select Google Sheets API;
- Click ENABLE.
How to create Google Service account?
- Select Credentials -> CREATE CREDENTIALS;
- Select Service account from the list;
- 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;
- Click DONE.
How to generate a Service credentials file?
- Add a key for the generated service account by opening the created e-mail;
- Go to the KEYS tab and in “ADD KEY” select Create new key;
- Select the JSON key type and click CREATE;
- The private key will be generated and downloaded automatically;
How to setup Google Sheet with Service credentials?
- Copy the created e-mail to register it in the configuration file;
- 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.
How to connect Service credentials to Algo bot?
- Copy the link to the document with the configuration;
- 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;
- In the CredsFile field, select the previously automatically downloaded credentials file;
- Launch the bot.