PERMISSION_DENIED error while reading public spreadsheet with Google Sheets API - google-sheets-api

I am using Google Sheets API v4 to read a spreadsheet content in my project. It has worked just fine for a few months, but recently I started to get a PERMISSION_DENIED error while reading some, but not all of them.
All the sheets worked properly before, but now some of them can't be read (resulting in PERMISSION_DENIED error) while the other ones still work fine. Also when I create a new sheet it does NOT work.
All the sheets are available for viewing for anyone at the web, I did not change the API key I am using, the sheet owner did not change, some sheets have not even been modified for weeks. Long story short: I did not change anything (that I am aware of) that could impact reading the sheets but yet some of sheets suddenly stopped working.
Has anything changed recently in how Google Sheets API works? Or am I missing something else?
EDIT:
A few hours passed by and some sheets that previously did not work now work and some that did work now don't. The sheets have not been modified in meantime.
May this be caused by reaching any usage limit? I don't get RESOURCE_EXHAUSTED message though. It's PERMISSION_DENIED in each case.

Turns out it was a bug on Google side. Now everything works as intended.

Related

Is there a SpreadsheetApp.flush() option for the Google Sheets API?

I have a spreadsheet that I send data to it, I generate a 1-minute sleep (import time → time.sleep(60)) in the code to make sure that the calculations have all been done and then I copy the result of these calculations to another page of that same spreadsheet.
In Google Apps Script there is the SpreadsheetApp.flush() option to make sure that everything in the spreadsheet is perfect to continue the code.
But what about when we use the Google Sheets API, is there a way to do this instead of putting a sleep with a random value like I do?
I was curious about that too, so I reviewed the documentation, and it seems that there is no flush() method for Sheets API.
However, I found a workaround that might help so you can make sure that you are working on the latest version of the sheet. I took inspiration from the Writecontrol parameter in Google Docs API.
"Determines the revision of the document to write to and how the
request should behave if that revision is not the current revision of
the document."
So what I was thinking is to use the Drive API Revisions by using the Revisions: list method and get the latest version of the Sheet. After that, use Revision: get to retrieve the latest version of the sheet to work on it.
You can also submit a missing feature, Google might add this method to the Sheets API later on.
Reference:
Flush() method.
Writecontrol Google Docs API.
Changes and revisions overview.
Revisions: list.
Revisions: get.

How do I find Endpoint Data in Drupal 8

I was handed a D9 site. Have not touched Drupal since D7. Anyway, we have a client that is sending data to an endpoint on our sided. Here are the comments/notes that I got:
MarktCom populates some hidden vars on their site and sends them to the endpoint like this /Casingo/api/post
Casingo gets those values and contacts MarktCom's api with the clientID.
MarktCom then returns the member data
I realize this is probably a stupid question, but how do I find/get/see the data that MarktCom sent? I have gone thru the custom module. I see the endpoint url (above), I see the api data path and api domain. but I don't see the data when I dig into the directory (i'm assuming it probably a .json file.). I can see the ultimate .csv files that are being created from the data, but not the actual data.
Lots has happen due to the issues of the past couple of years, so getting to anyone on their side that knows what going has been hard/impossible. The overarching issue is that the .csv file, a couple of months ago, the data/info started all duplicating, so I want to see what we are getting so I can determine where to start fix.
And ideas on how I can investigate this would be much appreciated.

shopify-buy SDK cant checkout or add items to cart anymore

Recently all my Shopify apps have stopped working due to this error. I can still pull data from the api (photos, titles, etc) but I can no longer add items to my cart or check out. this error isn't just happening on my current build but previous builds too. I think I might have made too many requests due to refreshing pages and have been banned from the API temporarily (I've had this happen with another API before). but it's now been 2 days and still no fix.
I'm pretty confident there's nothing wrong with my code because it's happening to other websites that were working before & haven't been touched for a while.
package used: "shopify-buy": "^2.11.0"
Thanks,
Mitchell D
turns out this error occurred because I was in PAUSE AND BUILD mode. so I must be on a plan to add items to the cart using the API? they must have made this change recently

VSTS - uploading via an excel macro and getting #mentions to work

I am using VSTS and would like numerous people to get sent the notification when a work task is created.
I am creating a lot of stencils that can just automate and upload work tasks through the TEAM add-in in excel, but don't know how to make the "#mention" function work.
I have written all sorts of styles of syntax in the history field, then publish but nothing seems to work.
Has anyone figured this out?
Cheers Dave
The format is like:
You can To get the userid through User Entitlements-Lists REST API:
GET https://{accountName}.vsaex.visualstudio.com/_apis/userentitlements?api-version=4.1-preview

Google Sheets API - 500 Error for sheets listing

I am hoping someone can help me figure out why I can't get the Google Sheets API to return a list of sheets for some users.
I am attempting to use the Google Sheets API to get a list of sheets available from a user's account after they have given authorization.
Things seems to be working for the most part, but I am getting 500 Error for a number of users who have tried to test the functionality.
If User1 who experiences the failure shares all of his sheets with User2 who has not experienced the failure, User2 continues to work without experiencing any failure. I believe that rules out an issue with any particular sheet. (Unless of course a sheet that is "shared" with User2 is somehow different than a sheet that is actually in and owned by User1's account.)
I think the problem must be something with this particular user account or their settings, but I don't understand what it might be or how to work around this. The failure is always reproduceable for specific users for whom it fails, and success is always consistent for specific users for whom it does work. It may be important to note that the users with the failures are indeed able to successfully access from the Google Drive and Google Sheets web-interface every sheet in their account (whether owned by them or shared with them).
The requests that have received both failures and successes are being made in exactly the same format. However, the key length is the only real difference I noticed between the requests that succeeded and the requests that failed. In my limited sample set of tests, the successful requests seem to have the longer keys whereas the failed request have shorter keys. Here is an example of each with part of the key redacted:
FAILED
https://spreadsheets.google.com/feeds/worksheets/t-4-L-cbXXXXXXXXXXm2lA/private/full
GOOD
https://spreadsheets.google.com/feeds/worksheets/1n7rDwb5gwt1XXXXXXXXXXYzUz2_F4nEqMhaK4Odk/private/full
Also, I have tested this with both personal Google user accounts as well as with Google Apps user accounts. I have examples of both types that both work, and that fail.
Does anyone have any ideas how to trouble shoot this, or what else to try, or what other information may be helpful?
Thank you!
The API seems to sometimes return sheets that are no longer available in that user's account. I'm not sure why it does that. However, if you try to enumerate the worksheets within a sheet that is no longer available (or access it in any other way), you will experience a problem since the sheet itself is no longer available. Code your solution so that you don't try to access the contents of any sheets that are no longer available.
the FAILED
https://spreadsheets.google.com/feeds/worksheets/t-4-L-cbXXXXXXXXXXm2lA/private/full
seams oddly short are you sure the key is correct?