# Self Hosted

Some of Ecosuite's services require a Google integration to hook into your own Google cloud infrastructure.

What you'll need is to provide a functioning [service account](https://cloud.google.com/iam/docs/service-account-overview). You will then go into your organization preferences and update the Google integration section with your service account **private key** (an RSA private key), as well as the generated service account **client email**.

1. Follow the [provided Google Cloud documentation ](https://cloud.google.com/iam/docs/service-accounts-create)to create your service account.

The gist of it is:

* Click `IAM & Admin`
* On the left pane, click `Service Accounts`
* Click `Create service account`
* Create the account and you'll get an email for that service account (e.g `xyz-abcd@username.iam.gserviceaccount.com`)
* Click on the email from the menu, then head to the `KEYS` tab, create a new key: `ADD KEY --> Create new key` (choose JSON).

{% hint style="info" %}
The private key should look something like this:

```
-----BEGIN RSA PRIVATE KEY-----
MIIBOgIBAAJBAKj34GkxFhD90vcNLYLInFEX6Ppy1tPf9Cnzj4p4WGeKLs1Pt8Qu
KUpRKfFLfRYC9AIKjbJTWit+CqvjWYzvQwECAwEAAQJAIJLixBy2qpFoS4DSmoEm
o3qGy0t6z09AIJtH+5OeRV1be+N4cDYJKffGzDa88vQENZiRm0GRq6a+HPGQMd2k
TQIhAKMSvzIBnni7ot/OSie2TmJLY4SwTQAevXysE2RbFDYdAiEBCUEaRQnMnbp7
9mxDXDf6AU0cN/RPBjb9qSHDcWZHGzUCIG2Es59z8ugGrDY+pxLQnwfotadxd+Uy
v/Ow5T0q5gIJAiEAyS4RaI9YG8EWx/2w0T67ZUVAw8eOMB6BIUg0Xcu+3okCIBOs
/5OiPgoTdSy7bcF9IGpSE8ZgGKzgYQVZeN97YE00
-----END RSA PRIVATE KEY-----

You will want to make sure that you use the newline escape where there are
newlines. For example:

-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJBAKj34GkxFhD90vcNLYLInFEX6Ppy1tPf9Cnzj4p4WGeKLs1Pt8Qu\nKUpRKfFLfRYC9AIKjbJTWit+CqvjWYzvQwECAwEAAQJAIJLixBy2qpFoS4DSmoEm\no3qGy0t6z09AIJtH+5OeRV1be+N4cDYJKffGzDa88vQENZiRm0GRq6a+HPGQMd2k\nTQIhAKMSvzIBnni7ot/OSie2TmJLY4SwTQAevXysE2RbFDYdAiEBCUEaRQnMnbp7\n9mxDXDf6AU0cN/RPBjb9qSHDcWZHGzUCIG2Es59z8ugGrDY+pxLQnwfotadxd+Uy\nv/Ow5T0q5gIJAiEAyS4RaI9YG8EWx/2w0T67ZUVAw8eOMB6BIUg0Xcu+3okCIBOs\n/5OiPgoTdSy7bcF9IGpSE8ZgGKzgYQVZeN97YE00\n-----END RSA PRIVATE KEY-----
```

{% endhint %}

* Go to `APIs and Services` and click on `Library`. Enable the **Google Sheets API** and **Google Docs API**.

### Using templates

Many of our google integrations use **templates** when importing/exporting data.

To provide your own template, you must provide the **id** of the document you wish to use.

<figure><img src="/files/PtvREgdESTQjdS3vC5JF" alt=""><figcaption><p>An example spreadsheet using Google Sheets.</p></figcaption></figure>

You can find the ID following the **/d/** inside the URL.

After you have created a template, the only thing you will have to do is to make sure that you **share** the document with your service account email address to make sure that it has permissions to access it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ecosuite.io/user-guide/orgs/google-integration/getting-started/self-hosted.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
