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?
Related
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.
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.
I made a program that gets the data from the clipboard and saves it in a string variable. Then it looks for specific words in that string and generates several URLs. Afterwards it open the browser and shows each URL in an own tab.
Some of my friends already use this program frequently and I want to have some statistics about how often. I simple counter variable would be enough but I need to get access to it.
I came up with two options that could work:
I could send an email to a specific adress every time my app is executed. Then I can track the amount of uses by manually or automaticly counting the amount of emails in the postbox. I think this would be a Vers dirty solution.
I could create and publish a website containing a counter. This counter could be refreshed by my application. This solution is a bit better I think but a lot more work for just one single counter.
Do you have better ideas to solve my problem or is one of mine already a good one?
Thank you in advace!
You can use Measurement Protocol Overview. This provides you statistics of usage your application compared with Google Analytics. You can see even a geo statistic, version distribution, crash reports. It is easy to use it from .net. It is just about requesting http request to google.
So my friend hosts a little get together every once in a while where space is limited to the first 14 people who RSVP. He emails the invite out to a list and then accepts the first people who respond. Tonight I barely got in because I can't always check my email, so I told him that I would write a program that would respond instantly to his request. This would not normally be a problem (autoresponder, easy) except he has recently created an online signup form. I think it would be funny for him to send out his next invite and get a sub-100ms response from me, so I would like to give this a try.
The problem is, I'm not quite sure how to go about it without going to to much expense. I have a personal site that can host some .NET backend code, but it's on a shared GoDaddy server so I don't really have a ton of access to the mailserver or anything. I was thinking that if I could get an email sent to a certain address that maybe it could trigger a webrequest that could pull down his page and then fill the (very simple, like 2 or 3 inputs) form out and submit it, but again, I'm not quite sure how.
Would anyone have an idea about how I could go about this? I would want for this to happen automatically without any sort of interaction from me, just basically as soon as I get an email from a certain email address, somehow my code is triggered and the form filled out and submitted.
This is just for fun, but the programmer in me is curious as to how I could actually get this to work.
Thanks!
The most affordable thing I know of would be through NearlyFreeSpeech.NET. If you set up an account there, you can configure a domain with email forwarding for 3 cents/day. They have an option to forward the email to a script, so you could write something that would look at the mail, pull down the form, and post to a server.
I'm not sure but I think the script has to be running on their servers, so you'll have to set up a website (another few cents per day) and write the script to run in a UNIX environment (PHP or Perl or such). If you insist on .NET, you could write a minimal PHP script to forward the data to your GoDaddy account.
While trying to debug my openid implementation with Google, which kept returning Apache 406 errors, I in the end discovered that my hosting company does not allow to pass a string containing "/id" as a GET parameter (something like "example.php?anyattribute=%2Fid" once URL encoded).
That's rather annoying as Google openid endpoint includes this death word "/id" (https://google.com/accounts/o8/id) so my app is returning 406 errors every time I log in with Google because of this. I contacted my hosting company who told me this has been deactivated for security purposes.
I could use POST instead, for sure. But has anyone got an idea why this could cause security problems ???
It can't, your host is being stupid. There's nothing magical about the string /id.
Sometimes people do stupid things with the string /id, like assuming no one is going to guess what follows, so that example.com/mysensitivedata/id/3/ shows my data because my user has id 3, and being the sneaky sort, I wonder what happens if I navigate to example.com/mysensitivedata/id/4/, and your site blindly lets me through to see someone else's stuff.
If that sort of attack breaks your site, no amount of mollycoddling by your host will help you anyway.
One reason a simple ID in the URL could be a security concern is that a user could see their ID and then type another one in, such as if its an integer they may select the next integer up, and potentially see another users info if it is not protected.