Using the Google Sheets REST API V4, and would prefer to use the sheet id instead of sheet title to look up values in a cell. It seems like you can specify the sheet within the spreadsheet using the range, e.g. Sheet4!A1:Z500
, but not a sheet ID such as 1310487470!A1:Z500
. This is so the query doesn't have to change if someone renames the sheet. Does the Google API support querying by ID?
Current query:
https://sheets.googleapis.com/v4/spreadsheets/1SR0DJ4nV5-05EWxjz1OYOWkKFObClmsC0rOowPnMwNE/values/Sheet4!A1:Z500
Ideal query:
https://sheets.googleapis.com/v4/spreadsheets/1SR0DJ4nV5-05EWxjz1OYOWkKFObClmsC0rOowPnMwNE/values/1310487470!A1:Z500
sheets.spreadsheets.get
, and creates A1 notation using the title for the GID. The url query ishttps://sheets.googleapis.com/v4/spreadsheets/sheetID?fields=sheets(properties(sheetId%2Ctitle))
. The scope ofhttps://www.googleapis.com/auth/spreadsheets.readonly
can be used for both APIs. If this will not be helpful for you, I'm sorry. – Tanaike