This service can be used to:
root: Set the work directory for this backend.access_token: set the access_token for this backend. Please notice its expiration.If you want to let OpenDAL to refresh the access token automatically, please provide the following fields:
refresh_token: set the refresh_token for dropbox apiclient_id: set the client_id for dropbox apiclient_secret: set the client_secret for dropbox apiOpenDAL is a library, it cannot do the first step of OAuth2 for you. You need to get authorization code from user by calling Dropbox's authorize url and exchange it for refresh token.
Please refer to Dropbox OAuth2 Guide for more information.
You can refer to [DropboxBuilder]'s docs for more information
use opendal_core::Operator; use opendal_core::Result; use opendal_service_dropbox::Dropbox; #[tokio::main] async fn main() -> Result<()> { let mut builder = Dropbox::default() .root("/opendal") .access_token("<token>"); let op: Operator = Operator::new(builder)?.finish(); Ok(()) }