API call description
- Only the calendar creator can delete the calendar. Therefore, the userId field in the path parameter must be the unionId of the calendar creator.
- After a subscribed calendar is deleted, users who have subscribed to the calendar are automatically unsubscribed.
Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/calendar/users/{userId}/subscribedCalendars/{calendarId} |
| HTTP Method | DELETE |
| Supported app types | appType-Internal app appType-Third-party enterprise app appType-Third-party personal app |
| Permissions required | permission-Calendar.Calendar.Write-Write permission for the Calendar app |
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 authorized enterprise for a third-party app API. - For a third-party personal app, call the Get the user token API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| userId | String | Yes | The unionId of the calendar creator. - For internal apps and third-party enterprise apps, call the Query user details API to obtain the unionid value. - For third-party personal apps, call the Get user profile from Contacts API to obtain the unionId value. |
| calendarId | String | Yes | The ID of the subscribed calendar. Call the Create a subscribed calendar API to obtain the calendarId value. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| result | Boolean | Whether the API call succeeded. true indicates success. |
Response body example
Error codes
If an error occurs when you call this API, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidParameter | forwardErrorMessage | Invalid parameter |
| 400 | invalidParameter | calendarId cannot be blank | calendarId cannot be empty |
| 403 | permissionDenied | permission denied | Authentication failed |