18 releases (10 breaking)

0.10.0 Mar 23, 2024
0.9.0 Sep 13, 2022
0.8.1 Apr 29, 2021
0.7.0 Jan 19, 2021
0.1.0 Oct 22, 2018

#3 in #one-drive

Download history 5/week @ 2024-02-12 252/week @ 2024-02-19 43/week @ 2024-02-26 9/week @ 2024-03-04 22/week @ 2024-03-11 159/week @ 2024-03-18 40/week @ 2024-03-25 104/week @ 2024-04-01 53/week @ 2024-04-08 27/week @ 2024-04-15

246 downloads per month
Used in 3 crates

MIT license

115KB
2K SLoC

onedrive-api

Build Status crates.io Documentation

A non-official middle-level HTTP API bindings to the OneDrive REST API through Microsoft Graph, and also some utilities for authentication,

License


lib.rs:

onedrive-api

onedrive-api crate provides middle-level HTTP APIs OneDrive to the OneDrive API through Microsoft Graph, and also Auth with utilities for OAuth2.

Example

use onedrive_api::{OneDrive, FileName, DriveLocation, ItemLocation};
use reqwest::Client;

let client = Client::new();
let drive = OneDrive::new(
    "<...TOKEN...>", // Login token to Microsoft Graph.
    DriveLocation::me(),
);

let folder_item = drive
    .create_folder(
        ItemLocation::root(),
        FileName::new("test_folder").unwrap(),
    )
    .await?;

drive
    .upload_small(
        folder_item.id.as_ref().unwrap(),
        &b"Hello, world"[..],
    )
    .await?;

Features

  • beta

    Most of Microsoft APIs used in this crate are stable. But there are also some beta APIs, which are subject to change and is not suggested to be used in production application. Microsoft references of beta APIs usually contain a (beta) suffix in title.

    To avoid breakage, we put beta APIs and related resources under feature gate beta. They may change to follow Microsoft API references ANYTIME, and do NOT follow the semantic version of this crate.

    Be carefully using it and do NOT use it in production.

Dependencies

~4–18MB
~238K SLoC