onedrive-api | official middle-level HTTP API bindings | REST library

 by   oxalica Rust Version: v0.9.0 License: MIT

kandi X-RAY | onedrive-api Summary

kandi X-RAY | onedrive-api Summary

onedrive-api is a Rust library typically used in Web Services, REST applications. onedrive-api has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

A non-official middle-level HTTP API bindings to the OneDrive REST API through Microsoft Graph
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              onedrive-api has a low active ecosystem.
              It has 28 star(s) with 7 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 0 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of onedrive-api is v0.9.0

            kandi-Quality Quality

              onedrive-api has no bugs reported.

            kandi-Security Security

              onedrive-api has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              onedrive-api is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              onedrive-api releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of onedrive-api
            Get all kandi verified functions for this library.

            onedrive-api Key Features

            No Key Features are available at this moment for onedrive-api.

            onedrive-api Examples and Code Snippets

            No Code Snippets are available at this moment for onedrive-api.

            Community Discussions

            QUESTION

            Accessing OneDrive doc of Personal Account or Only one user in Business account via API
            Asked 2020-Feb-11 at 06:31

            I am able to access OneDrive items of all the users in Office 365 business account using a free trial created from this link.

            https://www.microsoft.com/en-in/microsoft-365/business/office-365-enterprise-e3-business-software?rtc=1&activetab=pivot%3aoverviewtab

            However, in order to make it work I needed to give my application below permission, which eventually allows this app to access OneDrive items of all the users in this tenant because of these permissions.

            File.Read.All -> Delegate

            File.Read.All -> Application

            User.Read -> Delegate

            User.Read.All -> Delegate

            Site.Read.All -> Delegate

            Now, my requirement is to access OneDrive document of only one users from this tenant and block the application from accessing documents from other users, or access document of any personal account (@hotmail.com/@live.com).

            Please let me know if there is any way or in case I am doing anything wrong with the application I registered.

            Asked the same question here but bot told to ask to azure team in stackoverflow https://github.com/OneDrive/onedrive-api-docs/issues/1219

            Appreciate any help.

            ...

            ANSWER

            Answered 2020-Feb-11 at 06:31

            Firstly, you need to understand the differences between Application permission and Delegate permission.

            Application permission means App-only, the application acts as a user but there is no user sign in.

            Delegate permission means App + User, a user will need to log into the application and access the resources.

            So based on the permissions you have provided, I can't tell if your application requires a user to log in. If yes, Delegate permissions will take effect. Based on Delegated permissions, Files.Read.All allows the app to read all files the signed-in user can access. If the signed in user can access others' document, then your app can access them too. So if you control the access permissions for the user in OneDrive or SharePoint, your app with this signed in user will have the same permissions.

            If your app doesn't require a signed in user, Application permissions will take effect in this case. Based on Application permissions, Files.Read.All allows the app to read all files in all site collections without a signed in user. So this scenario does not meet your needs.

            Source https://stackoverflow.com/questions/60162079

            QUESTION

            Query for files in OneDrive returns empty list
            Asked 2019-Jul-18 at 09:06

            I want to create a simple Python utility that interacts with files on OneDrive. Right now I'm using my company account (so I have no access to admin settings or any detailed insight into OneDrive/Sharepoint/Azure configuration).

            After quick googling session it seemed that Microsoft Graph is the way to go. I started with copying the sample app and once I verified that basic functionality is working (it shows the name from my profile, etc.) I tried adding a simple call to me/drive/root/children in order to list files in the root directory. And I am unable to get it working.

            No matter what I do, server returns the following:

            ...

            ANSWER

            Answered 2019-Jul-18 at 09:06

            After updating the permissions, users and/or admins will have to consent again.You can force user consent through a url request or just click 'grant admin consent button' in azure portal.

            https://login.microsoftonline.com/{tenant}/oauth2/authorize? client_id={your_client_id} &response_type=code &response_mode=query &resource=https://graph.microsoft.com &state=12345 &prompt=consent

            Source https://stackoverflow.com/questions/57075785

            QUESTION

            How to OneDrive API file uploads with node.js?
            Asked 2017-Aug-14 at 01:21

            After a time I finally figure out how to use oAuth2 and how to create a access token with the refresh token. But I can´t find node.js samples for upload files the only thing I found was this module https://www.npmjs.com/package/onedrive-api

            But this didn´t work for me because I get this error { error: { code: 'unauthenticated', message: 'Authentication failed' } }

            Also if I would enter accessToken: manually with 'xxxxxxx' the result would be the same.

            But I created before the upload the access token so I don´t know if this really can be a invalid credits problem. But the funny thing is if I would take the access token from https://dev.onedrive.com/auth/msa_oauth.htm where you can generate a 1h access token the upload function works. I created my auth with the awnser from this question. OneDrive Code Flow Public clients can't send a client secret - Node.js
            Also I only used the scope Files.readWrite.all do I maybe need to allow some other scopes ? My code is

            ...

            ANSWER

            Answered 2017-Aug-14 at 01:21

            How about this sample script? The flow of this sample is as follows.

            1. Retrieve access token using refresh token.
            2. Upload a file using access token.

            When you use this sample, please import filename, your client id, client secret and refresh token. The detail information is https://dev.onedrive.com/items/upload_put.htm.

            Sample script :

            Source https://stackoverflow.com/questions/45451819

            QUESTION

            Downloading files with Microsoft Graph using bash (curl)
            Asked 2017-May-11 at 03:39

            I try to download several files from OneDrive through Microsoft Graph.

            I am very close to achieve my goal. For the moment I have managed the token system (notably through Jay Lee detailed answer), and achieved to resolve the confusion that I made among the different endpoints that exist in Microsoft Graph (thank you Marc LaFleur - MSFT).

            Now I really work on the call of the API that would permit to download the files I want. This is how I proceeded:

            1- As I've seen in the Microsoft Graph Documentation, the normal syntax would be the following:

            curl -w %{time_total} https://graph.microsoft.com/v1.0/me/drive/items/01M...WU/content -H "Authorization: Bearer $access_token"

            2- However, this gives me a 302 request, which I can't handle in bash. So I looked for another solution and I found this Microsoft article explaining that:

            "To download files from OneDrive in a JavaScript app you cannot use the /content API, since this responds with a 302 redirect. A 302 redirect is explicitly prohibited when a CORS preflight is required, such as when providing the Authorization header.

            Instead, your app needs to select the @microsoft.graph.downloadUrl property, which returns the same URL that /content would have redirected to. This URL can then be requested directly using XMLHttpRequest. Because these URLs are pre-authenticated they can be retrieved without a CORS preflight request."

            It talks about Javascript but I think it can be applied to my case.

            3- So I tried this method and I wrote:

            curl "https://graph.microsoft.com/v1.0/me/drive/items/01MB...WU?select=id,@microsoft.graph.downloadUrl" -H "Authorization: Bearer $access_token"

            It gave me the URL that normally would permit me to finally download the file, but when I execute it, I get the following response:

            Code:

            curl "https://graph.microsoft.com/v1.0/$metadata#users('e967dd4d-680e-4a06-9bf7-468875e1a04c')/drive/items/$entity" -H "Authorization: Bearer $access_token" (it is exactly what I got with the previous request)

            Response:

            Any help? Why is it a bad request since I've put exactly what I got from the graph.microsoft.com request?

            ...

            ANSWER

            Answered 2017-May-11 at 03:39

            https://graph.microsoft.com/v1.0/$metadata#users('e967dd4d-680e-4a06-9bf7-468875e1a04c')/drive/items/$entity is the @odata.context annotation, which is not what you're after. You need to pull the URL out of the @microsoft.graph.downloadUrl annotation and use that to grab the file contents. The URL you're after should mention download.aspx in it.

            Source https://stackoverflow.com/questions/43875066

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install onedrive-api

            You can download it from GitHub.
            Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/oxalica/onedrive-api.git

          • CLI

            gh repo clone oxalica/onedrive-api

          • sshUrl

            git@github.com:oxalica/onedrive-api.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular REST Libraries

            public-apis

            by public-apis

            json-server

            by typicode

            iptv

            by iptv-org

            fastapi

            by tiangolo

            beego

            by beego

            Try Top Libraries by oxalica

            nil

            by oxalicaRust

            async-ffi

            by oxalicaRust

            async-lsp

            by oxalicaRust

            onedrive-fuse

            by oxalicaRust

            ccpy

            by oxalicaC++