Deletes a subscription.

Authorization

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after these RAM users are granted related permissions. The following table describes the authorization information of this operation. For more information, see Permission policies and examples.

Item Value
API operation Unsubscribe
Action mns:Unsubscribe
Resource acs:mns:$region:$accountid:/topics/$topicName/subscriptions/$subscriptionName

Request

A request consists of the following parts:

  • Request line

    DELETE /topics/$TopicName/subscriptions/$SubscriptionName HTTP/1.1

  • Operation-specific request headers

    None.

  • Request body

    None.

Response

A response consists of the following parts:

  • HTTP status code

    HTTP/1.1 204 No Content

    If the subscription is deleted, the HTTP status code 204 is returned.

  • Operation-specific response headers

    None.

  • Response body

    None.

Examples

Sample requests

DELETE /topics/$TopicName/subscriptions/$SubscriptionName HTTP/1.1
Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
Date: Tue, 08 Dec 2015 06:18:04 GMT
Authorization: MNS 15B4D3461F177624206A:UOEb7OmC9GX7G9BLY3XryP6v****
x-mns-version: 2015-06-06

Sample success responses

HTTP/1.1 204 No Content
x-mns-request-id: 5666761CB2B71C9C1600****
x-mns-version: 2015-06-06    

Error codes

No operation-specific errors occur when you call this operation. Common errors include unauthorized access and invalid parameters. For more information, see Error codes.