How to get image using Onenote api? - onenote

I am using onenote api for display the page. Page contents are displaying properly. But I got images broken link.
I have added another get option for get the images. But I got Odata Notsupport or Method Not allowed error message.
Please advise how to get the image form onenote pages?

The OneNote API requires all of its API calls to be secured by an OAUTH bearer token. So you can't just push the content of the HTML from the API into a browser, because the image references won't get the auth passed on by the browser.
I've created a uservoice issue here for you to vote on to request this feature.
In the meantime, you'll need to write your own code to GET from these image URLs with the same auth token that you used to get the page HTML initially, then swap the URLs out to point to wherever you choose to store those resources.

Related

How to use preview image or PDF from Google Drive, using API?

I'm writting Web application to display content of Google Drive images and files, using API.
Currently, I can only see thumbnails of images/files (without login to Google drive).
If I want to preview the file, I need to be logged into Google drive and then I can use link returned by "webViewLink" and actually see the file.
I know I can click on folder or file on Drive and Share it, but I'm afraid that my customers will not be able to do that and it is complicated, anyway.
I already displaying Google dialog to customer where customer need to allow access to upload,delete etc. of files and now he can not preview the file???
Application is designed to display image/whatever to customer only, inside app only and not to sharing. With other words, I want to display images which he can see anyway if he is logged to Drive.
Is there any other option to allow customer to preview the file, if he already allowed full access previously?
Thanks.
Authorizing with OAuth does not automatically log you in. Users use their credentials to give their permission to create an access token, which needs to be used in any API calls. It does not imply that a browser session was created, that's a separate process.
You'll notice that the webViewLink is just the regular Drive URL with /view at the end. It's a page that requires the user to be signed in:
"webViewLink": "https://drive.google.com/file/d/<FILE-ID>/view?usp=drivesdk",
I'm not aware of any methods to sign in the user at the same time they use OAuth, but if you send your access_token in an Authorization: Bearer <access_token> header when trying to access the above URL you can see the preview without having to sign in. Depending on your platform I think implementing this would be tricky, and maybe not possible in Apps Script alone.
My recommendation as a workaround is to just use a full thumbnail. Don't know if you're aware of this, but the thumbnail URL has a =s parameter at the end that defines its height in pixels:
"thumbnailLink": "https://lh5.googleusercontent.com/<THUMB-ID>=s220",
You can change the default =s220 at the end to a higher size or remove it completely to get pretty much the full size of the image or PDF page. This may be enough for your users to figure out what the file is.

Access Google Maps API json in browser

Silly question I am sure.
But how can I access this for simple testing but also whilst inside a phonegap which has no URL directly through the browser:
https://maps.googleapis.com/maps/api/geocode/json?address=122+flinders+st,+darlinghurst,+nsw,+australia&sensor=false&key=API_KEY
I have of course changed the API key which is a browser key. I have also changed my Referers: * So everything should be allowed.
Try this. It's a very simple phonegap maps api example.
One option is to use the Advanced REST Client Plugin which is free and you can install it on your chrome browser. This plugin opens directly in browser tab and you can set the request in a huge text box, set the type of request (GET, PUT, POST, DELETE etc) and also the parameters if required. You can see the results in below when you hit submit.
This Plugin is exclusively made for testing purposes relating to matter like sending a request to an API and then getting the results back from it in either JSON or XML format.
Click this link in order to install it in your Chrome Browser.
Hope that Helps!!

Google Docs viewerng api reference

I am trying to show a file hosted in a public site inline on my web page using google docs by providing the following URL to an iframe.
https://drive.google.com/viewerng/viewer?url='+link+'&embedded=true
where link is the path to the file I want to show.
I am facing some issues with showing files which require user authentication.
Hence would like to see reference documentation for the API. I searched for it online was unable to find any reference documentation for the following service end point.
"https://drive.google.com/viewerng/viewer"
Let requests originating from this Google service pass your authentication
Include a secret parameter in the link to confirm that an authenticated user (of your site) is requesting the document (via viewerng)

Google Chrome Extension for interacting with a web application

hope somebody understand and can maybe explain me my idea.
My Goal:
I would like that the user can use my web application, but the requests for parsing urls, etc will not run on my server, but
are processed on the client side via the browser.
My theoretical example:
There is a web application the user need to login.
If the user is logged in, he can paste ten urls into a textinput box and than push a button.
Then a ajax request is made to the server and the urls are parsed and the site informations from the parsed urls comes back as json to display it in the frontend.
Ok now my real question.
Is it possible to create a Google Chrome Extension that catches the Post request from the textarea, and send the urls to the
background.js. than the background.js should request this urls via javascript xmlhttprequest to bypass the cross-orgin restriction.

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.