API (Individual)


Delete an API

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

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

OAuth 2.0 Scope

apim:api_createi

Request

DELETE https://localhost:9443/api/am/publisher/v0.13/apis/6fb74674-4ab8-4b52-9886-f9a376985060 Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8

Response

HTTP/1.1 200 OK

Sample CURL

curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X DELETE https://localhost:9443/api/am/publisher/v0.13/apis/6fb74674-4ab8-4b52-9886-f9a376985060

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.13/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

apim:api_viewi

Request

GET https://localhost:9443/api/am/publisher/v0.13/apis/7a2298c4-c905-403f-8fac-38c73301631f Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8

Response

HTTP/1.1 200 OK Content-Type: application/json { "id": "7a2298c4-c905-403f-8fac-38c73301631f", "name": "PizzaShackAPI", "description": "This document describe a RESTFul API for Pizza Shack online pizza delivery store.\r\n", "context": "/pizzashack", "version": "1.0.0", "provider": "admin", "apiDefinition": "{\"paths\":{\"/order\":{\"post\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Create a new Order\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Order object that needs to be added\",\"name\":\"body\",\"required\":true,\"in\":\"body\"}],\"responses\":{\"201\":{\"headers\":{\"Location\":{\"description\":\"The URL of the newly created resource.\",\"type\":\"string\"}},\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Created.\"}}}},\"/menu\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Return a list of available menu items\",\"parameters\":[],\"responses\":{\"200\":{\"headers\":{},\"schema\":{\"title\":\"Menu\",\"properties\":{\"list\":{\"items\":{\"$ref\":\"#/definitions/MenuItem\"},\"type\":\"array\"}},\"type\":\"object\"},\"description\":\"OK.\"}}}}},\"schemes\":[\"https\"],\"produces\":[\"application/json\"],\"swagger\":\"2.0\",\"definitions\":{\"MenuItem\":{\"title\":\"Pizza menu Item\",\"properties\":{\"price\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"image\":{\"type\":\"string\"}},\"required\":[\"name\"]},\"Order\":{\"title\":\"Pizza Order\",\"properties\":{\"customerName\":{\"type\":\"string\"},\"delivered\":{\"type\":\"boolean\"},\"address\":{\"type\":\"string\"},\"pizzaType\":{\"type\":\"string\"},\"creditCardNumber\":{\"type\":\"string\"},\"quantity\":{\"type\":\"number\"},\"orderId\":{\"type\":\"string\"}},\"required\":[\"orderId\"]}},\"consumes\":[\"application/json\"],\"info\":{\"title\":\"PizzaShackAPI\",\"description\":\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\n\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"http://www.apache.org/licenses/LICENSE-2.0.html\"},\"contact\":{\"email\":\"architecture@pizzashack.com\",\"name\":\"John Doe\",\"url\":\"http://www.pizzashack.com\"},\"version\":\"1.0.0\"}}", "wsdlUri": null, "status": "CREATED", "responseCaching": "Disabled", "cacheTimeout": 300, "destinationStatsEnabled": null, "isDefaultVersion": false, "type": "HTTP", "transport": [ "http", "https" ], "tags": ["pizza"], "tiers": ["Unlimited"], "maxTps": { "sandbox": 5000, "production": 1000 }, "thumbnailUri": null, "visibility": "PUBLIC", "visibleRoles": [],\r "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", "endpointSecurity": { "username": "user", "type": "basic", "password": "pass" }, "gatewayEnvironments": "Production and Sandbox", "sequences": [], "subscriptionAvailability": null, "subscriptionAvailableTenants": [], "businessInformation": { "businessOwnerEmail": "marketing@pizzashack.com", "technicalOwnerEmail": "architecture@pizzashack.com", "technicalOwner": "John Doe", "businessOwner": "Jane Roe" }, "corsConfiguration": { "accessControlAllowOrigins": ["*"], "accessControlAllowHeaders": [ "authorization", "Access-Control-Allow-Origin", "Content-Type", "SOAPAction" ], "accessControlAllowMethods": [ "GET", "PUT", "POST", "DELETE", "PATCH", "OPTIONS" ], "accessControlAllowCredentials": false, "corsConfigurationEnabled": false } }

Sample CURL

curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" https://localhost:9443/api/am/publisher/v0.13/apis/7a2298c4-c905-403f-8fac-38c73301631f

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.13/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

apim:api_createi

Request

PUT https://localhost:9443/api/am/publisher/v0.13/apis/7a2298c4-c905-403f-8fac-38c73301631f Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 Content-Type: application/json { "id": "7a2298c4-c905-403f-8fac-38c73301631f", "name": "PizzaShackAPI", "description": "This document describe a RESTFul API for Pizza Shack online pizza delivery store.\r\n", "context": "/pizzashack", "version": "1.0.0", "provider": "admin", "apiDefinition": "{\"paths\":{\"/order\":{\"post\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Create a new Order\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Order object that needs to be added\",\"name\":\"body\",\"required\":true,\"in\":\"body\"}],\"responses\":{\"201\":{\"headers\":{\"Location\":{\"description\":\"The URL of the newly created resource.\",\"type\":\"string\"}},\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Created.\"}}}},\"/menu\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Return a list of available menu items\",\"parameters\":[],\"responses\":{\"200\":{\"headers\":{},\"schema\":{\"title\":\"Menu\",\"properties\":{\"list\":{\"items\":{\"$ref\":\"#/definitions/MenuItem\"},\"type\":\"array\"}},\"type\":\"object\"},\"description\":\"OK.\"}}}}},\"schemes\":[\"https\"],\"produces\":[\"application/json\"],\"swagger\":\"2.0\",\"definitions\":{\"MenuItem\":{\"title\":\"Pizza menu Item\",\"properties\":{\"price\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"image\":{\"type\":\"string\"}},\"required\":[\"name\"]},\"Order\":{\"title\":\"Pizza Order\",\"properties\":{\"customerName\":{\"type\":\"string\"},\"delivered\":{\"type\":\"boolean\"},\"address\":{\"type\":\"string\"},\"pizzaType\":{\"type\":\"string\"},\"creditCardNumber\":{\"type\":\"string\"},\"quantity\":{\"type\":\"number\"},\"orderId\":{\"type\":\"integer\"}},\"required\":[\"orderId\"]}},\"consumes\":[\"application/json\"],\"info\":{\"title\":\"PizzaShackAPI\",\"description\":\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\n\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"http://www.apache.org/licenses/LICENSE-2.0.html\"},\"contact\":{\"email\":\"architecture@pizzashack.com\",\"name\":\"John Doe\",\"url\":\"http://www.pizzashack.com\"},\"version\":\"1.0.0\"}}", "wsdlUri": null, "status": "CREATED", "responseCaching": "Disabled", "cacheTimeout": 300, "destinationStatsEnabled": null, "isDefaultVersion": false, "type": "HTTP", "transport": [ "https" ], "tags": ["pizza","chicken"], "tiers": ["Unlimited"], "maxTps": { "sandbox": 500, "production": 100 }, "thumbnailUri": null, "visibility": "PUBLIC", "visibleRoles": [],\r "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", "endpointSecurity": { "username": "user", "type": "basic", "password": "pass" }, "gatewayEnvironments": "Production and Sandbox", "sequences": [{"name":"json_validator","type": "in"},{"name":"log_out_message","type": "out"}], "subscriptionAvailability": null, "subscriptionAvailableTenants": [], "businessInformation": { "businessOwnerEmail": "marketing@pizzashack.com", "technicalOwnerEmail": "architecture@pizzashack.com", "technicalOwner": "John Doe", "businessOwner": "Jane Roe" }, "corsConfiguration": { "accessControlAllowOrigins": ["*"], "accessControlAllowHeaders": [ "authorization", "Access-Control-Allow-Origin", "Content-Type", "SOAPAction" ], "accessControlAllowMethods": [ "GET", "PUT", "POST", "DELETE", "PATCH", "OPTIONS" ], "accessControlAllowCredentials": false, "corsConfigurationEnabled": false } }

Response

HTTP/1.1 200 OK Content-Type: application/json { "id": "7a2298c4-c905-403f-8fac-38c73301631f", "name": "PizzaShackAPI", "description": "This document describe a RESTFul API for Pizza Shack online pizza delivery store.\r\n", "context": "/pizzashack", "version": "1.0.0", "provider": "admin", "apiDefinition": "{\"paths\":{\"/order\":{\"post\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Create a new Order\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Order object that needs to be added\",\"name\":\"body\",\"required\":true,\"in\":\"body\"}],\"responses\":{\"201\":{\"headers\":{\"Location\":{\"description\":\"The URL of the newly created resource.\",\"type\":\"string\"}},\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Created.\"}}}},\"/menu\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Return a list of available menu items\",\"parameters\":[],\"responses\":{\"200\":{\"headers\":{},\"schema\":{\"title\":\"Menu\",\"properties\":{\"list\":{\"items\":{\"$ref\":\"#/definitions/MenuItem\"},\"type\":\"array\"}},\"type\":\"object\"},\"description\":\"OK.\"}}}}},\"schemes\":[\"https\"],\"produces\":[\"application/json\"],\"swagger\":\"2.0\",\"definitions\":{\"MenuItem\":{\"title\":\"Pizza menu Item\",\"properties\":{\"price\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"image\":{\"type\":\"string\"}},\"required\":[\"name\"]},\"Order\":{\"title\":\"Pizza Order\",\"properties\":{\"customerName\":{\"type\":\"string\"},\"delivered\":{\"type\":\"boolean\"},\"address\":{\"type\":\"string\"},\"pizzaType\":{\"type\":\"string\"},\"creditCardNumber\":{\"type\":\"string\"},\"quantity\":{\"type\":\"number\"},\"orderId\":{\"type\":\"string\"}},\"required\":[\"orderId\"]}},\"consumes\":[\"application/json\"],\"info\":{\"title\":\"PizzaShackAPI\",\"description\":\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\n\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"http://www.apache.org/licenses/LICENSE-2.0.html\"},\"contact\":{\"email\":\"architecture@pizzashack.com\",\"name\":\"John Doe\",\"url\":\"http://www.pizzashack.com\"},\"version\":\"1.0.0\"}}", "wsdlUri": null, "status": "CREATED", "responseCaching": "Disabled", "cacheTimeout": 300, "destinationStatsEnabled": null, "isDefaultVersion": false, "type": "HTTP", "transport": ["https"], "tags": [ "chicken", "pizza" ], "tiers": ["Unlimited"], "maxTps": { "sandbox": 500, "production": 100 }, "thumbnailUri": null, "visibility": "PUBLIC", "visibleRoles": [],\r "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", "endpointSecurity": { "username": "user", "type": "basic", "password": "pass" }, "gatewayEnvironments": "Production and Sandbox", "sequences": [{"name":"json_validator","type":"in","id":"142ece76-b208-4aab-b29a-f382045ed066","shared":false},{"name":"log_out_message","type":"out","id":"b3527be8-95e6-41e0-8097-3276987b7d4b","shared":false}], "subscriptionAvailability": null, "subscriptionAvailableTenants": [], "businessInformation": { "businessOwnerEmail": "marketing@pizzashack.com", "technicalOwnerEmail": "architecture@pizzashack.com", "technicalOwner": "John Doe", "businessOwner": "Jane Roe" }, "corsConfiguration": { "accessControlAllowOrigins": ["*"], "accessControlAllowHeaders": [ "authorization", "Access-Control-Allow-Origin", "Content-Type", "SOAPAction" ], "accessControlAllowMethods": [ "GET", "PUT", "POST", "DELETE", "PATCH", "OPTIONS" ], "accessControlAllowCredentials": false, "corsConfigurationEnabled": false } }

Sample CURL

curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -H "Content-Type: application/json" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.13/apis/7a2298c4-c905-403f-8fac-38c73301631f

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 swagger definition

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

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

OAuth 2.0 Scope

apim:api_viewi

Request

GET https://localhost:9443/api/am/publisher/v0.13/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8

Response

HTTP/1.1 200 OK Content-Type: application/json Content-Length: 329 { "paths": {"/*": {"get": { "x-auth-type": "Application", "x-throttling-tier": "Unlimited", "responses": {"200": {"description": "OK"}} }}}, "x-wso2-security": {"apim": {"x-wso2-scopes": []}}, "swagger": "2.0", "info": { "title": "PhoneVerification", "description": "Verify a phone number", "contact": { "email": "xx@ee.com", "name": "xx" }, "version": "1.0.0" } }

Sample CURL

curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" https://localhost:9443/api/am/publisher/v0.13/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger

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.13/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

apim:api_createi

Request

PUT https://localhost:9443/api/am/publisher/v0.13/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013 Content-Length: 477 Content-Type: multipart/form-data; boundary=------------------------4f51e636c0003d99 --------------------------4f51e636c0003d99 Content-Disposition: form-data; name="apiDefinition" {"paths":{"\/*":{"get":{"x-auth-type":"Application","x-throttling-tier":"Unlimited","responses":{"200":{"description":"OK"}}}}},"x-wso2-security":{"apim":{"x-wso2-scopes":[]}},"swagger":"2.0","info":{"title":"PhoneVerification","description":"Verify a phone number","contact":{"email":"xx@ee.com","name":"xx"},"version":"1.0.0"}} --------------------------4f51e636c0003d99--

Response

HTTP/1.1 200 OK Content-Type: application/json { "paths": {"/*": {"get": { "x-auth-type": "Application", "x-throttling-tier": "Unlimited", "responses": {"200": {"description": "OK"}} }}}, "x-wso2-security": {"apim": {"x-wso2-scopes": []}}, "swagger": "2.0", "info": { "title": "PhoneVerification", "description": "Verify a phone number", "contact": { "email": "xx@ee.com", "name": "xx" }, "version": "1.0.0" } }

Sample CURL

curl -k -H "Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013" -F apiDefinition="{\"paths\":{\"\/*\":{\"get\":{\"x-auth-type\":\"Application\",\"x-throttling-tier\":\"Unlimited\",\"responses\":{\"200\":{\"description\":\"OK\"}}}}},\"x-wso2-security\":{\"apim\":{\"x-wso2-scopes\":[]}},\"swagger\":\"2.0\",\"info\":{\"title\":\"PhoneVerification\",\"description\":\"Verify a phone number\",\"contact\":{\"email\":\"xx@ee.com\",\"name\":\"xx\"},\"version\":\"1.0.0\"}}" -X PUT "https://localhost:9443/api/am/publisher/v0.13/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger"

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.13/apis/{apiId}/thumbnail

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

OAuth 2.0 Scope

apim:api_viewi

Request

GET https://localhost:9443/api/am/publisher/v0.13/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9

Response

HTTP/1.1 200 OK Content-Type: image/jpeg [image content]

Sample CURL

curl -k -H "Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9" https://localhost:9443/api/am/publisher/v0.13/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail > image.jpg

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.13/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

apim:api_createi

Request

POST https://localhost:9443/api/am/publisher/v0.13/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9 Content-Type: multipart/form-data; boundary=------------------------5e542e0e5b50e1e4 Content-Length: 18333 --------------------------5e542e0e5b50e1e4 Content-Disposition: form-data; name="file"; filename="image.jpg" Content-Type: image/jpeg [image content] --------------------------5e542e0e5b50e1e4--

Response

HTTP/1.1 201 Created Location: https://localhost:9443/api/am/publisher/v0.13/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail Content-Type: application/json { "relativePath": "/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail", "mediaType": "image/jpeg" }

Sample CURL

curl -X POST -H "Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9" https://localhost:9443/api/am/publisher/v0.13/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail -F file=@image.jpg

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.13/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

apim:api_publishi

Request

POST https://localhost:9443/api/am/publisher/v0.13/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8

Response

HTTP/1.1 200 OK

Sample CURL

curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v0.13/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish"

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.13/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.13/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

apim:api_createi

Request

POST https://localhost:9443/api/am/publisher/v0.13/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0 Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8

Response

HTTP/1.1 201 Created Location: https://localhost:9443/api/am/publisher/v0.13/apis/25a84fc9-38c0-4578-95e8-29fb6b1c4771 Content-Type: application/json { "id": "25a84fc9-38c0-4578-95e8-29fb6b1c4771", "name": "PizzaShackAPI", "description": "This document describe a RESTFul API for Pizza Shack online pizza delivery store.\r\n", "context": "/pizzashack", "version": "2.0.0", "provider": "admin", "apiDefinition": "{\"paths\":{\"\\/order\":{\"post\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Create a new Order\",\"parameters\":[{\"schema\":{\"$ref\":\"#\\/definitions\\/Order\"},\"description\":\"Order object that needs to be added\",\"name\":\"body\",\"required\":true,\"in\":\"body\"}],\"responses\":{\"201\":{\"schema\":{\"$ref\":\"#\\/definitions\\/Order\"},\"headers\":{\"Location\":{\"description\":\"The URL of the newly created resource.\",\"type\":\"string\"}},\"description\":\"Created.\"}}}},\"\\/menu\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Return a list of available menu items\",\"parameters\":[],\"responses\":{\"200\":{\"schema\":{\"title\":\"Menu\",\"properties\":{\"list\":{\"items\":{\"$ref\":\"#\\/definitions\\/MenuItem\"},\"type\":\"array\"}},\"type\":\"object\"},\"headers\":{},\"description\":\"OK.\"}}}}},\"schemes\":[\"https\"],\"produces\":[\"application\\/json\"],\"swagger\":\"2.0\",\"definitions\":{\"MenuItem\":{\"title\":\"Pizza menu Item\",\"properties\":{\"price\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"image\":{\"type\":\"string\"}},\"required\":[\"name\"]},\"Order\":{\"title\":\"Pizza Order\",\"properties\":{\"customerName\":{\"type\":\"string\"},\"delivered\":{\"type\":\"boolean\"},\"pizzaType\":{\"type\":\"string\"},\"address\":{\"type\":\"string\"},\"creditCardNumber\":{\"type\":\"string\"},\"quantity\":{\"type\":\"number\"},\"orderId\":{\"type\":\"string\"}},\"required\":[\"orderId\"]}},\"consumes\":[\"application\\/json\"],\"info\":{\"title\":\"PizzaShackAPI\",\"description\":\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\n\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"http:\\/\\/www.apache.org\\/licenses\\/LICENSE-2.0.html\"},\"contact\":{\"email\":\"architecture@pizzashack.com\",\"name\":\"John Doe\",\"url\":\"http:\\/\\/www.pizzashack.com\"},\"version\":\"2.0.0\"}}", "wsdlUri": null, "status": "CREATED", "responseCaching": "Disabled", "cacheTimeout": 300, "destinationStatsEnabled": null, "isDefaultVersion": false, "type": "HTTP", "transport": ["https"], "tags": [ "chicken", "pizza" ], "tiers": ["Unlimited"], "maxTps": { "sandbox": 500, "production": 100 }, "thumbnailUri": null, "visibility": "PUBLIC", "visibleRoles": [],\r "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", "endpointSecurity": { "username": "user", "type": "basic", "password": "pass" }, "gatewayEnvironments": "Production and Sandbox", "sequences": [], "subscriptionAvailability": null, "subscriptionAvailableTenants": [], "businessInformation": { "businessOwnerEmail": "marketing@pizzashack.com", "technicalOwnerEmail": "architecture@pizzashack.com", "technicalOwner": "John Doe", "businessOwner": "Jane Roe" }, "corsConfiguration": { "accessControlAllowOrigins": ["*"], "accessControlAllowHeaders": [ "authorization", "Access-Control-Allow-Origin", "Content-Type", "SOAPAction" ], "accessControlAllowMethods": [ "GET", "PUT", "POST", "DELETE", "PATCH", "OPTIONS" ], "accessControlAllowCredentials": false, "corsConfigurationEnabled": false } }

Sample CURL

curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v0.13/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0"

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.13/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

apim:api_createi

Request

POST https://localhost:9443/api/am/publisher/v0.13/apis Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 { "name": "PizzaShackAPI", "description": "This document describe a RESTFul API for Pizza Shack online pizza delivery store.\r\n", "context": "/pizzashack", "version": "1.0.0", "provider": "admin", "apiDefinition": "{\"paths\":{\"/order\":{\"post\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Create a new Order\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Order object that needs to be added\",\"name\":\"body\",\"required\":true,\"in\":\"body\"}],\"responses\":{\"201\":{\"headers\":{\"Location\":{\"description\":\"The URL of the newly created resource.\",\"type\":\"string\"}},\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Created.\"}}}},\"/menu\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Return a list of available menu items\",\"parameters\":[],\"responses\":{\"200\":{\"headers\":{},\"schema\":{\"title\":\"Menu\",\"properties\":{\"list\":{\"items\":{\"$ref\":\"#/definitions/MenuItem\"},\"type\":\"array\"}},\"type\":\"object\"},\"description\":\"OK.\"}}}}},\"schemes\":[\"https\"],\"produces\":[\"application/json\"],\"swagger\":\"2.0\",\"definitions\":{\"MenuItem\":{\"title\":\"Pizza menu Item\",\"properties\":{\"price\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"image\":{\"type\":\"string\"}},\"required\":[\"name\"]},\"Order\":{\"title\":\"Pizza Order\",\"properties\":{\"customerName\":{\"type\":\"string\"},\"delivered\":{\"type\":\"boolean\"},\"address\":{\"type\":\"string\"},\"pizzaType\":{\"type\":\"string\"},\"creditCardNumber\":{\"type\":\"string\"},\"quantity\":{\"type\":\"number\"},\"orderId\":{\"type\":\"string\"}},\"required\":[\"orderId\"]}},\"consumes\":[\"application/json\"],\"info\":{\"title\":\"PizzaShackAPI\",\"description\":\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\n\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"http://www.apache.org/licenses/LICENSE-2.0.html\"},\"contact\":{\"email\":\"architecture@pizzashack.com\",\"name\":\"John Doe\",\"url\":\"http://www.pizzashack.com\"},\"version\":\"1.0.0\"}}", "wsdlUri": null, "status": "CREATED", "responseCaching": "Disabled", "cacheTimeout": 300, "destinationStatsEnabled": false, "isDefaultVersion": false, "type": "HTTP", "transport": [ "http", "https" ], "tags": ["pizza"], "tiers": ["Unlimited"], "maxTps": { "sandbox": 5000, "production": 1000 }, "visibility": "PUBLIC", "visibleRoles": [],\r "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", "endpointSecurity": { "username": "user", "type": "basic", "password": "pass" }, "gatewayEnvironments": "Production and Sandbox", "sequences": [{"name":"json_validator","type": "in"},{"name":"log_out_message","type": "out"}], "subscriptionAvailability": null, "subscriptionAvailableTenants": [], "businessInformation": { "businessOwnerEmail": "marketing@pizzashack.com", "technicalOwnerEmail": "architecture@pizzashack.com", "technicalOwner": "John Doe", "businessOwner": "Jane Roe" }, "corsConfiguration": { "accessControlAllowOrigins": ["*"], "accessControlAllowHeaders": [ "authorization", "Access-Control-Allow-Origin", "Content-Type", "SOAPAction" ], "accessControlAllowMethods": [ "GET", "PUT", "POST", "DELETE", "PATCH", "OPTIONS" ], "accessControlAllowCredentials": false, "corsConfigurationEnabled": false } }

Response

HTTP/1.1 201 Created Location: https://localhost:9443/api/am/publisher/v0.13/apis/7a2298c4-c905-403f-8fac-38c73301631f Content-Type: application/json { "id": "7a2298c4-c905-403f-8fac-38c73301631f", "name": "PizzaShackAPI", "description": "This document describe a RESTFul API for Pizza Shack online pizza delivery store.\r\n", "context": "/pizzashack", "version": "1.0.0", "provider": "admin", "apiDefinition": "{\"paths\":{\"/order\":{\"post\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Create a new Order\",\"parameters\":[{\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Order object that needs to be added\",\"name\":\"body\",\"required\":true,\"in\":\"body\"}],\"responses\":{\"201\":{\"headers\":{\"Location\":{\"description\":\"The URL of the newly created resource.\",\"type\":\"string\"}},\"schema\":{\"$ref\":\"#/definitions/Order\"},\"description\":\"Created.\"}}}},\"/menu\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"description\":\"Return a list of available menu items\",\"parameters\":[],\"responses\":{\"200\":{\"headers\":{},\"schema\":{\"title\":\"Menu\",\"properties\":{\"list\":{\"items\":{\"$ref\":\"#/definitions/MenuItem\"},\"type\":\"array\"}},\"type\":\"object\"},\"description\":\"OK.\"}}}}},\"schemes\":[\"https\"],\"produces\":[\"application/json\"],\"swagger\":\"2.0\",\"definitions\":{\"MenuItem\":{\"title\":\"Pizza menu Item\",\"properties\":{\"price\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"image\":{\"type\":\"string\"}},\"required\":[\"name\"]},\"Order\":{\"title\":\"Pizza Order\",\"properties\":{\"customerName\":{\"type\":\"string\"},\"delivered\":{\"type\":\"boolean\"},\"address\":{\"type\":\"string\"},\"pizzaType\":{\"type\":\"string\"},\"creditCardNumber\":{\"type\":\"string\"},\"quantity\":{\"type\":\"number\"},\"orderId\":{\"type\":\"integer\"}},\"required\":[\"orderId\"]}},\"consumes\":[\"application/json\"],\"info\":{\"title\":\"PizzaShackAPI\",\"description\":\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\n\",\"license\":{\"name\":\"Apache 2.0\",\"url\":\"http://www.apache.org/licenses/LICENSE-2.0.html\"},\"contact\":{\"email\":\"architecture@pizzashack.com\",\"name\":\"John Doe\",\"url\":\"http://www.pizzashack.com\"},\"version\":\"1.0.0\"}}", "wsdlUri": null, "responseCaching": "Disabled", "cacheTimeout": 300, "destinationStatsEnabled": null, "isDefaultVersion": false, "type": "HTTP", "transport": [ "http", "https" ], "tags": ["pizza"], "tiers": ["Unlimited"], "maxTps": { "sandbox": 5000, "production": 1000 }, "thumbnailUri": null, "visibility": "PUBLIC", "visibleRoles": [],\r "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", "endpointSecurity": { "username": "user", "type": "basic", "password": "pass" }, "gatewayEnvironments": "Production and Sandbox", "sequences": [{"name":"json_validator","type":"in","id":"142ece76-b208-4aab-b29a-f382045ed066","shared":false},{"name":"log_out_message","type":"out","id":"b3527be8-95e6-41e0-8097-3276987b7d4b","shared":false}], "subscriptionAvailability": null, "subscriptionAvailableTenants": [], "businessInformation": { "businessOwnerEmail": "marketing@pizzashack.com", "technicalOwnerEmail": "architecture@pizzashack.com", "technicalOwner": "John Doe", "businessOwner": "Jane Roe" }, "corsConfiguration": { "accessControlAllowOrigins": ["*"], "accessControlAllowHeaders": [ "authorization", "Access-Control-Allow-Origin", "Content-Type", "SOAPAction" ], "accessControlAllowMethods": [ "GET", "PUT", "POST", "DELETE", "PATCH", "OPTIONS" ], "accessControlAllowCredentials": false, "corsConfigurationEnabled": false } }

Sample CURL

curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -H "Content-Type: application/json" -X POST -d @data.json https://localhost:9443/api/am/publisher/v0.13/apis

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