API (Individual)


Delete an API

DELETE https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}

This operation can be used to delete an existing API proving the Id of the API.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Resource successfully deleted.

403

Forbidden. The request must be conditional but no condition has been specified.

Error

404

Not Found. Resource to be deleted does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met.

Error

Get details of an API

GET https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}

Using this operation, you can retrieve complete details of a single API. You need to provide the Id of the API to retrive it.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Header

Accept

optional

Media types acceptable for the response. Default is application/json.

String

application/json

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource (Will be supported in future).

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Requested API is returned

APIDetailed

304

Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future).

404

Not Found. Requested API does not exist.

Error

406

Not Acceptable. The requested media type is not supported

Error

Update an API

PUT https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}

This operation can be used to update an existing API. But the properties `name`, `version`, `context`, `provider`, `state` will not be changed by this operation.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Body

body

required

API object that needs to be added

APIDetailed (APIDetailed)

Header

Content-Type

required

Media type of the entity in the body. Default is application/json.

String

application/json

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Successful response with updated API object

APIDetailed

400

Bad Request. Invalid request or validation error

Error

403

Forbidden. The request must be conditional but no condition has been specified.

Error

404

Not Found. The resource to be updated does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met.

Error

Get the resource policy (inflow/outflow) definitions

GET https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}/resource-policies

This operation can be used to retrieve conversion policy resource definitions of an API.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Query

sequenceType

required

sequence type of the resource policy resource definition

String

Query

resourcePath

optional

Resource path of the resource policy definition

String

Query

verb

optional

HTTP verb of the resource path of the resource policy definition

String

Header

Accept

optional

Media types acceptable for the response. Default is application/json.

String

application/json

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource (Will be supported in future).

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. List of resource policy definitions of the API is returned

ResourcePolicyList

304

Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future).

404

Not Found. Requested API does not exist.

Error

406

Not Acceptable. The requested media type is not supported

Error

Get the resource policy (inflow/outflow) definition for a given resource identifier.

GET https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}/resource-policies/{resourceId}

This operation can be used to retrieve conversion policy resource definitions of an API given the resource identifier.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Path

resourceId

required

registry resource Id

String

Header

Accept

optional

Media types acceptable for the response. Default is application/json.

String

application/json

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource (Will be supported in future).

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Requested resource policy definition of the API is returned for the given resource identifier.

ResourcePolicyInfo

304

Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future).

400

Bad Request. Invalid request or validation error

Error

404

Not Found. Requested API does not exist.

Error

406

Not Acceptable. The requested media type is not supported

Error

Update the resource policy(inflow/outflow) definition for the given resource identifier

PUT https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}/resource-policies/{resourceId}

This operation can be used to update the resource policy(inflow/outflow) definition for the given resource identifier of an existing API. resource policy definition to be updated is passed as a body parameter `content`.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Path

resourceId

required

registry resource Id

String

Body

body

required

Content of the resource policy definition that needs to be updated

ResourcePolicyInfo (ResourcePolicyInfo)

Header

Content-Type

required

Media type of the entity in the body. Default is application/json.

String

application/json

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Successful response with updated the resource policy definition

ResourcePolicyInfo

400

Bad Request. Invalid request or validation error

Error

403

Forbidden. The request must be conditional but no condition has been specified.

Error

404

Not Found. The resource to be updated does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met.

Error

Get swagger definition

GET https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}/swagger

This operation can be used to retrieve the swagger definition of an API.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Header

Accept

optional

Media types acceptable for the response. Default is application/json.

String

application/json

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource (Will be supported in future).

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Requested swagger document of the API is returned

304

Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future).

404

Not Found. Requested API does not exist.

Error

406

Not Acceptable. The requested media type is not supported

Error

Update swagger definition

PUT https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}/swagger

This operation can be used to update the swagger definition of an existing API. Swagger definition to be updated is passed as a form data parameter `apiDefinition`.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Form

apiDefinition

required

Swagger definition of the API

String

Header

Content-Type

required

Media type of the entity in the body. Default is application/json.

String

application/json

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Successful response with updated Swagger definition

400

Bad Request. Invalid request or validation error

Error

403

Forbidden. The request must be conditional but no condition has been specified.

Error

404

Not Found. The resource to be updated does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met.

Error

Get thumbnail image

GET https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}/thumbnail

This operation can be used to download a thumbnail image of an API.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Header

Accept

optional

Media types acceptable for the response. Default is application/json.

String

application/json

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource (Will be supported in future).

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Thumbnail image returned

304

Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future).

404

Not Found. Requested Document does not exist.

Error

406

Not Acceptable. The requested media type is not supported

Error

Upload a thumbnail image

POST https://apis.wso2.com/api/am/publisher/v0.16/apis/{apiId}/thumbnail

This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Path

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. Should be formatted as **provider-name-version**.

String

Form

file

required

Image to upload

File

Header

Content-Type

required

Media type of the entity in the body. Default is application/json.

String

application/json

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Image updated

FileInfo

400

Bad Request. Invalid request or validation error.

Error

404

Not Found. The resource to be updated does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met.

Error

Change API Status

POST https://apis.wso2.com/api/am/publisher/v0.16/apis/change-lifecycle

This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter. For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`. Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Query

action

required

The action to demote or promote the state of the API. Supported actions are [ **Publish, Deploy as a Prototype, Demote to Created, Demote to Prototyped, Block, Deprecate, Re-Publish, Retire **]

Accepted values:

Publish Deploy as a Prototype Demote to Created Demote to Prototyped Block Deprecate Re-Publish Retire
String

Query

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**.

String

Query

lifecycleChecklist

optional

Supported checklist items are as follows. 1. **Deprecate Old Versions**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. 2. **Require Re-Subscription**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. You can specify additional checklist items by using an **"attribute:"** modifier. Eg: "Deprecate Old Versions:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format. **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v0.16/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate Old Versions:true,Require Re-Subscription:true"

String

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Lifecycle changed successfully.

400

Bad Request. Invalid request or validation error

Error

404

Not Found. Requested API does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met.

Error

Create a new API version

POST https://apis.wso2.com/api/am/publisher/v0.16/apis/copy-api

This operation can be used to create a new version of an existing API. The new version is specified as `newVersion` query parameter. New API will be in `CREATED` state.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Query

newVersion

required

Version of the new API.

String

Query

apiId

required

**API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. Should be formatted as **provider-name-version**.

String

Responses

HTTP Code Description Schema

201

Created. Successful response with the newly created API as entity in the body. Location header contains URL of newly created API.

400

Bad Request. Invalid request or validation error

Error

401

Unauthenticated request.

Error

404

Not Found. API to copy does not exist.


Create a new API

POST https://apis.wso2.com/api/am/publisher/v0.16/apis

This operation can be used to create a new API specifying the details of the API in the payload. The new API will be in `CREATED` state. There is a special capability for a user who has `APIM Admin` permission such that he can create APIs on behalf of other users. For that he can to specify `"provider" : "some_other_user"` in the payload so that the API's creator will be shown as `some_other_user` in the UI.

OAuth 2.0 Scope

Not required

Examples

Parameters

Type Name Description Schema Default
Body

body

required

API object that needs to be added

APIDetailed (APIDetailed)

Header

Content-Type

required

Media type of the entity in the body. Default is application/json.

String

application/json

Responses

HTTP Code Description Schema

201

Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity.

APIDetailed

400

Bad Request. Invalid request or validation error.

Error

415

Unsupported Media Type. The entity of the request was in a not supported format.

Error