Google drive preview "/image" API doesn't work anymore? - google-drive-api

Few days ago I was able to make request to:
https://drive.google.com/a/{{domain}}/file/d/{{docDriveId}}/image?pagenumber=1&w=400
Via this API I was able to get image preview on multi-page documents.
Seems it's there, but times-out after some time. It doesn't work anymore. Does anyone know what happened? It seems there's no documentation on this API.
On the other hand, I am aware of the thumbnailLink URL when getting document object via API, but this will only get 1st page preview.
Any alternative solutions to this?
Thanks a lot,
M

That URL is not a part of the official Drive API and is not guaranteed to remain stable. The Drive API doesn't include the ability to fetch per-page image previews of documents, but you may want to investigate using the embedLink as an alternative: https://developers.google.com/drive/v2/reference/files

Related

Program/tool for reading/logging http requests and responses?

I'm trying to log autocomplete responses from a gmail "people" server, and I'm trying to find a program or tool to do this, like the network section in chrome dev tools. I tried using a web crawler script, but authentication would be a mess. I also tried Wireshark, but it was all garble to me and probably the wrong way to go. Is this even possible? Can somebody help me, I'm totally out of my comfort zone here. please see attached image
It would be best to find an API that google makes public for the data that you need and use that to query the data. For people, google does have an API. Have a look here: https://developers.google.com/people
Tools commonly used to make HTTP queries are https://www.postman.com/ and https://curl.haxx.se/

HTTP 403 on images loaded from googleusercontent.com

First off, I don't think my problem is related to these questions: question 1, or question 2.
Because I'm not using authentication anywhere, or any library either (I don't need to).
I'm simply loading some publicly-available album art images in my web application:
// urlList is an array than contains URLs like the examples given below
<img *ngFor="let url of urlList" src="url">
Example URLs:
Glass Mansion, Summertime, Side Effects
99% of the time, it works. But sometimes I get 403 errors on the console for those exact same URLs.
I know they're not related to authentication, because, well. These URLs are publicly accessible.
Debugging this has been difficult, because a few page refreshes later, it magically works again. There's nothing out of the ordinary in logs either (except the GET 403 errors).
What in the world is happening?
I'm using Angular v7.2.15. Browser: Google Chrome
Add referrerpolicy="no-referrer" attribute
<img src="your-google-link-here" referrerpolicy="no-referrer"/>
Within several Google API's (like the gmail API for example), Google uses HTTP403 and/or HTTP429 in order to ratelimit certain requests over certain time periods. I do not know what method you are using, if you are using some sort of API etc, nor do I know how busy or large your webapp is. But rate limiting or fair use compliance could be coming into play.
Gmail API Rate Limit Info Source - https://developers.google.com/gmail/api/v1/reference/quota

jsPDF server side usage

I really like the look of jsPDF but I can't seem to find any documentation for server side usage. The page here seems to suggest that this is possible, but the link for an example is broken or no longer exists. I would really like to use this library in a Google Apps Script project if possible.
The new home for jsPDF is here. Note that the "Server-side will work anywhere" promise is no longer presented. Chances are that it would work on Node.js, for example, but since Apps-Script is an incomplete javascript implementation it might not work there.
You can generate PDF files from within Apps-Script already. If the subject document is in Google Drive, then you can use getAs("application/pdf") to request the document as a PDF. (If it's not a Google Drive document, then first turn it into one.) Read over 4 ways to do Mail Merge using Google Apps Script, method 3, for an example.

Incorporate Google Drive solution in existing Android app project?

I have an existing Android app project which has been already published on the Google Play, and now I would like to incorporate in my app the possibility to use the Google Drive possibilities in order to download *.jpg files directly to the sd card when the app is opened or load for the first time. Like this I liberate the internal memories of the phones where this app is installed (All the images are stored in the resources of the app actually which is >~ 20MB). I have read a lot of forums concerning the Google Drive SDK or API subjects and I can say that I'm a little bit lost on the manner to manage it for my present app. Some ideas or suggestions would be very very very appreciated.
Thank you very much).
Please see this question for the basics on how to integrate your Android app with Google Drive SDK: Access to Google Drive from self implemented Android application
In it, I reference a good Google+ tutorial on how to get started, and it's easy enough to take the concepts and apply them to an existing app. (That's how I did it too.) Before you get started, sign up for the Google APIs (https://code.google.com/apis/console/), get into the API Console, and turn on both the Google Drive API and Drive SDK. This'll make coding go a lot smoother. Let me know if you have any problems.
One addendum for your specific case relating to *.jpg files is you could set a MIME type for fetching strictly the pictures. It'd go something like this:
request = service.files().list(); // .setQ("mimeType=\"text/plain\"");
Unfortunately setQ is commented out because it would fail to return any results when I used it. However, you may have better luck with the image/jpeg MIME type.

Google maps API v3 flash empty viewport

I'm using the google maps API v3 with flash and it works fine on one of my websites.
I transfered it to another website and changed the API key, but all I see is the default background color with no error message. Unfortunatly, I cannot access the flash source code.
Is there a way to debug the application or see some error messages without the source code?
Or maybe somebody has an idea of what is wrong?
Use Firebug Net monitor to see if all of the request are going through. That would be the first place that I would start. My guess is that there are HTTP Requests trying to get data from a domain that doesn't have a crossdomain policy allowing access from the new site you moved it to.
First of all maps V3 doesn't need a a key. I think you are combining parts of V2 (with key) and V3(which doesn't need key) so obviously there is something wrong in your code.