Web API Core | ComponentOne
In This Topic
    Configure OneDrive Web API Service
    In This Topic

    To configure OneDrive Web API Service and perform different operations, follow these steps:

    1. Configure Storage Connection String
    2. Register the Cloud Service
    3. Perform Operations

    Step 1: Configure Storage Connection String

    1. Register your app on OneDrive. For registering app, see Register your app.
    2. Generate an access token. For detailed information on how to obtain access token, see Supported Authentication flows.
    Back to Top

    Step 2: Register the Cloud Service

    1. Create a new C1 Web API Application and make sure the following references are added to the application:
      • C1.AspNetCore.Api.dll
      • C1.AspNetCore.Api.Cloud.dll
      • OneDrive.Api
    2. Register the OneDrive cloud service using the following code:
      Code
      Copy Code
      app.UseStorageProviders().AddOneDriveStorage("OneDrive", “your one drive AccessToken”);
      
    Back to Top

    Step 3: Perform Operations

    You can choose to perform various operations, such as listing data, uploading, deleting or downloading a file, after registering the cloud service. To understand how to perform these operations, see Perform Operations.

    Back to Top