| = Google Sheets Component |
| :doctitle: Google Sheets |
| :shortname: google-sheets |
| :artifactid: camel-google-sheets |
| :description: Manage spreadsheets in Google Sheets. |
| :since: 2.23 |
| :supportlevel: Stable |
| :tabs-sync-option: |
| :component-header: Both producer and consumer are supported |
| //Manually maintained attributes |
| :group: Google |
| :camel-spring-boot-name: google-sheets |
| |
| *Since Camel {since}* |
| |
| *{component-header}* |
| |
| The Google Sheets component provides access |
| to http://google.com/sheets[Google Sheets] via |
| the https://developers.google.com/sheets/api/reference/rest/[Google |
| Sheets Web APIs]. |
| |
| Google Sheets uses |
| the https://developers.google.com/accounts/docs/OAuth2[OAuth 2.0 |
| protocol] for authenticating a Google account and authorizing access to |
| user data. Before you can use this component, you will need |
| to https://developers.google.com/google-apps/sheets/auth[create an |
| account and generate OAuth credentials]. Credentials comprise of a |
| clientId, clientSecret, and a refreshToken. A handy resource for |
| generating a long-lived refreshToken is |
| the https://developers.google.com/oauthplayground[OAuth playground]. |
| |
| In the case of a https://developers.google.com/identity/protocols/oauth2#serviceaccount[service account], |
| credentials comprise of a JSON-file (serviceAccountKey). You can also use |
| https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority[delegation domain-wide authority] |
| (delegate) and one, several, or all possible |
| https://developers.google.com/sheets/api/guides/authorizing[Sheets API Auth Scopes] (scopes). |
| |
| Maven users will need to add the following dependency to their pom.xml |
| for this component: |
| |
| [source,xml] |
| ---- |
| <dependency> |
| <groupId>org.apache.camel</groupId> |
| <artifactId>camel-google-sheets</artifactId> |
| <!-- use the same version as your Camel core version --> |
| <version>x.x.x</version> |
| </dependency> |
| ---- |
| |
| == URI Format |
| |
| The GoogleSheets Component uses the following URI format: |
| |
| ---- |
| google-sheets://endpoint-prefix/endpoint?[options] |
| ---- |
| |
| Endpoint prefix can be one of: |
| |
| * spreadsheets |
| * data |
| |
| |
| // component-configure options: START |
| |
| // component-configure options: END |
| |
| // component options: START |
| include::partial$component-configure-options.adoc[] |
| include::partial$component-endpoint-options.adoc[] |
| // component options: END |
| |
| // endpoint options: START |
| |
| // endpoint options: END |
| |
| |
| == ValueInputOption |
| |
| Many of the APIs with Google sheets requires to include the following header, |
| with one of the enum value: |
| |
| |==== |
| | *Header* | *Enum* | *Description* |
| | `CamelGoogleSheets.ValueInputOption` | `RAW` | The values the user has entered will not be parsed and will be stored as-is. |
| | `CamelGoogleSheets.ValueInputOption` | `USER_ENTERED` | The values will be parsed as if the user typed them into the UI. Numbers will stay as numbers, but strings may be converted to numbers, dates, etc. following the same rules that are applied when entering text into a cell via the Google Sheets UI. |
| |==== |
| |
| == More information |
| |
| For more information on the endpoints and options see API documentation |
| at: https://developers.google.com/sheets/api/reference/rest/[https://developers.google.com/sheets/api/reference/rest/] |
| |
| |
| include::spring-boot:partial$starter.adoc[] |