Onenote Single Notebook Access - onedrive

We use onenote api's to access user's onenote notebooks and sync to our system.
When we do oauth for the first time, we get options like 'office.onenote_update_by_app' which allow us to create / edit pages in any of the user notebook and read only those pages.
But we need an option for user to allow us to access only 1 specific notebook. All the pages, sections created by a user directly in that notebook should also be accessible by our app. And no other notebook should be accessible in any way.
Please suggest solution.

Related

What a client has to enable to use my app to edit their Google Sheet

Let's say I wrote a simple desktop app that reads some data from a Google Sheet, goes off and finds the answer and comes back and writes it into the Google Sheet. Now hundreds of people have sheets and want to use my program to process them. I post my program and let them download it for free.
Here is the sequence I think the end user needs to follow to get it to work:
1. Go to the GCP console and create a new project
2. Enable the Google Drive and Google Sheets APIs
3. Create a credentials JSON file with access as the Project Editor.
4. Create the Sheet if needed.
5. Copy the email out of the JSON file and Share it in the Sheet.
6. Make sure the JSON file is named right and in the right directory so the app finds it.
That all seems like a lot just so an app can read and write to a Google Sheet. Is there a simpler interface I am missing?
Answer:
There are steps that will always need to be completed when a user runs an application that accesses the Google APIs as themself, however depending on the case some of these may be simplified or circumvented.
More information:
There are a few things that you will need to bear in mind when creating an application for others to use, I'll summarise these points here and explain in a bit further detail:
To use a G Suite API, a Google Cloud Platform (GCP) Project needs to be owned and have the API associated.
In order to use the Google APIs (such as Drive and Sheets) its use must be enabled within the project that will use it.
If a user is running an application as themself, they will need to authenticate the application with their own credentials.
As per Google's documentation for Setting up a project:
Every application that uses Google APIs needs an associated Google Cloud Platform project. This project is a set of configuration settings that define how your application interacts with Google services and what resources it can use.
Resultantly, if your users will be running the application themselves, from a version of the app which is unpublished and not in the G Suite Marketplace then yes - they will need to create a GCP project, enable the respective APIs and use their personal credential file to run your application.
In reality this isn't the way G Suite Applications should be created, distributed and maintained and I can't reccommend that you do it this way. The G Suite marketplace is there to put in place a way of application distribution while removing the need for each user to create a GCP project and authenticate.
Things you can do:
With this in mind, there are a couple of things you can do to which will make the process of what you're doing slightly easier/shorter. Please bear in mind this isn't recommended for application distribution and more for testing purposes:
You can combine points 1, 2 and 3 in your question by having users click the Enable the Google Sheets API button on the Python Quickstart page. This button creates a new GCP project, enables the API and gives a credential file download link in one fell swoop.
Rather than having the user create the sheet themselves, you can code a sheet existence check in your program and create it if it doesn't already exist:
from pprint import pprint
from googleapiclient import discovery
# assuming you already have all your authentication code
sheetsService = discovery.build("sheets", "v4", credentials = credentials)
# add request body to variable sheetBody:
sheetBody = {}
# create the sheet:
sheetsService.spreadsheets().create(body = sheetBody).execute()
The https://www.googleapis.com/auth/drive.file scope allows your application to only access files created by itself which gives your application an extra level of security and trust.
In the sheetBody contents you can imclude the email address of the account running the application, if applicable, by running a Files: list request of the Drive API and reading the owners.emailAddress property of the response, to save reading the address from the JSON file.
References:
G Suite Developer:
G Suite APIs
Set Up Your Project
Build your app
Google Sheets API v4:
Python Quickstart
Google Drive API v3:
Files resource

How to open documents with Office365 in my web application?

We have a cloud based audit application. While performing audit a user typically uploads a lot of documents. Currently in order to view the documents he has to download them. Business requirement is that on clicking the document it should directly open up in another browser tab using office 365 just like dropbox/onedrive. The user should be able to view, edit, save it on server (without downloading) and close it. How to achieve that in our application?
Our webapp is built using ReactJS, NodeJS & MongoDB. Whenever a user uploads a document it gets saved in a AWS S3 bucket.
I went through Microsoft Graph API and OneDrive RestAPI's. Looks like the only solution is to use the OneDrive API's to save files in OneDrive instead of S3. And then it should allow you to use the Office365 apps. Is this the right solution? Am I missing anything?
Is there any other solution?
While the easiest solution is indeed to store the documents in OneDrive, there's also another way. You can enroll in Microsoft's Cloud Storage Partners Program and implement the WOPI protocol on your service. This would allow the Office Online viewers/editors to integrate with your service's data directly.
You need to use both aws and O365 api to reach a working solution. Try the following steps (PS: I have not tried this. But I have saved edited documents from Office 365 to AWS)
Read the uploaded document from AWS using AWS api's and upload it to office doc using office doc api.
Edit the doc using office docs api.
Save the doc back to S3

upload file to google drive without human interaction via SDK

I want to upload files to google drive. I'm using C# and have referred following links to get started
https://developers.google.com/drive/v3/web/quickstart/dotnet
https://developers.google.com/drive/v3/web/manage-uploads
I'm able to upload the file successfully to google drive but my main concern is I don't want to display any sort of UI/human interaction. It should be able to automatically upload the file.
Using OAuth2.0 there is a need that we have to manage and generate access/refresh token. I have no idea how these should be managed.
Isn't there any other way where the user can have access to google drive programmatically just by sharing his/her Gmail account username/password to achieve this?
Isn't there any other way where the user can have access to google drive programmatically just by sharing his/her Gmail account username/password to achieve this?
No there is not
The user needs to authorise your app one time. After that, you can save Refresh Token and use that for future unattended use.

OneDrive API Link Sharing Options

I'm currently working on an application that interacts with OneDrive. I've read RESTful API manual and the only option available is to share document.
My questions are:
Is there any way to remove or regenerate file sharing link?
Is there any way to specify user emails to give an access to them?
Is there any way to control this UI option "Recipients need to sign in with Microsoft Account"?
The sharing links that are created do not expire. If you create a sharing link for a file that already shared, a HTTP 200 code will be returned. At this time, createLink is only available but the user can remove the sharing permission from the OneDrive website. Specific user access isn't currently supported. Like the OneDrive website, any created link will not require sign-in. I hope that helps.
The only way to regenerate link to a file is to:
Copy file "foo.docx" to "(Copy) foo.docx"
Remove file "foo.docx"
Rename "(Copy) foo.docx" to "foo.docx"
Generate link for "foo.docx"
There is no way to specify emails for document access
There is no way to control this UI option "Recipients need to sign in with Microsoft Account"

How to access Chrome's online bookmarks?

Google Chrome allows you to sign in with your Google account to sync bookmarks and settings. Those bookmarks are then stored along with my account on their servers.
I want to create another client for the bookmarks. Please note that I am not interested in reading the local bookmarks file from hard disk. Instead I want to connect with the online servers directly.
So I need to access the same API as Chrome uses for synching. Is there a way to find out how to use that API?
Whilst not using an API directly it allows you to query data from google bookmarks online (directly via REST call), and parse it yourself.
http://www.google.com/bookmarks/?output=xml&num=10000
I have included a link on how you may parse this data from the "Lite Bookmarks" chrome extension repository.
http://www.google.com/bookmarks/?output=xml&num=10000