### Start Automate Workflow Source: https://github.com/box/box-java-sdk/blob/main/docs/automateworkflows.md Initiates an Automate workflow manually. This requires the ID of the workflow action to start and a list of file IDs that the workflow should process. ```APIDOC ## Start Automate Workflow ### Description Starts an Automate workflow manually by using a workflow action ID and file IDs. ### Method This operation is performed by calling function `createAutomateWorkflowStartV2026R0`. ### Endpoint See the endpoint docs at [API Reference](https://developer.box.com/reference/v2.0/post-automate-workflows-id-start/). ### Arguments - workflowId `String` - The ID of the workflow. Example: "12345" - requestBody `AutomateWorkflowStartRequestV2026R0` - Request body of createAutomateWorkflowStartV2026R0 method - headers `CreateAutomateWorkflowStartV2026R0Headers` - Headers of createAutomateWorkflowStartV2026R0 method ### Returns This function returns a value of type `void`. Starts the workflow. ``` -------------------------------- ### Make Custom GET Request for Binary Response Source: https://github.com/box/box-java-sdk/blob/main/docs/client.md Use this to make a custom GET request when the expected response is binary data. It's crucial to set the `responseFormat` to `ResponseFormat.BINARY` in `FetchOptions`. ```java FetchOptions fetchOptions = new FetchOptions.Builder("https://upload.box.com/api/2.0/files/12345/content", "GET") .responseFormat(ResponseFormat.BINARY) .build(); FetchResponse response = client.makeRequest(fetchOptions); System.out.println("Status code: " + response.getStatus()); System.out.println("Response body: " + response.getContent()); ``` -------------------------------- ### Start Workflow Source: https://github.com/box/box-java-sdk/blob/main/docs/workflows.md Initiates a workflow that has a trigger type of WORKFLOW_MANUAL_START. Requires 'Manage Box Relay' scope. ```APIDOC ## POST /2.0/workflows/{workflow_id}/start ### Description Initiates a workflow with a trigger type of WORKFLOW_MANUAL_START. Requires 'Manage Box Relay' application scope. ### Method POST ### Endpoint /2.0/workflows/{workflow_id}/start ### Path Parameters - **workflow_id** (string) - Required - The ID of the workflow to start. ### Request Body - **type** (string) - Required - The type of the request body, must be 'workflow_parameters'. - **flow** (object) - Required - Information about the flow to start. - **type** (string) - Required - The type of the object, always 'flow'. - **id** (string) - Required - The ID of the flow. - **files** (array) - Required - A list of files to include in the workflow. - **type** (string) - Required - The type of the object, must be 'file'. - **id** (string) - Required - The ID of the file. - **folder** (object) - Required - Information about the folder containing the files. - **type** (string) - Required - The type of the object, must be 'folder'. - **id** (string) - Required - The ID of the folder. ### Request Example ```java adminClient.getWorkflows().startWorkflow(workflowToRun.getId(), new StartWorkflowRequestBody.Builder(new StartWorkflowRequestBodyFlowField.Builder(workflowToRun.getFlows().get(0).getId()).build(), Arrays.asList(new StartWorkflowRequestBodyFilesField.Builder(StartWorkflowRequestBodyFilesTypeField.FILE, workflowFileId).build()), new StartWorkflowRequestBodyFolderField.Builder(StartWorkflowRequestBodyFolderTypeField.FOLDER, workflowFolderId).build()).type(StartWorkflowRequestBodyTypeField.WORKFLOW_PARAMETERS).build()) ``` ### Response #### Success Response (200) This endpoint does not return a response body on success. #### Response Example (No response body) ``` -------------------------------- ### GET /zip/downloads/{download_id}/status Source: https://github.com/box/box-java-sdk/blob/main/docs/zipdownloads.md Returns the download status of a zip archive, including progress and skipped items. This endpoint is valid for 12 hours after the download starts. ```APIDOC ## GET /zip/downloads/{download_id}/status ### Description Returns the download status of a `zip` archive, allowing an application to inspect the progress of the download as well as the number of items that might have been skipped. This endpoint can only be accessed once the download has started. Subsequently this endpoint is valid for 12 hours from the start of the download. The URL of this endpoint should not be considered as fixed. Instead, use the [Create zip download](https://developer.box.com/reference/post-zip-downloads) API to request to create a `zip` archive, and then follow the `status_url` field in the response to this endpoint. ### Method GET ### Endpoint /zip/downloads/{download_id}/status ### Parameters #### Query Parameters - **statusUrl** (String) - Required - The URL that can be used to get the status of the `zip` archive being downloaded. Example: `https://dl.boxcloud.com/2.0/zip_downloads/29l00nfxDyHOt7RphI9zT_w==nDnZEDjY2S8iEWWCHEEiptFxwoWojjlibZjJ6geuE5xnXENDTPxzgbks_yY=/status` #### Request Body - **headers** (GetZipDownloadStatusHeaders) - Required - Headers of getZipDownloadStatus method ### Request Example ```java client.getZipDownloads().getZipDownloadStatus(zipDownload.getStatusUrl()) ``` ### Response #### Success Response (200) - **ZipDownloadStatus** (ZipDownloadStatus) - Returns the status of the `zip` archive that is being downloaded. #### Response Example { "downloaded_files": 100, "skipped_files": 5, "total_files": 105, "download_status": "in_progress" } ``` -------------------------------- ### Using Box SDK v5 with Both Packages Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-v4-to-v5.md Example demonstrating how to use both the manual `com.box.sdk` and the auto-generated `com.box.sdkgen` packages in a single Java application after migrating to Box Java SDK v5. It shows initializing connections and performing operations using both SDKs. ```java import com.box.sdk.BoxConfig; import com.box.sdk.BoxDeveloperEditionAPIConnection; import com.box.sdk.BoxFolder; import com.box.sdkgen.box.jwtauth.BoxJWTAuth; import com.box.sdkgen.box.jwtauth.JWTConfig; import com.box.sdkgen.client.BoxClient; import com.box.sdkgen.managers.folders.UpdateFolderByIdRequestBody; import com.box.sdkgen.schemas.folder.Folder; import java.io.FileReader; import java.io.Reader; public class Main { public static void main(String[] args) throws Exception { Reader reader = new FileReader("src/example/config/config.json"); BoxConfig boxConfig = BoxConfig.readFrom(reader); BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(boxConfig); JWTConfig config = JWTConfig.fromConfigFile("src/example/config/config.json"); BoxJWTAuth auth = new BoxJWTAuth(config); BoxClient client = new BoxClient(auth); BoxFolder rootFolder = new BoxFolder(api, "0"); BoxFolder.Info subfolder = rootFolder.createFolder("My Subfolder"); Folder updatedFolder = client.getFolders().updateFolderById( subfolder.getID(), new UpdateFolderByIdRequestBody.Builder().name("My Updated Subfolder").build() ); System.out.println("Created folder with ID " + subfolder.getID() + " has been updated to " + updatedFolder.getName()); } } ``` -------------------------------- ### Get Zip Download Status Source: https://github.com/box/box-java-sdk/blob/main/docs/zipdownloads.md Fetches the current status of a zip archive download, including progress and skipped items. This endpoint is accessible only after the download has started and is valid for 12 hours. Obtain the status URL from the 'Create zip download' response. ```java client.getZipDownloads().getZipDownloadStatus(zipDownload.getStatusUrl()) ``` -------------------------------- ### Authenticate with Developer Token and List Folder Items Source: https://github.com/box/box-java-sdk/blob/main/README.md This example demonstrates how to authenticate using a Developer Token and then retrieve and print the names of all items within the root folder. Ensure you have obtained a Developer Token from the Box Developer Console. ```java BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("DEVELOPER_TOKEN"); BoxClient client = new BoxClient(auth); client.folders.getFolderItems("0").getEntries().forEach(item -> { System.out.println(item.toString()); }); ``` -------------------------------- ### GET /sign-requests/{signRequestId} Source: https://github.com/box/box-java-sdk/blob/main/docs/signrequests.md Gets a sign request by ID. This operation is performed by calling the `getSignRequestById` function. ```APIDOC ## GET /sign-requests/{signRequestId} ### Description Gets a sign request by ID. ### Method GET ### Endpoint /sign-requests/{signRequestId} ### Parameters #### Path Parameters - **signRequestId** (String) - Required - The ID of the signature request. Example: "33243242" #### Headers - **headers** (GetSignRequestByIdHeaders) - Required - Headers of getSignRequestById method ### Request Example ```java client.getSignRequests().getSignRequestById(createdSignRequest.getId()) ``` ### Response #### Success Response (200) - **SignRequest** (SignRequest) - Description: Returns a signature request. #### Response Example ```json { "type": "sign_request", "id": "12345", "status": "sent" } ``` ``` -------------------------------- ### Create User (New SDKGen) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Shows how to create a new user with SDKGen by building a CreateUserRequestBody and calling the createUser method on the UserManager. ```java CreateUserRequestBody requestBody = new CreateUserRequestBody.Builder("John Doe").build(); UserFull user = client.users.createUser(requestBody); ``` -------------------------------- ### Get event stream Source: https://github.com/box/box-java-sdk/blob/main/docs/events.md Establishes a connection to get an event stream for the Box API. This is typically used for real-time event monitoring. ```APIDOC ## Get event stream ### Description Get an event stream for the Box API. This endpoint is used to establish a connection for receiving real-time event notifications. ### Method GET ### Endpoint /events/stream ### Parameters #### Query Parameters - **stream_type** (string) - Optional - Specifies the type of events to stream. Use `all_items` for user events or `admin_logs_streaming` for enterprise events. - **heartbeat_timeout** (integer) - Optional - The timeout in seconds for the heartbeat signal. #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```java client.getEvents().getEventStream() ``` ### Response #### Success Response (200) - **stream_type** (string) - The type of the event stream. - **expires_at** (string) - The expiration time of the event stream connection. - **max_retries** (integer) - The maximum number of retries allowed for the connection. #### Response Example ```json { "stream_type": "all_items", "expires_at": "2023-10-27T11:00:00Z", "max_retries": 5 } ``` ``` -------------------------------- ### Create Box User (Old SDK) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Demonstrates how to create a Box User object in the older com.box.sdk by first instantiating BoxUser with an API connection and user ID. ```java BoxUser user = new BoxUser(api, "12345"); ``` -------------------------------- ### Create Metadata Instance on File - Box Java SDK Source: https://github.com/box/box-java-sdk/blob/main/docs/filemetadata.md Applies a metadata template instance to a file. For 'global.properties', any key-value pair is accepted; otherwise, values must match the template. ```java client.getFileMetadata().createFileMetadataById(file.getId(), CreateFileMetadataByIdScope.ENTERPRISE, templateKey, mapOf(entryOf("name", "John"), entryOf("age", 23), entryOf("birthDate", "2001-01-03T02:20:50.520Z"), entryOf("countryCode", "US"), entryOf("sports", Arrays.asList("basketball", "tennis")))) ``` -------------------------------- ### Get AI agent by agent ID Source: https://github.com/box/box-java-sdk/blob/main/docs/aistudio.md Gets an AI Agent using the `agent_id` parameter. This operation is performed by calling the `getAiAgentById` function. ```APIDOC ## GET /ai/agents/:agent_id ### Description Gets an AI Agent using the `agent_id` parameter. ### Method GET ### Endpoint /ai/agents/:agent_id ### Parameters #### Path Parameters - **agentId** (String) - Required - The agent id to get. Example: "1234" #### Query Parameters - **queryParams** (GetAiAgentByIdQueryParams) - Required - Query parameters of getAiAgentById method - **headers** (GetAiAgentByIdHeaders) - Required - Headers of getAiAgentById method ### Response #### Success Response (200) - **AiSingleAgentResponseFull** - A successful response including the agent. ### Request Example ```java client.getAiStudio().getAiAgentById(createdAgent.getId(), new GetAiAgentByIdQueryParams.Builder().fields(Arrays.asList("ask")).build()) ``` ``` -------------------------------- ### Create Sign Request (Old SDK) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Example of a method signature from the old com.box.sdk for creating a sign request, showing numerous separate parameters. ```java public static BoxSignRequest.Info createSignRequest(BoxAPIConnection api, List sourceFiles, List signers, String parentFolderId, BoxSignRequestCreateParams optionalParams) ``` -------------------------------- ### List All Storage Policies Source: https://github.com/box/box-java-sdk/blob/main/docs/storagepolicies.md Fetches all storage policies in the enterprise. This method requires no arguments. ```java client.getStoragePolicies().getStoragePolicies() ``` -------------------------------- ### Get Shared Link for Folder Source: https://github.com/box/box-java-sdk/blob/main/docs/sharedlinksfolders.md Retrieves the shared link information for a specific folder. This endpoint allows you to get details about an existing shared link on a folder. ```APIDOC ## GET /folders/:folder_id ### Description Gets the information for a shared link on a folder. ### Method GET ### Endpoint /folders/:folder_id ### Parameters #### Path Parameters - **folder_id** (string) - Required - The unique identifier of the folder. #### Query Parameters - **fields** (string) - Optional - A comma-separated list of fields to include in the response. Use 'shared_link' to get shared link information. ### Request Example ```bash curl -X GET https://api.box.com/2.0/folders/12345?fields=shared_link \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200) - **type** (string) - The type of the resource, which will be 'folder'. - **id** (string) - The unique identifier for the folder. - **shared_link** (object) - Information about the shared link. - **url** (string) - The URL of the shared link. - **access** (string) - The access level of the shared link (e.g., 'open', 'company', 'collaborators'). #### Response Example ```json { "type": "folder", "id": "12345", "name": "Example Folder", "shared_link": { "url": "https://app.box.com/s/yoursharedlinkid", "access": "open" } } ``` ``` -------------------------------- ### Get File Thumbnail URL Source: https://github.com/box/box-java-sdk/blob/main/docs/files.md Get the download URL for a file's thumbnail without downloading the content. This is useful for displaying a placeholder while the thumbnail is being generated. ```APIDOC ## GET /files/{file_id}/thumbnail ### Description Get the download URL for a file's thumbnail without downloading the content. ### Method GET ### Endpoint /files/{file_id}/thumbnail ### Parameters #### Path Parameters - **file_id** (String) - Required - The unique identifier that represents a file. #### Query Parameters - **extension** (GetFileThumbnailUrlExtension) - Required - The file format for the thumbnail. Example: "png" - **queryParams** (GetFileThumbnailUrlQueryParams) - Optional - Query parameters for the request. - **headers** (GetFileThumbnailUrlHeaders) - Optional - Headers for the request. ### Request Example ```java client.getFiles().getFileThumbnailUrl(thumbnailFile.getId(), GetFileThumbnailUrlExtension.PNG) ``` ### Response #### Success Response (200) - **String** - The URL for the thumbnail. When a thumbnail can be created, the thumbnail data will be returned in the body of the response. Sometimes generating a thumbnail can take a few seconds. In these situations, the API returns a `Location`-header pointing to a placeholder graphic for this file type. The `Retry-After`-header indicates when the thumbnail will be ready. At that time, retry this endpoint to retrieve the thumbnail. ``` -------------------------------- ### Manually Construct Authorization URL (Old SDK) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md In the older `com.box.sdk` package, the authorization URL had to be manually constructed. This method is not recommended for new development. ```java String authorizationUrl = "https://account.box.com/api/oauth2/authorize?client_id=[CLIENT_ID]&response_type=code"; ``` -------------------------------- ### Immutable Client Instance (New SDKGen) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Demonstrates the immutable design of SDKGen by creating a new client instance with an added 'as user' header using the withAsUserHeader method. ```java BoxClient client = new BoxClient(auth); BoxClient asUserClient = client.withAsUserHeader("USER_ID"); ``` -------------------------------- ### GET /sign-requests Source: https://github.com/box/box-java-sdk/blob/main/docs/signrequests.md Gets signature requests created by a user. If the `sign_files` and/or `parent_folder` are deleted, the signature request will not return in the list. This operation is performed by calling the `getSignRequests` function. ```APIDOC ## GET /sign-requests ### Description Gets signature requests created by a user. If the `sign_files` and/or `parent_folder` are deleted, the signature request will not return in the list. ### Method GET ### Endpoint /sign-requests ### Parameters #### Query Parameters - **queryParams** (GetSignRequestsQueryParams) - Required - Query parameters of getSignRequests method #### Headers - **headers** (GetSignRequestsHeaders) - Required - Headers of getSignRequests method ### Request Example ```java client.getSignRequests().getSignRequests() ``` ### Response #### Success Response (200) - **SignRequests** (SignRequests) - Description: Returns a collection of sign requests. #### Response Example ```json { "total_count": 2, "entries": [ { "type": "sign_request", "id": "12345", "status": "completed" } ] } ``` ``` -------------------------------- ### Get Trashed File Source: https://github.com/box/box-java-sdk/blob/main/docs/trashedfiles.md Retrieves a file that has been moved to the trash. This API call can only retrieve files that have been moved to the trash directly. To list all trashed items, use the GET /folders/trash/items API. ```APIDOC ## GET /files/:file_id/trash ### Description Retrieves a file that has been moved to the trash. Please note that only if the file itself has been moved to the trash can it be retrieved with this API call. If instead one of its parent folders was moved to the trash, only that folder can be inspected using the GET /folders/:id/trash API. To list all items that have been moved to the trash, please use the GET /folders/trash/items API. ### Method GET ### Endpoint /files/:file_id/trash ### Parameters #### Path Parameters - **fileId** (String) - Required - The unique identifier that represents a file. Example: "12345" #### Query Parameters - **queryParams** (GetTrashedFileByIdQueryParams) - Required - Query parameters of getTrashedFileById method #### Headers - **headers** (GetTrashedFileByIdHeaders) - Required - Headers of getTrashedFileById method ### Request Example ```json { "example": "client.getTrashedFiles().getTrashedFileById(file.getId())" } ``` ### Response #### Success Response (200) - **file** (TrashFile) - Description: Returns the file that was trashed, including information about when the it was moved to the trash. #### Response Example ```json { "example": "TrashFile object" } ``` ``` -------------------------------- ### Create Metadata Instance on Folder Source: https://github.com/box/box-java-sdk/blob/main/docs/foldermetadata.md Applies a metadata template instance to a folder. For 'global.properties', any key-value pair is accepted. Enterprise configuration for 'Cascading Folder Level Metadata' may be required. ```java client.getFolderMetadata().createFolderMetadataById(folder.getId(), CreateFolderMetadataByIdScope.ENTERPRISE, templateKey, mapOf(entryOf("name", "John"), entryOf("age", 23), entryOf("birthDate", "2001-01-03T02:20:50.520Z"), entryOf("countryCode", "US"), entryOf("sports", Arrays.asList("basketball", "tennis")))) ``` -------------------------------- ### Create App User (Old SDK) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Shows the process of creating a new application user using the BoxUser.createAppUser method in the older com.box.sdk, followed by creating a BoxUser instance. ```java BoxUser.Info createdUserInfo = BoxUser.createAppUser(api, "A User"); BoxUser user = new BoxUser(api, createdUserInfo.getID()); ``` -------------------------------- ### Create Sign Request (New SDKGen) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Example of a method signature from the new com.box.sdkgen for creating a sign request, demonstrating aggregated parameters into request body and headers objects. ```java public SignRequest createSignRequest( SignRequestCreateRequest requestBody, CreateSignRequestHeaders headers) ``` -------------------------------- ### Get Shared Link for Web Link Source: https://github.com/box/box-java-sdk/blob/main/docs/sharedlinksweblinks.md Retrieves the shared link information for a specific web link. This operation allows you to get details about an existing shared link attached to a web link. ```APIDOC ## Get Shared Link for Web Link ### Description Gets the information for a shared link on a web link. ### Method GET ### Endpoint /web_links/{web_link_id}/shared_link ### Parameters #### Path Parameters - **web_link_id** (string) - Required - The ID of the web link. Example: "12345" #### Query Parameters - **fields** (string) - Optional - Comma-separated list of fields to include in the response. ### Request Example ```java client.getSharedLinksWebLinks().getSharedLinkForWebLink(webLinkId, new GetSharedLinkForWebLinkQueryParams("shared_link")) ``` ### Response #### Success Response (200) - **WebLink** (object) - The base representation of a web link with the additional shared link information. #### Response Example ```json { "type": "web_link", "id": "12345", "shared_link": { "url": "https://app.box.com/s/abcdef1234567890", "access": "open", "type": "shared_link" } } ``` ``` -------------------------------- ### Get Trashed Folder by ID Source: https://github.com/box/box-java-sdk/blob/main/docs/trashedfolders.md Retrieves a specific folder that has been moved to the trash. This method only works if the folder itself was trashed, not if a parent folder was trashed. Use the 'GET /folders/trash/items' API to list all trashed items. ```java client.getTrashedFolders().getTrashedFolderById(folder.getId()) ``` -------------------------------- ### JWT Authentication using Configuration File (New SDK) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Configure JWT authentication by reading from a JSON file using JWTConfig.fromConfigFile in the new SDK. A TokenStorage implementation is required. ```java TokenStorage tokenStorage = new InMemoryTokenStorage(); // or any other implementation of TokenStorage JWTConfig config = JWTConfig.fromConfigFile("src/example/config/config.json", tokenStorage); BoxJWTAuth auth = new BoxJWTAuth(config); BoxClient client = new BoxClient(auth); ``` -------------------------------- ### Initialize Box Client with Developer Token Source: https://github.com/box/box-java-sdk/blob/main/docs/authentication.md Use a developer token for quick testing. This token is short-lived, cannot be refreshed, and is tied to your account. Ensure the token is valid before constructing the BoxDeveloperTokenAuth object. ```java BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("YOUR-DEVELOPER-TOKEN"); BoxClient client = new BoxClient(auth); ``` -------------------------------- ### Make Custom GET Request with Fields Source: https://github.com/box/box-java-sdk/blob/main/docs/client.md Use this to make a custom GET request to the Box API, specifying query parameters like 'fields' to control the response data. Ensure the client is properly authenticated. ```java FetchOptions fetchOptions = new FetchOptions.Builder("https://api.box.com/2.0/users/me", "GET") .params(new HashMap<>() { { put("fields", "name"); } }) .build(); FetchResponse response = client.makeRequest(fetchOptions); System.out.println("Status code: " + response.getStatus()); System.out.println("Response body: " + response.getContent()); ``` -------------------------------- ### Get task Source: https://github.com/box/box-java-sdk/blob/main/docs/tasks.md Retrieves information about a specific task. ```APIDOC ## GET /tasks/{task_id} ### Description Retrieves information about a specific task. ### Method GET ### Endpoint /tasks/{task_id} ### Parameters #### Path Parameters - **task_id** (String) - Required - The ID of the task. #### Query Parameters None #### Request Body None ### Request Example ```java client.getTasks().getTaskById(task.getId()) ``` ### Response #### Success Response (200) - **task** (Task) - Returns a task object. #### Response Example ```json { "type": "task", "id": "98765", "item": { "type": "file", "id": "67890" }, "message": "test message", "created_by": { "type": "user", "id": "11111" }, "assigned_to": { "type": "user", "id": "22222" }, "completion_rule": "ALL_ASSIGNEES", "action": "review", "created_at": "2023-01-02T10:00:00Z", "updated_at": "2023-01-02T10:00:00Z", "due_at": "2023-01-15T12:00:00Z" } ``` ``` -------------------------------- ### Create a Web Link Source: https://github.com/box/box-java-sdk/blob/main/docs/weblinks.md Use this to create a new web link within a folder. Requires URL, parent folder ID, and optionally a name, description. ```java client.getWebLinks().createWebLink(new CreateWebLinkRequestBody.Builder(url, new CreateWebLinkRequestBodyParentField(parent.getId())).name(name).description(description).build()) ``` -------------------------------- ### GET /box/hub/collaborations Source: https://github.com/box/box-java-sdk/blob/main/docs/hubcollaborations.md Retrieves all collaborations for a Box Hub. ```APIDOC ## GET /box/hub/collaborations ### Description Retrieves all collaborations for a Box Hub. ### Method GET ### Endpoint /box/hub/collaborations ### Parameters #### Query Parameters - **hub.id** (string) - Required - The ID of the hub. ### Request Example ```java client.getHubCollaborations().getHubCollaborationsV2025R0(new GetHubCollaborationsV2025R0QueryParams(hub.getId())) ``` ### Response #### Success Response (200) - **collaborations** (array) - A list of HubCollaborationsV2025R0 objects. #### Response Example ```json { "collaborations": [ { "type": "collaboration", "id": "12345", "user": { "type": "user", "id": "67890", "name": "John Doe" }, "role": "viewer" } ] } ``` ``` -------------------------------- ### Update User Info (Old SDK) Source: https://github.com/box/box-java-sdk/blob/main/migration-guides/from-com-box-sdk-to-com-box-sdkgen.md Illustrates how to update user information using the older com.box.sdk by creating an Info object, modifying it, and then calling updateUser. ```java BoxUser.Info info = user.new Info(); info.setName(name); user.updateInfo(info); ``` -------------------------------- ### GET /web_links/{webLinkId} Source: https://github.com/box/box-java-sdk/blob/main/docs/weblinks.md Retrieve information about a web link. ```APIDOC ## GET /web_links/{webLinkId} ### Description Retrieve information about a web link. ### Method GET ### Endpoint /web_links/{webLinkId} ### Parameters #### Path Parameters - **webLinkId** (String) - Required - The ID of the web link. Example: "12345" #### Query Parameters - **headers** (GetWebLinkByIdHeaders) - Required - Headers of getWebLinkById method ### Request Example ```java client.getWebLinks().getWebLinkById(weblink.getId()) ``` ### Response #### Success Response (200) - **WebLink** (WebLink) - Returns the web link object. #### Response Example ```json { "example": "WebLink object" } ``` ``` -------------------------------- ### GET /hub/items Source: https://github.com/box/box-java-sdk/blob/main/docs/hubitems.md Retrieves all items associated with a Box Hub. ```APIDOC ## GET /hub/items ### Description Retrieves all items associated with a Box Hub. ### Method GET ### Endpoint /hub/items ### Parameters #### Query Parameters - **queryParams** (GetHubItemsV2025R0QueryParams) - Required - Query parameters of getHubItemsV2025R0 method - **headers** (GetHubItemsV2025R0Headers) - Required - Headers of getHubItemsV2025R0 method ### Request Example ```java client.getHubItems().getHubItemsV2025R0(new GetHubItemsV2025R0QueryParams(createdHub.getId())) ``` ### Response #### Success Response (200) - **HubItemsV2025R0** - The response object containing hub items. #### Response Example ```json { "example": "HubItemsV2025R0" } ``` ``` -------------------------------- ### Create a Folder - Java Source: https://github.com/box/box-java-sdk/blob/main/docs/folders.md Creates a new, empty folder within a specified parent folder. The root folder ID is '0'. ```java client.getFolders().createFolder(new CreateFolderRequestBody(newFolderName, new CreateFolderRequestBodyParentField("0"))) ``` -------------------------------- ### Create Metadata Instance on File Source: https://github.com/box/box-java-sdk/blob/main/docs/filemetadata.md Applies an instance of a metadata template to a file. This operation is performed by calling the `createFileMetadataById` function. ```APIDOC ## POST /files/{file_id}/metadata/{scope}/{template_key} ### Description Applies an instance of a metadata template to a file. In most cases only values that are present in the metadata template will be accepted, except for the `global.properties` template which accepts any key-value pair. ### Method POST ### Endpoint /files/{file_id}/metadata/{scope}/{template_key} ### Parameters #### Path Parameters - **file_id** (String) - Required - The unique identifier that represents a file. Example: "12345" - **scope** (CreateFileMetadataByIdScope) - Required - The scope of the metadata template. Example: "global" - **template_key** (String) - Required - The name of the metadata template. Example: "properties" #### Query Parameters - **headers** (CreateFileMetadataByIdHeaders) - Optional - Headers for the request. #### Request Body - **requestBody** (Map) - Required - Request body containing key-value pairs for the metadata. ### Request Example ```java client.getFileMetadata().createFileMetadataById(file.getId(), CreateFileMetadataByIdScope.ENTERPRISE, templateKey, mapOf(entryOf("name", "John"), entryOf("age", 23), entryOf("birthDate", "2001-01-03T02:20:50.520Z"), entryOf("countryCode", "US"), entryOf("sports", Arrays.asList("basketball", "tennis")))) ``` ### Response #### Success Response (200) - **MetadataFull** - Returns the instance of the template that was applied to the file, including the data that was applied to the template. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Task Assignment Source: https://github.com/box/box-java-sdk/blob/main/docs/taskassignments.md Retrieves information about a specific task assignment. ```APIDOC ## GET /task_assignments/{taskAssignmentId} ### Description Retrieves information about a task assignment. ### Method GET ### Endpoint /task_assignments/:taskAssignmentId ### Parameters #### Path Parameters - **taskAssignmentId** (String) - Required - The ID of the task assignment. #### Query Parameters - **headers** (GetTaskAssignmentByIdHeaders) - Required - Headers of getTaskAssignmentById method ### Response #### Success Response (200) - **TaskAssignment** - Returns a task assignment, specifying who the task has been assigned to and by whom. ### Request Example ```java client.getTaskAssignments().getTaskAssignmentById(taskAssignment.getId()) ``` ### Response Example ```json { "type": "task_assignment", "id": "98765", "task": { "type": "task", "id": "12345" }, "assigned_to": { "type": "user", "id": "67890", "name": "Alice Wonderland" }, "assigned_by": { "type": "user", "id": "11223", "name": "Bob The Builder" }, "created_at": "2023-01-02T10:00:00Z", "message": "Please complete this task." } ``` ``` -------------------------------- ### Create a Task on a File Source: https://github.com/box/box-java-sdk/blob/main/docs/tasks.md Creates a new task on a file. The task is initially unassigned. You must provide the file ID, an action (e.g., REVIEW), a message, and a completion rule. ```java client.getTasks().createTask(new CreateTaskRequestBody.Builder(new CreateTaskRequestBodyItemField.Builder().id(file.getId()).type(CreateTaskRequestBodyItemTypeField.FILE).build()).action(CreateTaskRequestBodyActionField.REVIEW).message("test message").dueAt(dateTime).completionRule(CreateTaskRequestBodyCompletionRuleField.ALL_ASSIGNEES).build()) ``` -------------------------------- ### Get storage policy Source: https://github.com/box/box-java-sdk/blob/main/docs/storagepolicies.md Fetches a specific storage policy by its ID. ```APIDOC ## GET /storage_policies/:storage_policy_id ### Description Fetches a specific storage policy by its ID. ### Method GET ### Endpoint /storage_policies/:storage_policy_id ### Path Parameters - **storage_policy_id** (String) - Required - The ID of the storage policy to retrieve. Example: "34342" ### Query Parameters - **headers** (GetStoragePolicyByIdHeaders) - Optional - Headers for the request. ### Response #### Success Response (200) - **StoragePolicy** - A storage policy object. ### Response Example ```json { "type": "storage_policy", "id": "34342", "enterprise": { "type": "enterprise", "id": "67890", "name": "Example Enterprise" }, "is_default": false, "name": "Custom Policy" } ``` ``` -------------------------------- ### GET /shield-information-barrier-segments Source: https://github.com/box/box-java-sdk/blob/main/docs/shieldinformationbarriersegments.md Retrieves a list of shield information barrier segments. ```APIDOC ## GET /shield-information-barrier-segments ### Description Retrieves a list of shield information barrier segment objects for the specified Information Barrier ID. ### Method GET ### Endpoint /shield-information-barrier-segments ### Parameters #### Path Parameters None #### Query Parameters - **barrier_id** (String) - Required - The ID of the Information Barrier. #### Request Body None ### Request Example ```java client.getShieldInformationBarrierSegments().getShieldInformationBarrierSegments(new GetShieldInformationBarrierSegmentsQueryParams(barrierId)) ``` ### Response #### Success Response (200) - **ShieldInformationBarrierSegments** (Object) - Returns a paginated list of shield information barrier segment objects. #### Response Example ```json { "total_count": 2, "entries": [ { "id": "12345", "type": "shield_information_barrier_segment", "name": "Segment 1", "description": "Description 1" }, { "id": "67890", "type": "shield_information_barrier_segment", "name": "Segment 2", "description": "Description 2" } ] } ``` ``` -------------------------------- ### List all file versions Source: https://github.com/box/box-java-sdk/blob/main/docs/fileversions.md Retrieve a list of past versions for a file. This requires a premium Box account. Use this when you need to access or manage historical states of a file. ```java client.getFileVersions().getFileVersions(file.getId()) ``` -------------------------------- ### Create Metadata Instance on Folder Source: https://github.com/box/box-java-sdk/blob/main/docs/foldermetadata.md Applies an instance of a metadata template to a folder. This operation may have restrictions on accepted key-value pairs depending on the template. ```APIDOC ## POST /folders/{folder_id}/metadata/{scope}/{template_key} ### Description Applies an instance of a metadata template to a folder. In most cases, only values present in the metadata template will be accepted, except for the `global.properties` template which accepts any key-value pair. ### Method POST ### Endpoint /folders/{folder_id}/metadata/{scope}/{template_key} ### Parameters #### Path Parameters - **folder_id** (String) - Required - The unique identifier that represents a folder. Example: "12345" - **scope** (CreateFolderMetadataByIdScope) - Required - The scope of the metadata template. Example: "global" - **template_key** (String) - Required - The name of the metadata template. Example: "properties" #### Request Body - **requestBody** (Map) - Required - Request body containing key-value pairs for the metadata instance. #### Query Parameters - **headers** (CreateFolderMetadataByIdHeaders) - Optional - Headers for the request. ### Request Example ```json { "example": { "name": "John", "age": 23, "birthDate": "2001-01-03T02:20:50.520Z", "countryCode": "US", "sports": ["basketball", "tennis"] } } ``` ### Response #### Success Response (200) - **metadataFull** (MetadataFull) - Returns the instance of the template that was applied to the folder, including the data. ### Response Example ```json { "example": "MetadataFull object" } ``` ``` -------------------------------- ### Get Retention Policy Assignment Source: https://github.com/box/box-java-sdk/blob/main/docs/retentionpolicyassignments.md Retrieves a retention policy assignment. ```APIDOC ## GET /retention_policy_assignments/:retention_policy_assignment_id ### Description Retrieves a retention policy assignment. ### Method GET ### Endpoint /retention_policy_assignments/:retention_policy_assignment_id ### Parameters #### Path Parameters - **retention_policy_assignment_id** (String) - Required - The ID of the retention policy assignment. #### Query Parameters - **fields** (String) - Optional - A comma-separated list of fields to include in the response. ### Response #### Success Response (200) - **id** (String) - The ID of the retention policy assignment. - **type** (String) - The type of the object. - **retention_policy** (Object) - The retention policy associated with the assignment. - **id** (String) - The ID of the retention policy. - **type** (String) - The type of the object. - **assigned_to** (Object) - The item to which the retention policy is assigned. - **id** (String) - The ID of the item. - **type** (String) - The type of the item. - **assigned_by** (Object) - The user who assigned the retention policy. - **id** (String) - The ID of the user. - **type** (String) - The type of the object. - **assigned_at** (String) - The date and time when the retention policy was assigned. ### Request Example ```java client.getRetentionPolicyAssignments().getRetentionPolicyAssignmentById(retentionPolicyAssignment.getId()) ``` ### Response Example ```json { "id": "12345", "type": "retention_assignment", "retention_policy": { "id": "98765", "type": "retention_policy" }, "assigned_to": { "id": "67890", "type": "folder" }, "assigned_by": { "id": "11111", "type": "user" }, "assigned_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Get Retention Policy Source: https://github.com/box/box-java-sdk/blob/main/docs/retentionpolicies.md Retrieves a specific retention policy by its ID. ```APIDOC ## GET /retentionPolicies/{retentionPolicyId} ### Description Retrieves a retention policy. ### Method GET ### Endpoint /retentionPolicies/{retentionPolicyId} ### Parameters #### Path Parameters - **retentionPolicyId** (String) - Required - The ID of the retention policy. Example: "982312" #### Query Parameters - **queryParams** (GetRetentionPolicyByIdQueryParams) - Required - Query parameters of getRetentionPolicyById method - **headers** (GetRetentionPolicyByIdHeaders) - Required - Headers of getRetentionPolicyById method ### Response #### Success Response (200) - **RetentionPolicy** (RetentionPolicy) - Returns the retention policy object. ### Request Example ```java client.getRetentionPolicies().getRetentionPolicyById(retentionPolicy.getId()) ``` ``` -------------------------------- ### Create Terms of Service Status for User Source: https://github.com/box/box-java-sdk/blob/main/docs/termsofserviceuserstatuses.md Sets the terms of service acceptance status for a user. Requires the terms of service ID, user ID, and acceptance status. ```java client.getTermsOfServiceUserStatuses().createTermsOfServiceStatusForUser(new CreateTermsOfServiceStatusForUserRequestBody(new CreateTermsOfServiceStatusForUserRequestBodyTosField(tos.getId()), new CreateTermsOfServiceStatusForUserRequestBodyUserField(user.getId()), false)) ``` -------------------------------- ### Get Watermark for Folder Source: https://github.com/box/box-java-sdk/blob/main/docs/folderwatermarks.md Retrieves the watermark configuration for a specified folder. ```APIDOC ## GET /folders/{folder_id}/watermark ### Description Retrieve the watermark for a folder. ### Method GET ### Endpoint /folders/{folder_id}/watermark ### Parameters #### Path Parameters - **folderId** (String) - Required - The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. The root folder of a Box account is always represented by the ID `0`. Example: "12345" #### Query Parameters None #### Request Body None ### Request Example ```java client.getFolderWatermarks().getFolderWatermark(folder.getId()) ``` ### Response #### Success Response (200) - **Watermark** - An object containing information about the watermark associated with the folder. #### Response Example ```json { "imprint": "default" } ``` ``` -------------------------------- ### Start Automate Workflow V2026.0 Source: https://github.com/box/box-java-sdk/blob/main/docs/automateworkflows.md Initiates a specific Automate workflow using its action ID and associated file IDs. Ensure the workflow action and file IDs are correctly provided. ```java adminClient.getAutomateWorkflows().createAutomateWorkflowStartV2026R0(workflowAction.getWorkflow().getId(), new AutomateWorkflowStartRequestV2026R0(workflowAction.getId(), Arrays.asList(workflowFileId))) ``` -------------------------------- ### GET /folders/:id/metadata/enterprise/securityClassification-6VMVochwUWo Source: https://github.com/box/box-java-sdk/blob/main/docs/folderclassifications.md Retrieves the classification metadata applied to a folder. ```APIDOC ## GET /folders/:id/metadata/enterprise/securityClassification-6VMVochwUWo ### Description Retrieves the classification metadata instance that has been applied to a folder. This API can also be called by including the enterprise ID in the URL explicitly, for example `/folders/:id/enterprise_12345/securityClassification-6VMVochwUWo`. ### Method GET ### Endpoint /folders/:id/metadata/enterprise/securityClassification-6VMVochwUWo ### Parameters #### Path Parameters - **folderId** (String) - Required - The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. The root folder of a Box account is always represented by the ID `0`. Example: "12345" #### Query Parameters None #### Request Body None ### Request Example ```java client.getFolderClassifications().getClassificationOnFolder(folder.getId()) ``` ### Response #### Success Response (200) - **securityClassification** (Object) - Returns an instance of the `securityClassification` metadata template, which contains a `Box__Security__Classification__Key` field that lists all the classifications available to this enterprise. #### Response Example ```json { "type": "folder", "id": "12345", "sequence_id": "1", "etag": "1", "name": "Example Folder", "metadata": { "enterprise": { "securityClassification": { "Box__Security__Classification__Key": "Internal" } } } } ``` ```