Module boxapi

ballerinax/boxapi Ballerina library

0.1.1

Overview

Box Platform API connector consume the data exposed in https://api.box.com/2.0. It is currently supporting operations except metadata operations.

Configuring Connector

Prerequisites

  • Box platform account

Obtaining tokens

To utilize Box Platform API users have to login to the Box platform account given by Box platform, User can register for a new account if he/she doesn't have an account.

Authentication available.

  • OAuth Authentication

OAuth Authentication

If user have to use OAuth authentication, user should obtain bearer token

To obtain client credentials please follow these steps

  • Go to Box platform and login or register for a new account
  • Submit information in register form and complete login process
  • Navigate to developer console, create new app and get needed credentials
  • Create and obtain bearer token credentials and store somewhere securely

Then provide the obtained bearer token in client configuration.

Quickstart

Step 1: Import Box platform module

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

Copy
import ballerinax/boxapi;

Step 2: Add token you get in Config.toml.

Copy
[authConfig]
token = "<Enter your token here>"

Step 3: Configure the connection credentials.

Copy
configurable http:BearerTokenConfig & readonly authConfig = ?;
boxapi:ClientConfig clientConfig = {
    authConfig : authConfig
};

boxapi:Client baseClient = check new Client(clientConfig, serviceUrl = "https://api.box.com/2.0");

Step 4: Get file using ID

Copy
boxapi:File file = check baseClient->getFilesId("833080141230", "bal");

Snippets

Snippets of some operations.

Get file using ID

Copy
boxapi:File file = check baseClient->getFilesId("833080141230", "bal");

Get current user

Copy
boxapi:User useer = check baseClient->getUsersMe();

Import

import ballerinax/boxapi;Copy

Metadata

Released date: about 3 years ago

Version: 0.1.1

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: slalpha5

GraalVM compatible: Yes


Pull count

Total: 0

Current verison: 0


Weekly downloads


Source repository


Keywords

Box

File

Folder


Contributors

Other versions

0.1.1

0.1.0