Skip to main content
This topic describes what storage is, the capabilities of the Storage APIs, and the related resources.

What is storage

The Storage APIs provide an intelligent and secure data management solution for organizations and meet the needs of office collaboration scenarios centered around file storage. Core capabilities include but are not limited to file upload, download, management, and transfer, online preview and editing of mainstream file formats, and permission management. You can use the Storage APIs to build everything from simple app attachments to fully featured cloud drive products. After your app integrates the Storage APIs, you can:
  • Transfer files efficiently between your app and other DingTalk apps.
  • Meet the file governance needs of Organization Admins. For more information, see DingTalk admin console.

Open capability overview

Storage exposes a rich set of open API capabilities. Developers can integrate storage with their organization’s business systems through API calls.

Organization management

APIDescriptionAPI version
Obtain organization informationObtains information about the organization’s storage.New

App

APIDescriptionAPI version
Obtain group storage space informationObtains information about a group storage space.New
Send a storage file to a specified user as the appSends a file to a specified user as the app identity.New
Send a file to a specified chatSends a file to a specified chat.New
Send a file link to a specified chatSends a file link to a specified chat.New
Obtain app informationObtains information about the current app.New

Space management

APIDescriptionAPI version
Add a spaceAdds a new space within the organization’s storage.New
Obtain space informationObtains information about a storage space.New

File management

APIDescriptionAPI version
Add a folderAdds a folder within a storage space.New
Copy a file or folderCopies a file or folder.New
Copy files or folders in bulkCopies files or folders in bulk.New
Move a file or folderMoves the location of a file or folder.New
Move files or folders in bulkMoves files or folders in bulk.New
Rename a file or folderRenames a file or folder.New
Delete a file or folderDeletes a file or folder.New
Delete files or folders in bulkDeletes files or folders in bulk.New
Restore a previous version of a fileRestores a previous version of a file.New
Obtain the file version listObtains the version list of a file.New
Obtain file or folder informationObtains information about a file or folder.New
Obtain file or folder information in bulkObtains information about files or folders in bulk.New
Obtain the file or folder listObtains the list of files or folders within a space.New
Obtain the list of all files or folders under a spaceObtains a flattened list of all files or folders under a space.New
Obtain file preview or editing informationObtains the preview or editing link of a file.New
Update the app attributes of a file or folderUpdates the app attributes of a file or folder.New
Delete the app attributes of a file or folderDeletes the app attributes of a file or folder.New
Obtain file thumbnails in bulkObtains thumbnail information of files in bulk.New

File transfer

APIDescriptionAPI version
Obtain file upload informationObtains file upload information.New
Submit a fileSubmits a file to complete the upload.New
Initialize a multipart uploadInitializes a multipart upload of a file.New
Obtain multipart upload informationObtains the upload information for each part after a file is split.New
Obtain file download informationObtains download information of a file in a storage space.New

Permission management

APIDescriptionAPI version
Add permissionsAdds permissions to a storage space.New
Delete permissionsDeletes permissions from a storage space.New
Modify permissionsModifies the permissions of a storage space.New
Obtain the permission listObtains the permission list of a storage space.New
Set the permission inheritance modeSets the permission inheritance mode based on the file uuid, the operator’s unionId, and the inheritance mode.New
Obtain the permission inheritance modeObtains the permission inheritance mode based on the file uuid and the operator’s unionId.New

Recycle Bin management

APIDescriptionAPI version
Obtain Recycle Bin informationObtains information about the Recycle Bin.New
Obtain the recycle item listObtains the list of recycle items in the Recycle Bin.New
Obtain recycle item informationObtains information about a recycle item.New
Restore a recycle itemRestores a recycle item.New
Restore recycle items in bulkRestores recycle items in bulk.New
Delete a recycle itemDeletes a recycle item from the Recycle Bin.New
Delete recycle items in bulkDeletes recycle items in the Recycle Bin in bulk.New
Empty the Recycle BinEmpties the Recycle Bin based on its ID.New

Task management

APIDescriptionAPI version
Obtain asynchronous task information in storageObtains information about asynchronous tasks in storage.New

Event subscription

APIDescriptionAPI version
Subscribe to file change eventsSubscribes to storage file change events.New
Unsubscribe from file change eventsUnsubscribes from storage file change events.New

Tutorials

DingTalk provides integration flow examples for the Storage APIs.
TutorialDescriptionAudienceDemo download
Upload, preview, and download Drive filesUpload, download, and preview Drive files.All DingTalk developersfile-demo.zip
Upload local files to DingTalk Docs (My Docs)Upload local files to the My Docs directory in DingTalk Docs.All DingTalk developersdoc-demo.zip

Resource reference

  • The Space resource includes the following attributes:
    AttributeTypeDescription
    spaceIdstringThe space ID.
    spaceNamestringThe space name.
    spaceTypestringThe space type. - USER: user space - APP: app space
    quotaint64The total capacity of the space. Note A value of -1 indicates that the space has no quota limit. If the space has an organization attribute, the quota cannot exceed the organization’s space quota.
    usedQuotaint64The used capacity of the space.
    createTimestring (iso8601)The created time.
    modifyTimestring (iso8601)The modified time.
  • The File and folder resource includes the following attributes:
    AttributeTypeDescription
    idstringThe ID of the file or folder.
    spaceIdstringThe space ID.
    pathstringThe path of the file or folder within the space.
    statusstringThe status. - NORMAL: normal - DELETED: deleted - EXPIRED: expired
    partitionTypestringThe storage partition. - PUBLIC_OSS_PARTITION: public cloud OSS storage partition - MINI_OSS_PARTITION: dedicated MiniOSS storage partition
    parentIdstringThe parent folder ID.
    fileTypestringThe file type. - FILE: file - FOLDER: folder
    extensionstringThe file name extension.
  • The Permission resource includes the following attributes:
    AttributeTypeDescription
    idstringThe ID of the permission user. - If the type parameter is ORG, set this parameter to the organization’s corpId. - If the type parameter is DEPT, set this parameter to the deptId of the department. Call the Obtain the department list API to obtain the dept_id value. - If the type parameter is TAG, set this parameter to the tag name. - If the type parameter is CONVERSATION, set this parameter to the openConversationId of the chat, which is obtained through the create group chat API or the create scenario group API. - If the type parameter is USER, set this parameter to the user’s unionId. Call the Query user details API to obtain the unionid value.
    roleIdstringThe permission role ID. - OWNER: owner - MANAGER: manager - EDITOR: editor - DOWNLOADER: downloader - READER: viewer
    typestringThe permission user type: - ORG: organization - DEPT: department - TAG: custom tag - CONVERSATION: chat - USER: user
    durationstringThe authorization validity period, in seconds. The default value is -1, which indicates permanent validity. - The authorization validity period takes effect when the space type of the granted permission is APP. - The authorization validity period does not take effect when the space type of the granted permission is USER, and defaults to permanent validity.