> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Sign up for a Box free developer account, generate the developer token and make your first API call.

export const SignupCTA = ({children}) => {
  return <div className="flex flex-wrap items-center gap-4 p-5 rounded-lg border border-gray-200 dark:border-gray-700 my-6" style={{
    background: "linear-gradient(135deg, rgba(0, 97, 213, 0.06), rgba(0, 97, 213, 0.02))"
  }}>
      <div className="flex-1 text-sm leading-relaxed text-gray-700 dark:text-gray-300" style={{
    minWidth: "280px"
  }}>
        {children}
      </div>
      <div className="flex flex-col items-center gap-2">
        <a href="https://account.box.com/signup/developer#ty9l3" className="signup-cta-button inline-flex items-center whitespace-nowrap px-5 py-2 text-sm font-semibold text-white no-underline">
          {translate("Get started for free")}
        </a>
        <a href="https://account.box.com/developers/console" className="signup-cta-login text-xs text-gray-500 dark:text-gray-400 no-underline whitespace-nowrap">
          {translate("Already have an account? Log in")}
        </a>
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

[Box](https://www.box.com) is a cloud-based, intelligent content management and file sharing platform for storing, accessing, and collaborating on content from anywhere.

## Sign up for a free account

<SignupCTA>
  A free developer account gives you access to the Developer Console, APIs, and AI Units, for everything you need to follow along with developer guides.
</SignupCTA>

Confirm your email address to activate your developer account.

## Upload a file to Box and list all files in the root folder

The [Upload file](/reference/post-files-content) endpoint allows you to upload a single file to Box through the upload domain `https://upload.box.com/api/2.0/files/content`.

<Note>
  The maximum file size is 50MB. For larger files, use the <Link href="/guides/uploads/chunked">chunked upload APIs</Link>.
</Note>

A pre-built application using Client Credentials Grant (CCG) authentication is created for you to get started. This app is authorized automatically, so you don't need separate admin approval before making API calls.

Create a developer token to authenticate your requests. Go to the [Developer Console](https://cloud.app.box.com/developers/console) > your pre-built application and find the **App Details** section. Locate the **Developer Token** field, select **Generate Developer Token**, and copy it.

<img src="https://mintcdn.com/box/-dfq8BkD33WRZ8AY/images/guides/getting-started/app-details.png?fit=max&auto=format&n=-dfq8BkD33WRZ8AY&q=85&s=2050a97e6ad0a8cd51974da31d33a8c0" alt="App Details" width="344" height="372" data-path="images/guides/getting-started/app-details.png" />

<Warning>
  Developer tokens expire one hour after you generate them.
</Warning>

We prepared an example invoice document for you to upload. Create a root folder for your project, download the file <Link href="/static/quickstarts/extract/files/demo-invoice-20tax-2.pdf">here</Link>, and save it in the folder.

<Tabs>
  <Tab title="Python">
    Create and activate a Python virtual environment.

    ```shell theme={null}
    python3 -m venv .venv
    source .venv/bin/activate
    ```

    Install the Box Python SDK by running the following command using <Link href="https://pypi.org/project/pip/">pip</Link>.

    ```shell theme={null}
    pip install "boxsdk>=10"
    ```

    <Note>
      Make sure you use the most up-to-date version number of the Python SDK. Refer to the
      <Link href="https://pypi.org/project/boxsdk/">Python SDK Open Source page</Link>.
    </Note>

    Obtain a `client` with your developer token:

    ```python theme={null}
    from box_sdk_gen import BoxClient, BoxDeveloperTokenAuth, UploadFileAttributes, UploadFileAttributesParentField
    import json

    auth = BoxDeveloperTokenAuth(token="YOUR_DEVELOPER_TOKEN")
    client = BoxClient(auth=auth)
    ```

    <Warning>
      For production codebase, always store your credentials in a `.env` file and add `.env` to your `.gitignore`.
    </Warning>

    Then call the upload API as follows.

    ```python theme={null}
    with open("demo-invoice-20tax-2.pdf", "rb") as file_content_stream:
        uploaded_file = client.uploads.upload_file(
            UploadFileAttributes(
                name="demo-invoice-20tax-2.pdf",
                parent=UploadFileAttributesParentField(id="0"),
            ),
            file_content_stream,
        )

    items = client.folders.get_folder_items("0")
    print(json.dumps(items.to_dict(), indent=2))
    ```

    The `get_folder_items` command lists all files in the root folder. Execute the script to upload the file and list all files.
  </Tab>

  <Tab title="Node.js">
    Install the Box Node.js SDK by running the following command using <Link href="https://www.npmjs.com/package/box">npm</Link>. The [box](/guides/tooling/box-npm-package) package installs the Box Node SDK and the [Box CLI](/guides/cli) as direct dependencies. Node.js 22 or later is required.

    ```shell theme={null}
    npm install box
    ```

    <Info>
      Existing projects can keep using `npm install box-node-sdk` — that package is still supported.
    </Info>

    Import the SDK:

    ```javascript theme={null}
    import BoxSDK from 'box/sdk';  // ESM
    const BoxSDK = require('box/sdk');  // CommonJS
    ```

    A pre-built application is created for you to get started. Create a developer token to authenticate your requests. Go to the [Developer Console](https://cloud.app.box.com/developers/console) > your pre-built application and find the **App Details** section. Locate the **Developer Token** field, select **Generate Developer Token**, and copy it.

    Obtain a `client` with your developer token:

    ```javascript theme={null}
    const { BoxClient, BoxDeveloperTokenAuth } = require('box/sdk');
    const auth = new BoxDeveloperTokenAuth({ token: 'YOUR_DEVELOPER_TOKEN' });
    const client = new BoxClient({ auth });
    ```

    <Warning>
      Developer tokens expire one hour after you generate them.
    </Warning>

    ```javascript theme={null}
    const fs = require('fs');

    const attrs = { name: 'demo-invoice-20tax-2.pdf', parent: { id: '0' } };
    const body = {
      attributes: attrs,
      file: fs.createReadStream('demo-invoice-20tax-2.pdf'),
    };
    const files = await client.uploads.uploadFile(body);
    const file = files.entries[0];
    console.log(`File uploaded with id ${file.id}, name ${file.name}`);

    const items = await client.folders.getFolderItems('0');
    console.log(JSON.stringify(items, null, 2));
    ```

    The `getFolderItems` command lists all files in the root folder. Execute the script to upload the file and list all files.
  </Tab>

  <Tab title="Swift">
    Install the Box Swift SDK by running the following command using <Link href="https://github.com/box/box-swift-sdk-gen">Swift Package Manager</Link>.

    ```shell theme={null}
    swift package update
    ```

    A pre-built application is created for you to get started. Create a developer token to authenticate your requests. Go to the [Developer Console](https://cloud.app.box.com/developers/console) > your pre-built application and find the **App Details** section. Locate the **Developer Token** field, select **Generate Developer Token**, and copy it.

    <Warning>
      Developer tokens expire one hour after you generate them.
    </Warning>

    Obtain a `client` with your developer token:

    ```swift theme={null}
    import BoxSdkGen

    let auth = BoxDeveloperTokenAuth(token: "YOUR_DEVELOPER_TOKEN")
    let client = BoxClient(auth: auth)
    ```

    Create a request body with the required parameters: attributes (`name` and `parent id`) and a file stream.

    ```swift theme={null}
    guard let fileStream = InputStream(url: URL(fileURLWithPath: "demo-invoice-20tax-2.pdf")) else {
        fatalError("Could not read a file")
    }

    let requestBody = UploadFileRequestBody(
        attributes: UploadFileRequestBodyAttributesField(
            name: "demo-invoice-20tax-2.pdf",
            parent: UploadFileRequestBodyAttributesParentField(id: "0")
        ),
        file: fileStream
    )

    let files = try await client.uploads.uploadFile(requestBody: requestBody)

    if let file = files.entries?[0] {
        print("File uploaded with id \(file.id), name \(file.name!)")
    }

    let items = try await client.folders.getFolderItems(folderId: "0")
    if let entries = items.entries {
        for entry in entries {
            switch entry {
            case let .fileMini(file):
                print("file \(file.name!) [\(file.id)]")
            case let .folderMini(folder):
                print("folder \(folder.name!) [\(folder.id)]")
            case let .webLinkMini(webLink):
                print("webLink \(webLink.name!) [\(webLink.id)]")
            }
        }
    }
    ```

    The `getFolderItems` command lists all files in the root folder. Execute the script to upload the file and list all files.
  </Tab>

  <Tab title="Java">
    A pre-built application is created for you to get started. Create a developer token to authenticate your requests. Go to the [Developer Console](https://cloud.app.box.com/developers/console) > your pre-built application and find the **App Details** section. Locate the **Developer Token** field, select **Generate Developer Token**, and copy it.

    <Warning>
      Developer tokens expire one hour after you generate them.
    </Warning>

    **Gradle**

    Install the Box Java SDK by adding the following dependency to the `build.gradle` file.

    ```shell theme={null}
    implementation 'com.box:box-java-sdk:10.9.0'
    ```

    <Info>
      Make sure you use the most up-to-date version number of the Java SDK. Refer to the
      <Link href="https://opensource.box.com/box-java-sdk/">Java SDK Open Source page</Link>.
    </Info>

    **Maven**

    Then add the following to Maven dependency.

    ```xml theme={null}
    <dependency>
        <groupId>com.box</groupId>
        <artifactId>box-java-sdk</artifactId>
        <version>10.9.0</version>
    </dependency>
    ```

    Obtain a `client` with your developer token:

    ```java theme={null}
    BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("YOUR_DEVELOPER_TOKEN");
    BoxClient client = new BoxClient(auth);
    ```

    Pass **`new UploadFileRequestBody`** to **`client.getUploads().uploadFile`**: attributes (**`UploadFileRequestBodyAttributesField`** with name and **`UploadFileRequestBodyAttributesParentField`** for folder id) and an **`InputStream`** for the file bytes.

    ```java theme={null}
    FileInputStream fileContentStream = new FileInputStream("demo-invoice-20tax-2.pdf");
    client.getUploads().uploadFile(
        new UploadFileRequestBody(
            new UploadFileRequestBodyAttributesField(
                "demo-invoice-20tax-2.pdf",
                new UploadFileRequestBodyAttributesParentField("0")
            ),
            fileContentStream
        )
    );

    client.getFolders().getFolderItems("0").getEntries().forEach(item -> {
        System.out.println(item);
    });
    ```

    The `getFolderItems` command lists all files in the root folder. Execute the script to upload the file and list all files.
  </Tab>

  <Tab title=".NET">
    **.NET Framework**

    To install the .NET SDK in the .NET framework, run the following command using
    the <Link href="https://www.nuget.org/packages/Box.V2.Core">Nuget</Link> package manager.

    ```shell theme={null}
    PM> Install-Package Box.V2.Core
    ```

    A pre-built application is created for you to get started. Create a developer token to authenticate your requests. Go to the [Developer Console](https://cloud.app.box.com/developers/console) > your pre-built application and find the **App Details** section. Locate the **Developer Token** field, select **Generate Developer Token**, and copy it.

    <Warning>
      Developer tokens expire one hour after you generate them.
    </Warning>

    **.NET Core**

    To install the .NET SDK in the .NET Core framework, run the following command using
    the <Link href="https://www.nuget.org/packages/Box.V2.Core">Nuget</Link> package manager.

    ```shell theme={null}
    PM> Install-Package Box.V2.Core
    ```

    Obtain a `client` with your developer token:

    ```csharp theme={null}
    using Box.Sdk.Gen;

    var auth = new BoxDeveloperTokenAuth(token: "YOUR_DEVELOPER_TOKEN");
    var client = new BoxClient(auth: auth);
    ```

    Await **`client.Uploads.UploadFileAsync`** with **`new UploadFileRequestBody`**: **`UploadFileRequestBodyAttributesField`** (`name` and `parent id`) and a **`Stream`** (for example from **`File.OpenRead`**).

    ```csharp theme={null}
    using var fileContentStream = File.OpenRead("demo-invoice-20tax-2.pdf");
    var files = await client.Uploads.UploadFileAsync(
        requestBody: new UploadFileRequestBody(
            attributes: new UploadFileRequestBodyAttributesField(
                name: "demo-invoice-20tax-2.pdf",
                parent: new UploadFileRequestBodyAttributesParentField(id: "0")),
            file: fileContentStream));
    var file = files.Entries[0];
    Console.WriteLine($"File uploaded with id {file.Id}, name {file.Name}");

    var items = await client.Folders.GetFolderItemsAsync(folderId: "0");
    if (items.Entries != null)
    {
        foreach (var item in items.Entries)
        {
            if (item.FileFull != null)
            {
                Console.WriteLine(item.FileFull.Name);
            }
            else if (item.FolderMini != null)
            {
                Console.WriteLine(item.FolderMini.Name);
            }
            else if (item.WebLink != null)
            {
                Console.WriteLine(item.WebLink.Name);
            }
        }
    }
    ```

    The `getFolderItems` command lists all files in the root folder. Execute the script to upload the file and list all files.
  </Tab>
</Tabs>

Congratulations! You've uploaded your first file to Box and listed all files in the root folder.

## Use cases

Unsure if your use case is a good fit for Box? You're in the right place if:

* Content is in the center of your use case
* Your process involves moving content from one place to another
* Your workflow can abide by [waterfall permissions](https://docs.box.com/en/box-apps/box-apps-for-box-admins/box-apps-permissions#permissions)
* Your process involves administrative tasks that can be automated

Some common customer solutions include:

* Marketing asset management
* Secure document vaults
* Wealth management portals
* Automatic folder creation based on user provisioning
* Adding relevant metadata using machine learning
* Claim reviews with built-in approval/rejection flows
* Event monitoring for security and auditing

## What's next

Explore the following resources:

* [What a free developer plan offers](/guides/getting-started/free-developer-plan)
* [Authentication methods](/guides/authentication/select) to understand the different authentication methods available.
* [Box CLI](/guides/cli) to help you build your application.
* [Box glossary](/guides/getting-started/box-glossary) to understand the key concepts of Box for Developers.
* [Changelog](/changelog/) to stay up to date with the latest changes.
