Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/convFile/apps/conversations/files/send |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permissions required | permission-ConvFile.File.Send-Group file sending permission |
Request header
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it through one of the following methods: - 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 |
|---|---|---|---|
| unionId | String | Yes | The unionId of the user who receives the file. To obtain this value, call the Query user details API. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The ID of the space where the file resides. Call the Add space API to obtain the value of the id parameter. |
| dentryId | String | Yes | The ID of the file. Call the Get the list of files or folders API to obtain the value of the id parameter. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| file | Object | The information about the file sent to the target chat. |
| id | String | The file ID. |
| conversationId | String | The ID of the chat where the file resides. |
| spaceId | String | The ID of the space where the file resides. |
| parentId | String | The ID of the parent folder where the file resides. For the root folder, this parameter is 0. |
| type | String | The file type. - FILE: File - FOLDER: Folder This API can only send files. |
| name | String | The file name. |
| size | Long | The file size, in bytes. |
| path | String | The file path. |
| version | Long | The file version. |
| status | String | The file status. - NORMAL: Normal - DELETED: Deleted - EXPIRED: Expired |
| extension | String | The file extension. |
| creatorId | String | The unionId of the creator. |
| modifierId | String | The unionId of the modifier. |
| createTime | String | The creation time in ISO 8601 format. For example, 2022-07-29T14:55Z. |
| modifiedTime | String | The modification time in ISO 8601 format. For example, 2022-07-29T14:55Z. |
| uuid | String | The business uuid. This API does not return this field. |
Response body example
Error codes
If an error is returned when you call this API, locate the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error |
| 400 | paramError.spaceId | %s | Parameter error - spaceId |
| 400 | paramError.dentryId | %s | Parameter error - dentryId |
| 400 | permissionDenied | %s | No permission |
| 404 | spaceNotExist | %s | Space does not exist |
| 404 | dentryNotExist | %s | File does not exist |
| 500 | systemError | %s | System error |
| 500 | unknownError | Unknown Error | Unknown error |