API call description
The app property information passed in the API is validated by property name.- If the existing property name of the file or folder matches the property name passed in, the API updates the property.
- If the existing property name of the file or folder does not match the property name passed in, the API adds the property.
Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries/{dentryId}/appProperties |
| HTTP Method | PUT |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-Storage.File.Write-Write permission for organization storage files |
Request header
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling 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 enterprise authorized for a third-party app API. |
Path parameter
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | Long | Yes | The space ID. Call the Add space API to obtain the id parameter value. |
| dentryId | Long | Yes | The ID of the file or folder. Call the Get a list of files or folders API or the Get spaceId and dentryId by dentryUuid API to obtain the id parameter value. |
Query parameter
| Name | Type | Required | Description |
|---|---|---|---|
| unionId | String | Yes | The unionId of the operator. Call the Query user details API to obtain the unionid parameter value. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| appProperties | Array | Yes | The list of app properties. The maximum value is 3. |
| name | String | Yes | The property name. - If the property name already exists, the existing property information is updated. - If the property name does not exist, the property information is added. |
| value | String | Yes | The property value. |
| visibility | String | Yes | The visibility scope of the property. - PUBLIC: The property is visible to all apps. - PRIVATE: The property is visible only to its owning app. This is the default value. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| success | Boolean | Whether this update is successful. - true: Success - false: Failed |
Response body example
Error codes
If calling this API returns an error, refer to the Global error codes document for a solution based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | operationConcurrentControl | %s | Concurrency control |
| 400 | paramError | %s | Parameter error |
| 400 | paramError.spaceId | %s | Parameter error - spaceId |
| 400 | paramError.dentryId | %s | Parameter error - dentryId |
| 400 | dentryAppPropertiesNumberExceedsLimit | %s | The number of properties set by a single app on a dentry exceeds the limit. The maximum number is 3. |
| 403 | permissionDenied | %s | The user does not have permission to modify the properties of the file (or folder). |
| 404 | spaceNotExist | %s | The space does not exist. |
| 404 | dentryNotExist | %s | The file does not exist. |
| 500 | systemError | %s | System error |
| 500 | unknownError | Unknown Error | Unknown error |
| 503 | operationTimeout | %s | Request timed out |