Module box

ballerinax/box Ballerina library



This is a generated connector for Box Platform API v2.0.0 OpenAPI specification.

Box Platform provides functionality to provide access to content stored within Box. It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.


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

  • Create Box Platform Account by selecting the pricing plan
  • Obtaining tokens
    1. Go to Box Platform Account and log into the account
    2. Navigate to developer console, create new app and get needed credentials
    3. Create and obtain bearer token credentials and store somewhere securely


Step 1: Import connector

Import the ballerinax/box module into the Ballerina project.

import ballerinax/box;

Step 2: Create a new connector instance

configurable http:BearerTokenConfig & readonly auth = ?;
box:ClientConfig clientConfig = {
    auth : auth

box:Client baseClient = check new Client(clientConfig, serviceUrl = "");

Step 3: Invoke connector operation

  1. You can get a existing file by using getFilesId method.
    box:File file = check baseClient->getFilesId("833080141230", "bal");
  2. Use bal run command to compile and run the Ballerina program.