Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/calendar/users/{userId}/calendars/{calendarId}/unsubscribe |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app appType-Third-party personal app |
| Required permissions | permission-Calendar.Calendar.Write-Write permission for calendars in the Calendar app |
Request headers
| 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 authorized organization for a third-party app API. - For a third-party personal app, call the Get a user token API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| userId | String | Yes | The unionId of the unsubscriber. - For internal apps and third-party enterprise apps, call the Query user details API to obtain the value of the unionid parameter. - For third-party personal apps, call the Get a user’s profile from Contacts API to obtain the value of the unionId parameter. |
| calendarId | String | Yes | The ID of the subscribed calendar. The creator of the subscribed calendar or a user who has subscribed to it can call the Query a calendar API to obtain the event ID parameter value when type is subscribed. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| result | Boolean | Whether the unsubscribe action succeeded. true indicates success. |
Response body example
Error codes
If an error occurs when calling this API, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | permissionDenied | The user is not within the subscription scope | The user is not within the subscription scope |
| 400 | invalidParameter | forwardErrorMessage | Invalid parameter |
| 400 | invalidParameter | calendarId cannot be blank | calendarId cannot be empty |
| 400 | invalidParameter | calendar type invalid | Invalid calendar type |