TiersApi


List Tiers

Get available tiers\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/tiers/{tierLevel}

HTTP Method

GET

Scope

apim:tier_view

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" http://127.0.0.1:9763/api/am/publisher/v0.9/tiers/api

Sample Response

HTTP/1.1 200 OK Content-Type: application/json { "previous": "", "list": [ { "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 1, "description": "Allows 1 request(s) per minute.", "name": "Bronze", "attributes": {} }, { "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 20, "description": "Allows 20 request(s) per minute.", "name": "Gold", "attributes": {} }, { "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 5, "description": "Allows 5 request(s) per minute.", "name": "Silver", "attributes": {} }, { "unitTime": 0, "tierPlan": null, "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 0, "description": "Allows unlimited requests", "name": "Unlimited", "attributes": {} } ], "next": "", "count": 4 }

Parameters

Type Name Description Schema Default
Path

tierLevel

required

List API or Application or Resource type tiers.\n

Accepted values:

api application resource
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.\nList of tiers returned.\n

TierList

304

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

406

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

Error

Add a new Tier

Add a new tier\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/tiers/{tierLevel}

HTTP Method

POST

Scope

apim:tier_manage

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -H "Content-Type: application/json" -X POST -d @data.json "http://127.0.0.1:9763/api/am/publisher/v0.9/tiers/api"

Sample Request

{ "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 5, "description": "Allows 5 request(s) per minute.", "name": "Low", "attributes": { "a":10, "b":30 } }

Sample Response

HTTP/1.1 201 Created Location: http://localhost:9763/api/am/publisher/v0.9/tiers/Low Content-Type: application/json { "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 5, "description": "Allows 5 request(s) per minute.", "name": "Low", "attributes": { "b": "30", "a": "10" } }

Parameters

Type Name Description Schema Default
Body

body

required

Tier object that should to be added\n

Tier (Tier)

Path

tierLevel

required

List API or Application or Resource type tiers.\n

Accepted values:

api application resource
String

Header

Content-Type

required

Media type of the entity in the body. Default is JSON.\n

String

JSON

Responses

HTTP Code Description Schema

201

Created.\nSuccessful response with the newly created object as entity in the body.\nLocation header contains URL of newly created entity.\n

Tier

400

Bad Request.\nInvalid request or validation error\n

Error

415

Unsupported media type.\nThe entity of the request was in a not supported format.\n


Delete a Tier

Remove a tier\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/tiers/{tierLevel}/{tierName}

HTTP Method

DELETE

Scope

apim:tier_manage

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -X POST "http://127.0.0.1:9763/api/am/publisher/v0.9/tiers/api/Low"

Sample Response

HTTP/1.1 200 OK

Parameters

Type Name Description Schema Default
Path

tierName

required

Tier name\n

String

Path

tierLevel

required

List API or Application or Resource type tiers.\n

Accepted values:

api application resource
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.\nResource successfully deleted.\n

404

Not Found.\nResource to be deleted 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 a Tier

Get tier details\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/tiers/{tierLevel}/{tierName}

HTTP Method

GET

Scope

apim:tier_view

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" http://127.0.0.1:9763/api/am/publisher/v0.9/tiers/api/Bronze

Sample Response

HTTP/1.1 200 OK Content-Type: application/json { "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 1, "description": "Allows 1 request(s) per minute.", "name": "Bronze", "attributes": {} }

Parameters

Type Name Description Schema Default
Path

tierName

required

Tier name\n

String

Path

tierLevel

required

List API or Application or Resource type tiers.\n

Accepted values:

api application resource
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.\nTier returned\n

Tier

304

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

404

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

Error

406

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

Error

Update a Tier

Update tier details\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/tiers/{tierLevel}/{tierName}

HTTP Method

PUT

Scope

apim:tier_manage

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -H "Content-Type: application/json" -X PUT -d @data.json "http://127.0.0.1:9763/api/am/publisher/v0.9/tiers/api/Low"

Sample Request

{ "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 10, "description": "Allows 10 request(s) per minute.", "name": "Low", "attributes": { "a": "30", "b": "10", "c": "20" } }

Sample Response

HTTP/1.1 200 OK Content-Type: application/json { "unitTime": 60000, "tierPlan": "FREE", "tierLevel": "api", "stopOnQuotaReach": true, "requestCount": 10, "description": "Allows 10 request(s) per minute.", "name": "Low", "attributes": { "b": "10", "c": "20", "a": "30" } }

Parameters

Type Name Description Schema Default
Path

tierName

required

Tier name\n

String

Body

body

required

Tier object that needs to be modified\n

Tier (Tier)

Path

tierLevel

required

List API or Application or Resource type tiers.\n

Accepted values:

api application resource
String

Header

Content-Type

required

Media type of the entity in the body. Default is JSON.\n

String

JSON

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 updated.\n

Tier

400

Bad Request.\nInvalid request or validation error.\n

Error

404

Not Found.\nThe resource to be updated does not exist.\n

Error

412

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

Error

Update Tier Permission

Update tier permission\n

URL

https://apis.wso2.com/api/am/publisher/v0.9/tiers/update-permission

HTTP Method

POST

Scope

apim:tier_manage

CURL Example

curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -H "Content-Type: application/json" -X POST -d @data.json "http://127.0.0.1:9763/api/am/publisher/v0.9/tiers/update-permission?tierName=Bronze&tierLevel=api"

Sample Request

{ "permissionType":"deny", "roles": ["Internal/everyone","admin"] }

Sample Response

HTTP/1.1 200 OK

Parameters

Type Name Description Schema Default
Query

tierName

required

Name of the tier\n

String

Query

tierLevel

required

List API or Application or Resource type tiers.\n

Accepted values:

api application resource
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

Body

permissions

optional

TierPermission (TierPermission)

Responses

HTTP Code Description Schema

200

OK.\nSuccessfully updated tier permissions\n

Tier

400

Bad Request.\nInvalid request or validation error.\n

Error

403

Forbidden.\nThe request must be conditional but no condition has been specified.\n

Error

404

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

Error

412

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

Error