Closed sebastianjhm closed 3 years ago
If you're using gs4_auth to reference your own resources, you'll need to set up an API credentials.
Here's a link to a gargle page that walks you through which API credentials you can set up, how to set it up in the cloud. You'll need to choose which works best for your case. From there, depending on your setup, you'll have to call gs4_auth(....) and reference a file in your project (or wherever you've put it on your computer).
If you don't set up your own API credentials, you'll be using the public googlesheets4 resources (unless that's been changed) which may create a user limit error depending on how many people are accessing that resource at the same time.
For example, I use a service account token which is stored as a .JSON file on my computer. So at the beginning of my script i'll use
gs4_auth(path = "path/to/my/service-account-token.json"
Hope this is helpful!
I think, like @cpilat97's example, that you @SebastianJHM should use a service account. This requires some setup, which will be unfamiliar and perhaps uncomfortable at first, but then you will have a robust auth solution for your app.
The links above are sound re: how to get a service account and then how to put its credentials into force.
Remember that you will need to explicitly give this new service account write permission on the target Sheet. The service account won't somehow inherit these privileges automagically, simply because you have such privileges and you are associated with the GCP project that owns the service account. It doesn't work that way, but this appears to be a common gotcha.
Hi, thanks to the googlesheets4 team, it's an excellent library. I am new to this world of APIs and I have not found much information about it. My intention is to write a shiny application that writes data in a spreadsheet, but I don't know how to authenticate with Gargle, that is, I don't even know how to extract the token that gives the application permissions to access the file or how to use it. . I don't know if I have to extract it using GCP or from Drive. I would like to know how to fill the gs4_auth () to be able to read and write in the spreadsheet. I should clarify that I would like only the application to have the permissions to access the data. Thank you very much in advance and apologies if it is too obvious.