ballerinax/dropbox Ballerina library

1.2.0

Overview

This is a generated connector for Dropbox API v2 OpenAPI specification.

Dropbox is a modern workspace designed to reduce busywork-so you can focus on the things that matter. Sign in and put your creative energy to work.

Prerequisites

Before using this connector in your Ballerina application, complete the following:

Quickstart

To use the Dropbox connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

First, import the ballerinax/dropbox module into the Ballerina project.

Copy
import ballerinax/dropbox;

Step 2: Create a new connector instance

Create a dropbox:ClientConfig with the <ACCESS_TOKEN> obtained, and initialize the connector with it.

Copy
dropbox:ClientConfig clientConfig = {
    auth : {
        token: `<ACCESS_TOKEN>`
    }
};

dropbox:Client baseClient = check new Client(clientConfig);

Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.

    Following is an example to copy files or folders using the connector.

    Copy
    public function main() {
        dropbox:RelocationArg payload = {
            from_path: "/root/Homework/math/math.json",
            to_path: "/root/Homework1/math",
            autorename: true
        };
    
        dropbox:RelocationResult|error result = baseClient->copyFileOrFolder(payload);
        if (result is dropbox:RelocationResult) {
            log:printInfo(result.toString());
        } else {
            log:printError(result.toString());
        }
    }
  2. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/dropbox;Copy

Metadata

Released date: about 2 years ago

Version: 1.2.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.0.0

GraalVM compatible: Yes


Pull count

Total: 1

Current verison: 0


Weekly downloads


Source repository


Keywords

Content & Files/File Management & Storage

Cost/Free


Contributors

Other versions