SubscriptionsApi


Block a subscription

Block a subscription.\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/subscriptions/block-subscription

HTTP Method

POST

Scope

apim:subscription_block

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -X POST "http://127.0.0.1:9763/api/am/publisher/v0.9/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED"

Sample Response

HTTP/1.1 200 OK Content-Type: application/json { "subscriptionId": "64eca60b-2e55-4c38-8603-e9e6bad7d809", "tier": "Gold", "apiIdentifier": "admin-PhoneVerification-1.0.0", "applicationId": "896658a0-b4ee-4535-bbfa-806c894a4015", "status": "PROD_ONLY_BLOCKED" }

Parameters

Type Name Description Schema Default
Query

subscriptionId

required

Subscription Id\n

String

Query

blockState

required

Subscription block state.\n

Accepted values:

BLOCKED PROD_ONLY_BLOCKED
String

Header

If-Match

optional

Validator for conditional requests; based on ETag.\n

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header.\n

String

Responses

HTTP Code Description Schema

200

OK.\nSubscription was blocked successfully.\n

400

Bad Request.\nInvalid request or validation error\n

Error

404

Not Found.\nRequested subscription does not exist.\n

Error

412

Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.\n

Error

Get All Subscriptions

Get subscription list.\nThe API Identifier and corresponding Application Identifier\nthe subscriptions of which are to be returned are passed as parameters.\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/subscriptions

HTTP Method

GET

Scope

apim:subscription_view

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" "http://127.0.0.1:9763/api/am/publisher/v0.9/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b"

Sample Response

HTTP/1.1 200 OK Content-Type: application/json { "previous": "", "list": [ { "subscriptionId": "64eca60b-2e55-4c38-8603-e9e6bad7d809", "tier": "Gold", "apiIdentifier": "admin-PhoneVerification-1.0.0", "applicationId": "896658a0-b4ee-4535-bbfa-806c894a4015", "status": "UNBLOCKED" }, { "subscriptionId": "7ac22c34-8745-4cfe-91e0-262c50b2f2e3", "tier": "Gold", "apiIdentifier": "admin-PhoneVerification-1.0.0", "applicationId": "367a2361-8db5-4140-8133-c6c8dc7fa0c4", "status": "UNBLOCKED" } ], "next": "", "count": 2 }

Parameters

Type Name Description Schema Default
Query

apiId

required

**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API I.\nShould be formatted as **provider-name-version**.\n

String

Query

limit

optional

Maximum size of resource array to return.\n

Integer

25

Query

offset

optional

Starting point within the complete list of items qualified.\n

Integer

0

Header

Accept

optional

Media types acceptable for the response. Default is JSON.\n

String

JSON

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec.\n

String

Responses

HTTP Code Description Schema

200

OK.\nSubscription list returned.\n

SubscriptionList

304

Not Modified.\nEmpty body because the client has already the latest version of the requested resource.\n

406

Not Acceptable. The requested media type is not supported\n

Error

Get a Subscription

Get subscription details\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/subscriptions/{subscriptionId}

HTTP Method

GET

Scope

apim:subscription_view

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" http://127.0.0.1:9763/api/am/publisher/v0.9/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809

Sample Response

HTTP/1.1 200 OK Content-Type: application/json { "subscriptionId": "64eca60b-2e55-4c38-8603-e9e6bad7d809", "tier": "Gold", "apiIdentifier": "admin-PhoneVerification-1.0.0", "applicationId": "896658a0-b4ee-4535-bbfa-806c894a4015", "status": "UNBLOCKED" }

Parameters

Type Name Description Schema Default
Path

subscriptionId

required

Subscription Id\n

String

Header

Accept

optional

Media types acceptable for the response. Default is JSON.\n

String

JSON

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec.\n

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource.\n

String

Responses

HTTP Code Description Schema

200

OK.\nSubscription returned\n

Subscription

304

Not Modified.\nEmpty body because the client has already the latest version of the requested resource.\n

404

Not Found.\nRequested Subscription does not exist.\n

Error

Unblock a Subscription

Unblock a subscription.\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/subscriptions/unblock-subscription

HTTP Method

POST

Scope

apim:subscription_block

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -X POST "http://127.0.0.1:9763/api/am/publisher/v0.9/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809"

Sample Response

HTTP/1.1 200 OK Content-Type: application/json { "subscriptionId": "64eca60b-2e55-4c38-8603-e9e6bad7d809", "tier": "Gold", "apiIdentifier": "admin-PhoneVerification-1.0.0", "applicationId": "896658a0-b4ee-4535-bbfa-806c894a4015", "status": "UNBLOCKED" }

Parameters

Type Name Description Schema Default
Query

subscriptionId

required

Subscription Id\n

String

Header

If-Match

optional

Validator for conditional requests; based on ETag.\n

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header.\n

String

Responses

HTTP Code Description Schema

200

OK.\nSubscription was unblocked successfully.\n

400

Bad Request.\nInvalid request or validation error\n

Error

404

Not Found.\nRequested subscription does not exist.\n

Error

412

Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.\n

Error