-
Notifications
You must be signed in to change notification settings - Fork 2
7.1 Google Sheets
Jos de Weger edited this page Feb 28, 2022
·
1 revision
Getting the data for a public document requires the use of the GoogleSheetAdapter
. This adapter has one method for getting data: Task<Sheet> GetAsync(string sheetId, string range, string apiKey)
.
Parameters explained:
-
sheetId
: the id of the sheet, which you can find in the url when viewing the sheet on Google Sheets -
range
: for example 'my sheet'!A1:E4 -
apiKey
: your apikey for accessing https://sheets.googleapis.com/v4
Example:
var adapter = new GoogleSheetAdapter();
var sheetData = await adapter.GetAsync("my-sheet-id", "A1:E4", "my-api-key");
var result = sheetMapper.Map<MyModel>(sheetData);