All Products
Search
Document Center

Drive and Photo Service:v1.x

Last Updated:Dec 22, 2025

Drive and Photo Service (PDS) Developer Edition provides an SDK for JavaScript. PDS SDK for JavaScript v1.x supports features such as file storage, management, and sharing. The SDK provides developers with abundant API operations. This topic gives an overview of the child topics that guide you in efficient file operations and data management.

Child topic

Description

Getting started

PDS SDK for Javascript is an official tool that supports file operations and management of resources such as drives, shares, and groups. It is suitable for the browser and Node.js environments. After you install the SDK by using npm, you can easily integrate the SDK into your Vue, React, or Node.js projects to access the various API operations of PDS.

Use the PDSClient class

The PDSClient class is the core of PDS SDK for Javascript. It allows you to create instances, in which you can call all API operations of PDS. To use the class, you need to configure parameters such as the token information and API endpoint. The class provides the methods for configuring tokens and share tokens and the method for initiating underlying API calls, and allows event listeners such as error handling listener.

Obtain an access token

The SDK provides multiple ways for to obtain tokens, including JSON Web Token (JWT)-based access, account-based token acquisition, and token refreshing.

Upload a file

The SDK provides different methods to upload files, including convenient upload and creation of upload tasks, and supports progress monitoring and status management for file upload.

Download a file

The SDK allows you to download a file by calling the downloadFile or createDownloadTask method, and supports download progress monitoring and resumable download.

Drives

PDS SDK for JavaScript supports the basic create, read, update, and delete (CRUD) operations, such as obtaining space quota, creating, updating, and deleting drives, and querying drives and their details.

File operations

The SDK supports various file-related operations, including listing directories, searching for files, querying file information, obtaining a file download URL, saving file content, obtaining file content, renaming a file, updating file information, obtaining file information based on a path, obtaining breadcrumb directory information, creating a directory, deleting a file, batch deleting files, copying a file, and moving a file. By performing these operations, you can manage files and folders in ways that are suitable for different scenarios.

Manage the recycle bin

The SDK allows you to manage the recycle bin. You can clear the recycle bin or batch restore files in the recycle bin.

Manage permissions on files

The SDK allows you to manage permissions on files. You can query the list of shared files, query information about received shared files, add or remove file permissions, and list file permissions. You can also manage file sharing.

Share links

The SDK allows you to manage share links. You can create a share link, cancel sharing, list share links, and anonymously obtain sharing information and tokens. This facilitates file sharing and permission control.

Manage users

The SDK allows you to manage users. You can create, query, update, and delete users, as well as search for and list users.

Manage groups and members

The SDK allows you to manage groups and members. You can create, delete, and update groups, query group information, search for groups, and manage group members.

Manage role assignments

The SDK allows you to manage role assignments. You can assign and cancel the roles of team administrators and query the list of assigned roles.