workspaceIds, option, and withPermissionRole.
Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v2.0/wiki/workspaces/batchQuery |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permission | permission-Wiki.Workspace.Read-Knowledge Base read permission |
Request header
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential used to call this API. Obtain it as follows: - For an internal app, call the Get the access token of an internal app API. - For a third-party enterprise app, call the Get the access token of an organization authorized to a third-party app API. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| workspaceIds | Array of String | Yes | The Knowledge Base IDs. Call the Get the Knowledge Base list API and obtain the value of the workspaceId field from the response. The maximum size is 20. |
| option | Object | No | Optional parameters. |
| withPermissionRole | Boolean | No | Whether to return permission information: - true: Return - false: Do not return Default: false. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| workspaces | Array | The list of knowledge bases. |
| workspaceId | String | The Knowledge Base ID (spaceUuid). |
| corpId | String | The organization ID that the Knowledge Base belongs to. |
| teamId | String | The ID of the Knowledge Group that the Knowledge Base belongs to. Returns empty if the Knowledge Base does not belong to any Knowledge Group. |
| rootNodeId | String | The root node ID (root node dentryUuid). |
| name | String | The Knowledge Base name. |
| type | String | The Knowledge Base type. Enum values: - TEAM: Knowledge Base - PERSONAL: My Docs |
| description | String | The Knowledge Base description. |
| url | String | The URL used to access the Knowledge Base. |
| icon | Object | The Knowledge Base icon. |
| type | String | The icon type. Enum values: - URL: Link - EMOJI: Emoji icon |
| value | String | The icon value: - When type is URL, returns the icon link. - When type is EMOJI, returns the Unicode value of the emoji icon. |
| cover | String | The URL of the Knowledge Base cover. |
| creatorId | String | The userId of the Knowledge Base creator. |
| modifierId | String | The userId of the user who last modified the Knowledge Base. |
| createTime | String | The time when the Knowledge Base was created. |
| modifiedTime | String | The time when the Knowledge Base was last modified. |
| permissionRole | String | The permission role of the requester on the Knowledge Base. Enum values: - OWNER: Owner - MANAGER: Manager - EDITOR: Editor - DOWNLOADER: Viewer who can download - READER: View-only - NONE: No permission |
Response body example
Error codes
If an error is returned when you call this API, look up the error message in the Global error codes document to find a solution.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error. |
| 403 | permissionDenied | %s | The current user does not have permission to perform this action. |
| 404 | workspaceNotExist | %s | The Knowledge Base does not exist. |
| 500 | systemError | %s | The service is busy. Try again later. |
| 500 | unknownError | Unknown Error | Unknown error. |
| 503 | operationTimeout | %s | The request timed out. |