All Downloads are FREE. Search and download functionalities are using the official Maven repository.

on.apimgt.org.wso2.carbon.apimgt.rest.api.publisher.7.0.118.source-code.publisher-api.yaml Maven / Gradle / Ivy

swagger: '2.0'
######################################################
# Prolog
######################################################
info:
  version: "v1.0"
  title: "WSO2 API Manager - Publisher API"
  description: |
    This specifies a **RESTful API** for WSO2 **API Manager** - Publisher.

    Please see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/v6.0.4/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher/src/main/resources/publisher-api.yaml) of the API which is written using [swagger 2.0](http://swagger.io/) specification.
  contact:
    name: "WSO2"
    url: "http://wso2.com/products/api-manager/"
    email: "[email protected]"
  license:
    name: "Apache 2.0"
    url: "http://www.apache.org/licenses/LICENSE-2.0.html"

######################################################
# The fixed parts of the URLs of the API
######################################################

# The schemes supported by the API
schemes:
  - https
  - http

# The domain of the API.
# This is configured by the customer during deployment.
# The given host is just an example.
host: apis.wso2.com

# The base path of the API.
# Will be prefixed to all paths.
basePath: /api/am/publisher/v1.0

# The following media types can be passed as input in message bodies of the API.
# The actual media type must be specified in the Content-Type header field of the request.
# The default is json, i.e. the Content-Type header is not needed to
# be set, but supporting it serves extensibility.
consumes:
  - application/json

# The following media types may be passed as output in message bodies of the API.
# The media type(s) consumable by the requester is specified in the Accept header field
# of the corresponding request.
# The actual media type returned will be specified in the Content-Type header field
# of the of the response.
# The default of the Accept header is json, i.e. there is not needed to
# set the value, but supporting it serves extensibility.
produces:
  - application/json

securityDefinitions:
  OAuth2Security:
    type: oauth2
    flow: password
    tokenUrl: https://localhost:9443/token
    scopes:
      apim:api_view: View API
      apim:api_create: Create API
      apim:api_update: Update API
      apim:api_delete: Delete API
      apim:apidef_update: Update API Definition
      apim:api_publish: Publish API
      apim:subscription_view: View Subscription
      apim:subscription_block: Block Subscription
      apim:dedicated_gateway: Update Dedicated Gateway
      apim:external_services_discover: Discover External Services

security:
  - OAuth2Security:
    - apim:api_view

######################################################
# The "API Collection" resource APIs
######################################################
paths:
  /apis:

#-----------------------------------------------------
# Retrieving the list of all APIs qualifying under a given search condition
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9443/api/am/publisher/v1.0/apis"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"previous\": \"\",\n   \"list\":    [\n            {\n         \"provider\": \"admin\",\n         \"version\": \"1.0.0\",\n         \"description\": \"This sample API provides Account Status Validation\",\n         \"name\": \"AccountVal\",\n         \"context\": \"/account\",\n         \"id\": \"2e81f147-c8a8-4f68-b4f0-69e0e7510b01\",\n         \"lifeCycleStatus\": \"PUBLISHED\"\n      },\n            {\n         \"provider\": \"admin\",\n         \"version\": \"1.0.0\",\n         \"description\": null,\n         \"name\": \"api1\",\n         \"context\": \"/api1\",\n         \"id\": \"3e22d2fb-277a-4e9e-8c7e-1c0f7f73960e\",\n         \"lifeCycleStatus\": \"PUBLISHED\"\n      }\n   ],\n   \"next\": \"\",\n   \"count\": 2\n}"
      summary: |
        Retrieve/Search APIs
      description: |
        This operation provides you a list of available APIs qualifying under a given search condition.

        Each retrieved API is represented with a minimal amount of attributes. If you want to get complete details of an API, you need to use **Get details of an API** operation.
      parameters:
        - $ref : '#/parameters/limit'
        - $ref : '#/parameters/offset'
        - name : query
          in: query
          description: |
            **Search condition**.

            You can search in attributes by using an **":"** modifier.

            Eg.
            "provider:wso2" will match an API if the provider of the API is exactly "wso2".

            Additionally you can use wildcards.

            Eg.
            "provider:wso2*" will match an API if the provider of the API starts with "wso2".

            Supported attribute modifiers are [**version, context, lifeCycleStatus,
            description, subcontext, doc, provider**]

            If no advanced attribute modifier has been specified, search will match the
            given query string against API Name.

          type: string
        - $ref : "#/parameters/If-None-Match"
      tags:
        - API (Collection)
      responses:
        200:
          description: |
            OK.
            List of qualifying APIs is returned.
          schema:
            $ref: '#/definitions/APIList'
          headers:
            Content-Type:
              description: The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# The attibutes of the API existance check resource
#-----------------------------------------------------
    head:
      x-wso2-curl: "curl -I -k -X HEAD \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9090/api/am/publisher/v1.0/apis?query=name%3AapiName"
      x-wso2-request: |
        HEAD https://localhost:9090/api/am/publisher/v1.0/apis?query=name%3AapiName HTTP/1.1
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK
                        Connection: keep-alive
                        Content-Length: 0"
      summary: |
        Check given API attibute name is already exist
      description: |
            Using this operation, you can check a given API context is already used. You need to provide the context name you want to check.
      parameters:
        - name : query
          in: query
          description: |
            **Search condition**.

            You can search in attributes by using an **":"** modifier.

            Eg.
            "provider:wso2" will match an API if the provider of the API is exactly "wso2".

            Additionally you can use wildcards.

            Eg.
            "provider:wso2*" will match an API if the provider of the API starts with "wso2".

            Supported attribute modifiers are [**version, context, lifeCycleStatus,
            description, subcontext, doc, provider**]

            If no advanced attribute modifier has been specified, search will match the
            given query string against API Name.

          type: string
        - $ref : "#/parameters/If-None-Match"
      tags:
        - API (Collection)
      responses:
        200:
          description: |
            OK.
            Requested API attibute status is returned
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
        400:
            description: |
              Bad Request.
              Requested API attribute does not meet requiremnts.
        404:
          description: |
            Not Found.
            Requested API attribute does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'
#-----------------------------------------------------
# Create a new API
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json https://127.0.0.1:9443/api/am/publisher/v1.0/apis"
      x-wso2-request: "POST https://127.0.0.1:9443/api/am/publisher/v1.0/apis\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\r\n   \"name\": \"PizzaShackAPI\",\r\n   \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n   \"context\": \"/pizzashack\",\r\n   \"version\": \"1.0.0\",\r\n   \"provider\": \"admin\",\r\n   \"wsdlUri\": null,\r\n   \"lifeCycleStatus\": \"PUBLISHED\",\r\n   \"responseCaching\": \"Disabled\",\r\n   \"cacheTimeout\": 300,\r\n   \"destinationStatsEnabled\": false,\r\n   \"isDefaultVersion\": false,\r\n   \"transport\":    [\r\n      \"http\",\r\n      \"https\"\r\n   ],\r\n   \"tags\": [\"pizza\"],\r\n   \"policies\": [\"Unlimited\"],\r\n   \"maxTps\":    {\r\n      \"sandbox\": 5000,\r\n      \"production\": 1000\r\n   },\r\n   \"visibility\": \"PUBLIC\",\r\n   \"visibleRoles\": [],\r\n   \"visibleTenants\": [],\r\n   \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n   \"endpointSecurity\":    {\r\n      \"username\": \"user\",\r\n      \"type\": \"basic\",\r\n      \"password\": \"pass\"\r\n   },\r\n   \"gatewayEnvironments\": \"Production and Sandbox\",\r\n   \"sequences\": [],\r\n   \"subscriptionAvailability\": null,\r\n   \"subscriptionAvailableTenants\": [],\r\n   \"businessInformation\":    {\r\n      \"businessOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwner\": \"John Doe\",\r\n      \"businessOwner\": \"Jane Roe\"\r\n   },\r\n   \"corsConfiguration\":    {\r\n      \"accessControlAllowOrigins\": [\"*\"],\r\n      \"accessControlAllowHeaders\":       [\r\n         \"authorization\",\r\n         \"Access-Control-Allow-Origin\",\r\n         \"Content-Type\",\r\n         \"SOAPAction\"\r\n      ],\r\n      \"accessControlAllowMethods\":       [\r\n         \"GET\",\r\n         \"PUT\",\r\n         \"POST\",\r\n         \"DELETE\",\r\n         \"PATCH\",\r\n         \"OPTIONS\"\r\n      ],\r\n      \"accessControlAllowCredentials\": false,\r\n      \"corsConfigurationEnabled\": false\r\n   }\r\n}"
      x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://127.0.0.1:9443/api/am/publisher/v1.0/apis/7a2298c4-c905-403f-8fac-38c73301631f\nContent-Type: application/json\n\n{\r\n   \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n   \"name\": \"PizzaShackAPI\",\r\n   \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n   \"context\": \"/pizzashack\",\r\n   \"version\": \"1.0.0\",\r\n   \"provider\": \"admin\",\r\n   \"wsdlUri\": null,\r\n   \"lifeCycleStatus\": \"CREATED\",\r\n   \"responseCaching\": \"Disabled\",\r\n   \"cacheTimeout\": 300,\r\n   \"destinationStatsEnabled\": null,\r\n   \"isDefaultVersion\": false,\r\n   \"transport\":    [\r\n      \"http\",\r\n      \"https\"\r\n   ],\r\n   \"tags\": [\"pizza\"],\r\n   \"policies\": [\"Unlimited\"],\r\n   \"maxTps\":    {\r\n      \"sandbox\": 5000,\r\n      \"production\": 1000\r\n   },\r\n   \"visibility\": \"PUBLIC\",\r\n   \"visibleRoles\": [],\r\n   \"visibleTenants\": [],\r\n   \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n   \"endpointSecurity\":    {\r\n      \"username\": \"user\",\r\n      \"type\": \"basic\",\r\n      \"password\": \"pass\"\r\n   },\r\n   \"gatewayEnvironments\": \"Production and Sandbox\",\r\n   \"sequences\": [],\r\n   \"subscriptionAvailability\": null,\r\n   \"subscriptionAvailableTenants\": [],\r\n   \"businessInformation\":    {\r\n      \"businessOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwner\": \"John Doe\",\r\n      \"businessOwner\": \"Jane Roe\"\r\n   },\r\n   \"corsConfiguration\":    {\r\n      \"accessControlAllowOrigins\": [\"*\"],\r\n      \"accessControlAllowHeaders\":       [\r\n         \"authorization\",\r\n         \"Access-Control-Allow-Origin\",\r\n         \"Content-Type\",\r\n         \"SOAPAction\"\r\n      ],\r\n      \"accessControlAllowMethods\":       [\r\n         \"GET\",\r\n         \"PUT\",\r\n         \"POST\",\r\n         \"DELETE\",\r\n         \"PATCH\",\r\n         \"OPTIONS\"\r\n      ],\r\n      \"accessControlAllowCredentials\": false,\r\n      \"corsConfigurationEnabled\": false\r\n   }\r\n}"
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Create a new API
      description: |
        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.
      parameters:
        - in: body
          name: body
          description: |
            API object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/API'
      tags:
        - API (Collection)
      responses:
        201:
          description: |
            Created.
            Successful response with the newly created object as entity in the body.
            Location header contains URL of newly created entity.
          schema:
            $ref: '#/definitions/API'
          headers:
            Location:
              description: |
                The URL of the newly created resource.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        415:
          description: |
            Unsupported Media Type.
            The entity of the request was in a not supported format.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Individual API" resource APIs
######################################################
  /apis/{apiId}:

#-----------------------------------------------------
# Retrieve the details of an API definition
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9443/api/am/publisher/v1.0/apis/7a2298c4-c905-403f-8fac-38c73301631f"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/7a2298c4-c905-403f-8fac-38c73301631f
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n   \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n   \"name\": \"PizzaShackAPI\",\r\n   \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n   \"context\": \"/pizzashack\",\r\n   \"version\": \"1.0.0\",\r\n   \"provider\": \"admin\",\r\n   \"endpointId\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-policy\\\":\\\"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-policy\\\":\\\"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\\\":\\\"[email protected]\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n   \"wsdlUri\": null,\r\n   \"lifeCycleStatus\": \"CREATED\",\r\n   \"responseCaching\": \"Disabled\",\r\n   \"cacheTimeout\": 300,\r\n   \"destinationStatsEnabled\": null,\r\n   \"isDefaultVersion\": false,\r\n   \"transport\":    [\r\n      \"http\",\r\n      \"https\"\r\n   ],\r\n   \"tags\": [\"pizza\"],\r\n   \"policies\": [\"Unlimited\"],\r\n   \"maxTps\":    {\r\n      \"sandbox\": 5000,\r\n      \"production\": 1000\r\n   },\r\n   \"visibility\": \"PUBLIC\",\r\n   \"visibleRoles\": [],\r\n   \"visibleTenants\": [],\r\n   \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n   \"endpointSecurity\":    {\r\n      \"username\": \"user\",\r\n      \"type\": \"basic\",\r\n      \"password\": \"pass\"\r\n   },\r\n   \"gatewayEnvironments\": \"Production and Sandbox\",\r\n   \"sequences\": [],\r\n   \"subscriptionAvailability\": null,\r\n   \"subscriptionAvailableTenants\": [],\r\n   \"businessInformation\":    {\r\n      \"businessOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwner\": \"John Doe\",\r\n      \"businessOwner\": \"Jane Roe\"\r\n   },\r\n   \"corsConfiguration\":    {\r\n      \"accessControlAllowOrigins\": [\"*\"],\r\n      \"accessControlAllowHeaders\":       [\r\n         \"authorization\",\r\n         \"Access-Control-Allow-Origin\",\r\n         \"Content-Type\",\r\n         \"SOAPAction\"\r\n      ],\r\n      \"accessControlAllowMethods\":       [\r\n         \"GET\",\r\n         \"PUT\",\r\n         \"POST\",\r\n         \"DELETE\",\r\n         \"PATCH\",\r\n         \"OPTIONS\"\r\n      ],\r\n      \"accessControlAllowCredentials\": false,\r\n      \"corsConfigurationEnabled\": false\r\n   }\r\n}"
      summary: Get details of an API
      description: |
        Using this operation, you can retrieve complete details of a single API. You need to provide the Id of the API to retrive it.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Requested API is returned
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
          schema:
            $ref: '#/definitions/API'
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update the definition of an API
#-----------------------------------------------------
    put:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://127.0.0.1:9443/api/am/publisher/v1.0/apis/7a2298c4-c905-403f-8fac-38c73301631f"
      x-wso2-request: "PUT https://127.0.0.1:9443/api/am/publisher/v1.0/apis/7a2298c4-c905-403f-8fac-38c73301631f\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\r\n   \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n   \"name\": \"PizzaShackAPI\",\r\n   \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n   \"context\": \"/pizzashack\",\r\n   \"version\": \"1.0.0\",\r\n   \"provider\": \"admin\",\r\n   \"endpointId\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-policy\\\":\\\"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-policy\\\":\\\"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\\\":\\\"[email protected]\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n   \"wsdlUri\": null,\r\n   \"lifeCycleStatus\": \"CREATED\",\r\n   \"responseCaching\": \"Disabled\",\r\n   \"cacheTimeout\": 300,\r\n   \"destinationStatsEnabled\": null,\r\n   \"isDefaultVersion\": false,\r\n   \"transport\":    [\r\n      \"https\"\r\n   ],\r\n   \"tags\": [\"pizza\",\"chicken\"],\r\n   \"policies\": [\"Unlimited\"],\r\n   \"maxTps\":    {\r\n      \"sandbox\": 500,\r\n      \"production\": 100\r\n   },\r\n   \"visibility\": \"PUBLIC\",\r\n   \"visibleRoles\": [],\r\n   \"visibleTenants\": [],\r\n   \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n   \"endpointSecurity\":    {\r\n      \"username\": \"user\",\r\n      \"type\": \"basic\",\r\n      \"password\": \"pass\"\r\n   },\r\n   \"gatewayEnvironments\": \"Production and Sandbox\",\r\n   \"sequences\": [],\r\n   \"subscriptionAvailability\": null,\r\n   \"subscriptionAvailableTenants\": [],\r\n   \"businessInformation\":    {\r\n      \"businessOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwner\": \"John Doe\",\r\n      \"businessOwner\": \"Jane Roe\"\r\n   },\r\n   \"corsConfiguration\":    {\r\n      \"accessControlAllowOrigins\": [\"*\"],\r\n      \"accessControlAllowHeaders\":       [\r\n         \"authorization\",\r\n         \"Access-Control-Allow-Origin\",\r\n         \"Content-Type\",\r\n         \"SOAPAction\"\r\n      ],\r\n      \"accessControlAllowMethods\":       [\r\n         \"GET\",\r\n         \"PUT\",\r\n         \"POST\",\r\n         \"DELETE\",\r\n         \"PATCH\",\r\n         \"OPTIONS\"\r\n      ],\r\n      \"accessControlAllowCredentials\": false,\r\n      \"corsConfigurationEnabled\": false\r\n   }\r\n}"
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n   \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n   \"name\": \"PizzaShackAPI\",\r\n   \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n   \"context\": \"/pizzashack\",\r\n   \"version\": \"1.0.0\",\r\n   \"provider\": \"admin\",\r\n   \"endpointId\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-policy\\\":\\\"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-policy\\\":\\\"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\\\":\\\"[email protected]\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n   \"wsdlUri\": null,\r\n   \"lifeCycleStatus\": \"CREATED\",\r\n   \"responseCaching\": \"Disabled\",\r\n   \"cacheTimeout\": 300,\r\n   \"destinationStatsEnabled\": null,\r\n   \"isDefaultVersion\": false,\r\n   \"transport\": [\"https\"],\r\n   \"tags\":    [\r\n      \"chicken\",\r\n      \"pizza\"\r\n   ],\r\n   \"policies\": [\"Unlimited\"],\r\n   \"maxTps\":    {\r\n      \"sandbox\": 500,\r\n      \"production\": 100\r\n   },\r\n   \"visibility\": \"PUBLIC\",\r\n   \"visibleRoles\": [],\r\n   \"visibleTenants\": [],\r\n   \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n   \"endpointSecurity\":    {\r\n      \"username\": \"user\",\r\n      \"type\": \"basic\",\r\n      \"password\": \"pass\"\r\n   },\r\n   \"gatewayEnvironments\": \"Production and Sandbox\",\r\n   \"sequences\": [],\r\n   \"subscriptionAvailability\": null,\r\n   \"subscriptionAvailableTenants\": [],\r\n   \"businessInformation\":    {\r\n      \"businessOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwner\": \"John Doe\",\r\n      \"businessOwner\": \"Jane Roe\"\r\n   },\r\n   \"corsConfiguration\":    {\r\n      \"accessControlAllowOrigins\": [\"*\"],\r\n      \"accessControlAllowHeaders\":       [\r\n         \"authorization\",\r\n         \"Access-Control-Allow-Origin\",\r\n         \"Content-Type\",\r\n         \"SOAPAction\"\r\n      ],\r\n      \"accessControlAllowMethods\":       [\r\n         \"GET\",\r\n         \"PUT\",\r\n         \"POST\",\r\n         \"DELETE\",\r\n         \"PATCH\",\r\n         \"OPTIONS\"\r\n      ],\r\n      \"accessControlAllowCredentials\": false,\r\n      \"corsConfigurationEnabled\": false\r\n   }\r\n}"
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Update an API
      description: |
        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.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: body
          name: body
          description: |
            API object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/API'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Successful response with updated API object
          schema:
            $ref: '#/definitions/API'
          headers:
            Location:
              description: |
                The URL of the newly created resource.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        403:
          description: |
            Forbidden.
            The request must be conditional but no condition has been specified.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Delete the definition of an API
#-----------------------------------------------------
    delete:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/apis/6fb74674-4ab8-4b52-9886-f9a376985060"
      x-wso2-request: |
        DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/apis/6fb74674-4ab8-4b52-9886-f9a376985060
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK"
      security:
        - OAuth2Security:
          - apim:api_delete
      summary: Delete an API
      description: |
        This operation can be used to delete an existing API proving the Id of the API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Resource successfully deleted.
        403:
          description: |
            Forbidden.
            The request must be conditional but no condition has been specified.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            Resource to be deleted does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

################################################################
# The swagger resource of "Individual API" resource APIs
################################################################

  /apis/{apiId}/swagger:
#-----------------------------------------------------
# Retrieve the API swagger definition
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 329\n\n{\n   \"paths\": {\"/*\": {\"get\":    {\n      \"x-auth-type\": \"Application\",\n      \"x-throttling-policy\": \"Unlimited\",\n      \"responses\": {\"200\": {\"description\": \"OK\"}}\n   }}},\n   \"swagger\": \"2.0\",\n   \"info\":    {\n      \"title\": \"PhoneVerification\",\n      \"description\": \"Verify a phone number\",\n      \"contact\":       {\n         \"email\": \"[email protected]\",\n         \"name\": \"xx\"\n      },\n      \"version\": \"1.0.0\"\n   }\n}"
      summary: Get swagger definition
      description: |
        This operation can be used to retrieve the swagger definition of an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          schema:
             type: string
             example: ""
          description: |
            OK.
            Requested swagger document of the API is returned
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update the API swagger definition
#-----------------------------------------------------
    put:
      consumes:
        - multipart/form-data
      x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -F endpointId=\"{\\\"paths\\\":{\\\"\\/*\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application\\\",\\\"x-throttling-policy\\\":\\\"Unlimited\\\",\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"OK\\\"}}}}},\\\"swagger\\\":\\\"2.0\\\",\\\"info\\\":{\\\"title\\\":\\\"PhoneVerification\\\",\\\"description\\\":\\\"Verify a phone number\\\",\\\"contact\\\":{\\\"email\\\":\\\"[email protected]\\\",\\\"name\\\":\\\"xx\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\" -X PUT \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger\""
      x-wso2-request: |
       PUT https://127.0.0.1:9443/api/am/publisher/v1.0/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-policy":"Unlimited","responses":{"200":{"description":"OK"}}}}},"swagger":"2.0","info":{"title":"PhoneVerification","description":"Verify a phone number","contact":{"email":"[email protected]","name":"xx"},"version":"1.0.0"}}
       --------------------------4f51e636c0003d99--
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"paths\": {\"/*\": {\"get\":    {\n      \"x-auth-type\": \"Application\",\n      \"x-throttling-policy\": \"Unlimited\",\n      \"responses\": {\"200\": {\"description\": \"OK\"}}\n   }}},\n   \"swagger\": \"2.0\",\n   \"info\":    {\n      \"title\": \"PhoneVerification\",\n      \"description\": \"Verify a phone number\",\n      \"contact\":       {\n         \"email\": \"[email protected]\",\n         \"name\": \"xx\"\n      },\n      \"version\": \"1.0.0\"\n   }\n}"
      security:
        - OAuth2Security:
          - apim:apidef_update
      summary: Update swagger definition
      description: |
        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`.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: formData
          name: endpointId
          description: Swagger definition of the API
          type: string
          required: true
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Successful response with updated Swagger definition
          headers:
            Location:
              description: |
                The URL of the newly created resource.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        403:
          description: |
            Forbidden.
            The request must be conditional but no condition has been specified.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

################################################################
# The WSDL resource of "Individual API" resource APIs
################################################################

  /apis/{apiId}/wsdl:
#-----------------------------------------------------
# Retrieve the API's WSDL
#-----------------------------------------------------
    get:
      security:
        - OAuth2Security:
          - apim:api_view
      produces:
        - application/octet-stream
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9292/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/wsdl"
      x-wso2-request: |
        GET https://127.0.0.1:9292/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/wsdl
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 329\n\n{\n   \"paths\": {\"/*\": {\"get\":    {\n      \"x-auth-type\": \"Application\",\n      \"x-throttling-policy\": \"Unlimited\",\n      \"responses\": {\"200\": {\"description\": \"OK\"}}\n   }}},\n   \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n   \"swagger\": \"2.0\",\n   \"info\":    {\n      \"title\": \"PhoneVerification\",\n      \"description\": \"Verify a phone number\",\n      \"contact\":       {\n         \"email\": \"[email protected]\",\n         \"name\": \"xx\"\n      },\n      \"version\": \"1.0.0\"\n   }\n}"
      summary: Get swagger definition
      description: |
        This operation can be used to retrieve the swagger definition of an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Requested WSDL document of the API is returned
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update the API's WSDL
#-----------------------------------------------------
    put:
      consumes:
        - multipart/form-ldata
      security:
        - OAuth2Security:
          - apim:api_create
      x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -F inlineContent=\"{\\\"paths\\\":{\\\"\\/*\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application\\\",\\\"x-throttling-policy\\\":\\\"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\\\":\\\"[email protected]\\\",\\\"name\\\":\\\"xx\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\" -X PUT \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/wsdl\""
      x-wso2-request: |
       PUT https://127.0.0.1:9443/api/am/publisher/v1.0/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/wsdl
       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-policy":"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":"[email protected]","name":"xx"},"version":"1.0.0"}}
       --------------------------4f51e636c0003d99--
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"paths\": {\"/*\": {\"get\":    {\n      \"x-auth-type\": \"Application\",\n      \"x-throttling-policy\": \"Unlimited\",\n      \"responses\": {\"200\": {\"description\": \"OK\"}}\n   }}},\n   \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n   \"swagger\": \"2.0\",\n   \"info\":    {\n      \"title\": \"PhoneVerification\",\n      \"description\": \"Verify a phone number\",\n      \"contact\":       {\n         \"email\": \"[email protected]\",\n         \"name\": \"xx\"\n      },\n      \"version\": \"1.0.0\"\n   }\n}"
      summary: Update WSDL definition
      description: |
        This operation can be used to update the WSDL definition of an existing API. WSDL to be updated is passed as a form data parameter `inlineContent`.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: formData
          name: file
          description: WSDL file or archive to upload
          type: file
          required: true
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Successful response with updated WSDL definition
          headers:
            Location:
              description: |
                The URL of the newly created resource.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        403:
          description: |
            Forbidden.
            The request must be conditional but no condition has been specified.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

################################################################
# The gateway config resource of "Individual API" resource APIs
################################################################

  /apis/{apiId}/gateway-config:
#-----------------------------------------------------
# Retrieve the API gateway configuration
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 329\n\n{\n   \"paths\": {\"/*\": {\"get\":    {\n      \"x-auth-type\": \"Application\",\n      \"x-throttling-policy\": \"Unlimited\",\n      \"responses\": {\"200\": {\"description\": \"OK\"}}\n   }}},\n   \"swagger\": \"2.0\",\n   \"info\":    {\n      \"title\": \"PhoneVerification\",\n      \"description\": \"Verify a phone number\",\n      \"contact\":       {\n         \"email\": \"[email protected]\",\n         \"name\": \"xx\"\n      },\n      \"version\": \"1.0.0\"\n   }\n}"
      summary: Get gateway definition
      description: |
        This operation can be used to retrieve the gateway configuration of an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Requested gateway configuration of the API is returned
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update the API gateway config
#-----------------------------------------------------
    put:
      consumes:
        - multipart/form-data
      x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -F endpointId=\"{\\\"paths\\\":{\\\"\\/*\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application\\\",\\\"x-throttling-policy\\\":\\\"Unlimited\\\",\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"OK\\\"}}}}},\\\"swagger\\\":\\\"2.0\\\",\\\"info\\\":{\\\"title\\\":\\\"PhoneVerification\\\",\\\"description\\\":\\\"Verify a phone number\\\",\\\"contact\\\":{\\\"email\\\":\\\"[email protected]\\\",\\\"name\\\":\\\"xx\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\" -X PUT \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger\""
      x-wso2-request: |
       PUT https://127.0.0.1:9443/api/am/publisher/v1.0/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-policy":"Unlimited","responses":{"200":{"description":"OK"}}}}},"swagger":"2.0","info":{"title":"PhoneVerification","description":"Verify a phone number","contact":{"email":"[email protected]","name":"xx"},"version":"1.0.0"}}
       --------------------------4f51e636c0003d99--
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"paths\": {\"/*\": {\"get\":    {\n      \"x-auth-type\": \"Application\",\n      \"x-throttling-policy\": \"Unlimited\",\n      \"responses\": {\"200\": {\"description\": \"OK\"}}\n   }}},\n   \"swagger\": \"2.0\",\n   \"info\":    {\n      \"title\": \"PhoneVerification\",\n      \"description\": \"Verify a phone number\",\n      \"contact\":       {\n         \"email\": \"[email protected]\",\n         \"name\": \"xx\"\n      },\n      \"version\": \"1.0.0\"\n   }\n}"
      security:
        - OAuth2Security:
          - apim:apidef_update
      summary: Update gateway configuration
      description: |
        This operation can be used to update the gateway configuration of an existing API. gateway configuration to be updated is passed as a form data parameter `gatewayConfig`.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: formData
          name: gatewayConfig
          description: gateway configuration of the API
          type: string
          required: true
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Successful response with updated gateway configuration
          headers:
            Location:
              description: |
                The URL of the newly created resource.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        403:
          description: |
            Forbidden.
            The request must be conditional but no condition has been specified.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

################################################################
# The thumbnail resource of "Individual API" resource APIs
################################################################

  /apis/{apiId}/thumbnail:
#-------------------------------------------------------------------------------------------------
# Downloads a thumbnail image of an API
#-------------------------------------------------------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://127.0.0.1:9443/api/am/publisher/v1.0/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail > image.jpg"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail
        Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9
      x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: image/jpeg\r\n\r\n[image content]"
      summary: Get thumbnail image
      description: |
        This operation can be used to download a thumbnail image of an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Thumbnail image returned
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested Document does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#----------------------------------------------------------------------------
# Upload a thumbnail image to a certain API
#----------------------------------------------------------------------------
    post:
      consumes:
        - multipart/form-data
      x-wso2-curl: "curl -X POST -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://127.0.0.1:9443/api/am/publisher/v1.0/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail -F [email protected]"
      x-wso2-request: |
        POST https://127.0.0.1:9443/api/am/publisher/v1.0/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--
      x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://127.0.0.1:9443/api/am/publisher/v1.0/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\r\nContent-Type: application/json\r\n\r\n{\r\n   \"relativePath\": \"/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\",\r\n   \"mediaType\": \"image/jpeg\"\r\n}"
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Upload a thumbnail image
      description: |
        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`.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: formData
          name: file
          description: Image to upload
          type: file
          required: true
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Image updated
          schema:
            $ref : '#/definitions/FileInfo'
          headers:
            Location:
              description: |
                The URL of the uploaded thumbnail image of the API.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Threat Protection" resource API
######################################################
  /apis/{apiId}/threat-protection-policies:
    post:
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Add a threat protection policy to an API
      parameters:
        - $ref: '#/parameters/apiId'
        - name: policyId
          in: query
          description: Threat protection policy id
          type: string
          required: true
      tags:
        - API (Individual)
      responses:
        200:
          description: Ok. Policy added succesfuly.
        500:
          description: Internal server error while adding policy
          schema:
            $ref: '#/definitions/Error'
        404:
          description: Specified API or Policy not found
          schema:
            $ref: '#/definitions/Error'

    get:
      summary: Get all threat protection policies associated with an API
      parameters:
        - $ref: '#/parameters/apiId'
      tags:
        - API (Individual)
      responses:
        200:
          description: Ok. List of policy ids is returned
          schema:
            type: array
            items:
              type: string
        404:
          description: Specified API was not found.
          schema:
            $ref: '#/definitions/Error'
        500:
          description: Error retrieving threat protection policies
          schema:
            $ref: '#/definitions/Error'

    delete:
      summary: Delete a threat protection policy from an API
      parameters:
        - $ref: '#/parameters/apiId'
        - name: policyId
          in: query
          description: Threat protection policy id
          type: string
          required: true
      tags:
        - API (Individual)
      responses:
        200:
          description: Ok. Policy deleted successfully.
        404:
          description: Specified API or Policy not found
          schema:
            $ref: '#/definitions/Error'
        500:
          description: Error while deleting the policy
          schema:
            $ref: '#/definitions/Error'


######################################################
# The "Copy API" Processing Function resource API
######################################################
  /apis/copy-api:

#-----------------------------------------------------
# Create a new API based on an already existing one
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0\""
      x-wso2-request: |
        POST https://127.0.0.1:9443/api/am/publisher/v1.0/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://127.0.0.1:9443/api/am/publisher/v1.0/apis/25a84fc9-38c0-4578-95e8-29fb6b1c4771\nContent-Type: application/json\n\n{\r\n   \"id\": \"25a84fc9-38c0-4578-95e8-29fb6b1c4771\",\r\n   \"name\": \"PizzaShackAPI\",\r\n   \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n   \"context\": \"/pizzashack\",\r\n   \"version\": \"2.0.0\",\r\n   \"provider\": \"admin\",\r\n   \"endpointId\": \"{\\\"paths\\\":{\\\"\\\\/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-policy\\\":\\\"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-policy\\\":\\\"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\\\":\\\"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\\\":\\\"[email protected]\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.pizzashack.com\\\"},\\\"version\\\":\\\"2.0.0\\\"}}\",\r\n   \"wsdlUri\": null,\r\n   \"lifeCycleStatus\": \"CREATED\",\r\n   \"responseCaching\": \"Disabled\",\r\n   \"cacheTimeout\": 300,\r\n   \"destinationStatsEnabled\": null,\r\n   \"isDefaultVersion\": false,\r\n   \"transport\": [\"https\"],\r\n   \"tags\":    [\r\n      \"chicken\",\r\n      \"pizza\"\r\n   ],\r\n   \"policies\": [\"Unlimited\"],\r\n   \"maxTps\":    {\r\n      \"sandbox\": 500,\r\n      \"production\": 100\r\n   },\r\n   \"visibility\": \"PUBLIC\",\r\n   \"visibleRoles\": [],\r\n   \"visibleTenants\": [],\r\n   \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1.0/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n   \"endpointSecurity\":    {\r\n      \"username\": \"user\",\r\n      \"type\": \"basic\",\r\n      \"password\": \"pass\"\r\n   },\r\n   \"gatewayEnvironments\": \"Production and Sandbox\",\r\n   \"sequences\": [],\r\n   \"subscriptionAvailability\": null,\r\n   \"subscriptionAvailableTenants\": [],\r\n   \"businessInformation\":    {\r\n      \"businessOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwnerEmail\": \"[email protected]\",\r\n      \"technicalOwner\": \"John Doe\",\r\n      \"businessOwner\": \"Jane Roe\"\r\n   },\r\n   \"corsConfiguration\":    {\r\n      \"accessControlAllowOrigins\": [\"*\"],\r\n      \"accessControlAllowHeaders\":       [\r\n         \"authorization\",\r\n         \"Access-Control-Allow-Origin\",\r\n         \"Content-Type\",\r\n         \"SOAPAction\"\r\n      ],\r\n      \"accessControlAllowMethods\":       [\r\n         \"GET\",\r\n         \"PUT\",\r\n         \"POST\",\r\n         \"DELETE\",\r\n         \"PATCH\",\r\n         \"OPTIONS\"\r\n      ],\r\n      \"accessControlAllowCredentials\": false,\r\n      \"corsConfigurationEnabled\": false\r\n   }\r\n}"
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Create a new API version
      description: |
        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.
      parameters:
        - name: newVersion
          description: Version of the new API.
          type: string
          in: query
          required: true
        - $ref: '#/parameters/apiId-Q'
      tags:
        - API (Individual)
      responses:
        201:
          description: |
            Created.
            Successful response with the newly created API as entity in the body. Location header contains URL of newly created API.
          headers:
            Location:
              description: |
                The URL of the newly created API.
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            API to copy does not exist.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Change Lifecycle" Processing Function resource API
######################################################
  /apis/change-lifecycle:

#-----------------------------------------------------
# Change the lifecycle of an API
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish\""
      x-wso2-request: |
        POST https://127.0.0.1:9443/api/am/publisher/v1.0/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK"
      security:
        - OAuth2Security:
          - apim:api_publish
      summary: Change API Status
      description: |
        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`.

        Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information.
      parameters:
        - name: action
          description: |
            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, Move to Maintenance, Deprecate, Re-Publish, Retire **]

          in: query
          type: string
          required: true
          enum:
            - Publish
            - Deploy as a Prototype
            - Demote to Created
            - Demote to Prototyped
            - Move to Maintenance
            - Deprecate
            - Re-Publish
            - Retire
        - name: lifecycleChecklist
          description: |

            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.

            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.

          type: string
          in: query
        - $ref: '#/parameters/apiId-Q'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Lifecycle changed successfully.
          schema:
            $ref: '#/definitions/WorkflowResponse'
          headers:
            ETag:
              description: |
                Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the API lifecycle has been modified the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        202:
          description: |
            Accepted.
            The request has been accepted.
          schema:
            $ref: '#/definitions/WorkflowResponse'
          headers:
            Location:
              description: |
                Location of the newly created Application.
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        409:
          description: |
            Conflict.
            Pending workflow task exists.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'
######################################################
#  The "API State Change History"  resource API
######################################################
  /apis/{apiId}/lifecycle-history:

#--------------------------------------------
# Retrieve API LIfecycle change History
#--------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer f8828f52-175a-4cb2-b246-02b1e6054f97\" http://127.0.0.1:9090/api/am/publisher/v1.0/apis/0527a55e-8dcf-4ce5-bddf-c77e8418be8a/lifecycle-history"

      x-wso2-request: |
            GET http://127.0.0.1:9090/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-history
            Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\n Content-Type: application/json \n Content-Encoding: gzip \n Transfer-Encoding:
      chunked \n\n [ { \"postState\" : \"Created\",\n    \"updatedTime\" : \"Feb 23, 2017 5:17:02 PM\",\n\"user\" :
      \"admin\"\n  },\n { \"postState\" : \"Published\",\n    \"previousState\" : \"Created\",\n    \"updatedTime\" :
      \"Feb 23, 2017 5:17:17 PM\",\n    \"user\" : \"admin\"\n }\n]"
      security:
        - OAuth2Security:
          - apim:api_publish
      summary: Get Lifecycle state change history of the API.
      description: |
            This operation can be used to retrieve Lifecycle state change history of the API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Lifecycle state change history returned successfully.
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'
######################################################
#  The "API Lifecycle State Data"  resource API
######################################################
  /apis/{apiId}/lifecycle:

#--------------------------------------------
# Retrieve API LIfecycle state data
#--------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer f8828f52-175a-4cb2-b246-02b1e6054f97\" http://127.0.0.1:9090/api/am/publisher/v1.0/apis/0527a55e-8dcf-4ce5-bddf-c77e8418be8a/lifecycle"

      x-wso2-request: |
            GET http://127.0.0.1:9090/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle
            Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\n Content-Type: application/json \n Content-Encoding: gzip \n Transfer-Encoding:
      chunked \n\n {  \n   \"lcName\":\"API_LIFECYCLE\",\n   \"state\":\"Published\",\n   \"lifecycleId\":\"2febf145f07e457c9643100b6ec60679\",\n   \"checkItemBeanList\":[  \n\n   ],\n   \"inputBeanList\":[  \n\n   ],\n   \"customCodeBeanList\":[  \n      {  \n         \"classObject\":{  \n\n         },\n         \"targetName\":\"Maintenance\"\n      },\n      {  \n         \"classObject\":{  \n\n         },\n         \"targetName\":\"Deprecated\"\n      },\n      {  \n         \"classObject\":{  \n\n         },\n         \"targetName\":\"Created\"\n      },\n      {  \n         \"classObject\":{  \n\n         },\n         \"targetName\":\"Prototyped\"\n      }\n   ],\n   \"availableTransitionBeanList\":[  \n      {  \n         \"event\":\"Move to Maintenance\",\n         \"targetState\":\"Maintenance\"\n      },\n      {  \n         \"event\":\"Deploy as a Prototype\",\n         \"targetState\":\"Prototyped\"\n      },\n      {  \n         \"event\":\"Demote to Created\",\n         \"targetState\":\"Created\"\n      },\n      {  \n         \"event\":\"Deprecate\",\n         \"targetState\":\"Deprecated\"\n      },\n      {  \n         \"event\":\"Publish\",\n         \"targetState\":\"Published\"\n      }\n   ],\n   \"permissionBeanList\":[  \n\n   ]\n}"
      security:
        - OAuth2Security:
          - apim:api_publish
      summary: Get Lifecycle state data of the API.
      description: |
            This operation can be used to retrieve Lifecycle state data of the API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Lifecycle state data returned successfully.
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
          schema:
              $ref: '#/definitions/LifecycleState'
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
#  The "API Lifecycle State Data"  resource API
######################################################
  /apis/{apiId}/lifecycle/lifecycle-pending-task:

#--------------------------------------------
# Delete API LIfecycle state change pending task
#--------------------------------------------
    delete:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer f8828f52-175a-4cb2-b246-02b1e6054f97\" -X DELETE http://127.0.0.1:9090/api/am/publisher/v1.0/apis/0527a55e-8dcf-4ce5-bddf-c77e8418be8a/lifecycle/lifecycle-pending-task"

      x-wso2-request: |
            DELETE http://127.0.0.1:9090/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle/lifecycle-pending-task
            Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK"
      security:
        - OAuth2Security:
          - apim:api_publish
      summary: Delete pending lifecycle state change tasks.
      description: |
            This operation can be used to remove pending lifecycle state change requests that are in pending state
      parameters:
        - $ref: '#/parameters/apiId'
      tags:
        - API (Individual)
      responses:
        200:
          description: |
            OK.
            Lifecycle state change pending task removed successfully.
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'


######################################################
# The "Import API from API Definition"  resource API
######################################################

  /apis/import-definition:

  #----------------------------------------------------------------------------
  # Import API from API Definition
  #----------------------------------------------------------------------------
    post:
      consumes:
         - multipart/form-data
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Import API Definition
      description: |
         This operation can be used to create api from api definition.

         API definition can be either Swagger or a WSDL

         WSDL can be speficied as a single file or a ZIP archive with WSDLs and reference XSDs etc.
         When the type is WSDL, it is a **must** to specify additionalProperties with API's name, version, context and endpoints. See the example for additionalProperties.
      parameters:
        - in: formData
          name: type
          description: Definition type to upload
          type: string
          required: false
          enum:
          - SWAGGER
          - WSDL
          default: SWAGGER
        - in: formData
          name: file
          description: Definition to uploadas a file
          type: file
          required: false
        - in: formData
          name: url
          description: Definition url
          type: string
          required: false
        - in: formData
          name: additionalProperties
          description: Additional attributes specified as a stringified JSON with API's schema
          type: string
          required: false
        - in: formData
          name: implementationType
          type: string
          enum:
            - soap
            - httpBinding
          default: SOAP
          description: |
            Currently this is only used when creating an API using a WSDL.

            If 'SOAP' is specified, the API will be created with only one resource 'POST /' which is to be used for SOAP
            operations.

            If 'HTTP_BINDING' is specified, the API will be created with resources using HTTP binding operations
            which are extracted from the WSDL.
          required: false
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - API (Collection)
      responses:
        201:
          description: |
            Created.
            Successful response with the newly created object as entity in the body.
            Location header contains URL of newly created entity.
          schema:
            $ref: '#/definitions/API'
          headers:
            Location:
              description: |
                The URL of the newly created resource.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        415:
          description: |
            Unsupported Media Type.
            The entity of the request was in a not supported format.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Validate API Definition" utility API
######################################################

  /apis/validate-definition:
#-------------------------------------------------------------------
# Resume the workflow by approving or rejecting the workflow request
#-------------------------------------------------------------------
    post:
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Validate API definition and retrieve a summary
      consumes:
        - multipart/form-data
      description: |
        This operation can be used to validate a swagger or WSDL definition and retrieve a summary.
      parameters:
        - $ref: '#/parameters/definitionType'
        - $ref: '#/parameters/definitionFile'
        - $ref: '#/parameters/definitionUrl'
      tags:
        - API (Collection)
      responses:
        200:
          description: |
            OK.
            API definition validation information is returned
          schema:
            $ref: '#/definitions/APIDefinitionValidationResponse'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            Workflow for the given reference in not found.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Document Collection" resource APIs
######################################################
  /apis/{apiId}/documents:

#-----------------------------------------------------
# Retrieve the documents associated with an API that qualify under a search condition
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"previous\": \"\",\n   \"list\":    [\n            {\n         \"visibility\": \"API_LEVEL\",\n         \"sourceType\": \"INLINE\",\n         \"sourceUrl\": null,\n         \"otherTypeName\": null,\n         \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n         \"summary\": \"This is a sample documentation for v1.0.0\",\n         \"name\": \"PhoneVerification API Documentation\",\n         \"type\": \"HOWTO\"\n      },\n            {\n         \"visibility\": \"API_LEVEL\",\n         \"sourceType\": \"URL\",\n         \"sourceUrl\": \"http://wiki.cdyne.com/index.php/Phone_Verification\",\n         \"otherTypeName\": null,\n         \"documentId\": \"4145df31-04f1-440c-8d08-68952874622c\",\n         \"summary\": \"This is the URL for online documentation\",\n         \"name\": \"Online Documentation\",\n         \"type\": \"SAMPLES\"\n      }\n   ],\n   \"next\": \"\",\n   \"count\": 2\n}"
      summary: Get a list of documents of an API
      description: |
        This operation can be used to retrieve a list of documents belonging to an API by providing the id of the API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/offset'
        - $ref: '#/parameters/If-None-Match'
      tags:
        - Document (Collection)
      responses:
        200:
          description: |
            OK.
            Document list is returned.
          schema:
            $ref: '#/definitions/DocumentList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Add a document to a certain API
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\""
      x-wso2-request: "POST https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n    \"visibility\": \"API_LEVEL\",\n    \"sourceType\": \"INLINE\",\n    \"sourceUrl\": null,\n    \"otherTypeName\": null,\n    \"summary\": \"This is a sample documentation\",\n    \"name\": \"Introduction to PhoneVerification API\",\n    \"type\": \"HOWTO\"\n}"
      x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\nContent-Type: application/json\n\n{\n   \"visibility\": \"API_LEVEL\",\n   \"sourceType\": \"INLINE\",\n   \"sourceUrl\": null,\n   \"otherTypeName\": null,\n   \"documentId\": \"ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\",\n   \"summary\": \"This is a sample documentation\",\n   \"name\": \"Introduction to PhoneVerification API\",\n   \"type\": \"HOWTO\"\n}"
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Add a new document to an API
      description: |
        This operation can be used to add a new documentation to an API. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API document ** API once we obtain a document Id by this operation.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: body
          name: body
          description: |
            Document object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/Document'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Document (Collection)
      responses:
        201:
          description: |
            Created.
            Successful response with the newly created Document object as entity in the body.
            Location header contains URL of newly added document.
          schema:
            $ref: '#/definitions/Document'
          headers:
            Location:
              description: |
                Location to the newly created Document.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        415:
          description: |
            Unsupported media type.
            The entity of the request was in a not supported format.

######################################################
# The "Individual Document" resource APIs
######################################################
  '/apis/{apiId}/documents/{documentId}':

#-----------------------------------------------------
# Retrieve a particular document of a certain API
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"visibility\": \"API_LEVEL\",\n   \"sourceType\": \"INLINE\",\n   \"sourceUrl\": null,\n   \"otherTypeName\": null,\n   \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n   \"summary\": \"This is a sample documentation\",\n   \"name\": \"PhoneVerification API Documentation\",\n   \"type\": \"HOWTO\"\n}"
      summary: Get a document of an API
      description: |
        This operation can be used to retrieve a particular document's metadata associated with an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/documentId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - Document (Individual)
      responses:
        200:
          description: |
            OK.
            Document returned.
          schema:
            $ref: '#/definitions/Document'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested Document does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update a particular document of a certain API
#-----------------------------------------------------
    put:
      x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" -H \"Content-Type: application/json\" -X PUT -d data.json \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\""
      x-wso2-request: "PUT https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\nAuthorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\nContent-Type: application/json\n\n{\n   \"visibility\": \"API_LEVEL\",\n   \"sourceType\": \"INLINE\",\n   \"sourceUrl\": null,\n   \"otherTypeName\": null,\n   \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n   \"summary\": \"This is a sample documentation for v1.0.0\",\n   \"name\": \"PhoneVerification API Documentation\",\n   \"type\": \"HOWTO\"\n}"
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"visibility\": \"API_LEVEL\",\n   \"sourceType\": \"INLINE\",\n   \"sourceUrl\": null,\n   \"otherTypeName\": null,\n   \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n   \"summary\": \"This is a sample documentation for v1.0.0\",\n   \"name\": \"PhoneVerification API Documentation\",\n   \"type\": \"HOWTO\"\n}"
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Update a document of an API
      description: |
        This operation can be used to update metadata of an API's document.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/documentId'
        - in: body
          name: body
          description: |
            Document object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/Document'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Document (Individual)
      responses:
        200:
          description: |
            OK.
            Document updated
          schema:
            $ref: '#/definitions/Document'
          headers:
            Location:
              description: |
                The URL of the updated document.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Delete a particular document of a certain API
#-----------------------------------------------------
    delete:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058"
      x-wso2-request: |
        DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK"
      security:
        - OAuth2Security:
          - apim:api_delete
      summary: Delete a document of an API
      description: |
        This operation can be used to delete a document associated with an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/documentId'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Document (Individual)
      responses:
        200:
          description: |
            OK.
            Resource successfully deleted.
        404:
          description: |
            Not Found.
            Resource to be deleted does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

################################################################
# The content resource of "Individual Document" resource APIs
################################################################

  '/apis/{apiId}/documents/{documentId}/content':

  #-------------------------------------------------------------------------------------------------
  # Downloads a FILE type document/get the inline content or source url of a certain document
  #-------------------------------------------------------------------------------------------------
      get:
        produces:
         - application/octet-stream
        x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\" > sample.pdf"
        x-wso2-request: |
          GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content
          Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a
        x-wso2-response: "HTTP/1.1 200 OK\nContent-Disposition: attachment; filename=\"sample.pdf\"\nContent-Type: application/octet-stream\nContent-Length: 7802\n\n%PDF-1.4\n%äüöß\n2 0 obj\n<>\nstream\n..\n>>\nstartxref\n7279\n%%EOF"
        summary: Get the content of an API document
        description: |
          This operation can be used to retrive the content of an API's document.

          The document can be of 3 types. In each cases responses are different.

          1. **Inline type**:
             The content of the document will be retrieved in `text/plain` content type
          2. **FILE type**:
             The file will be downloaded with the related content type (eg. `application/pdf`)
          3. **URL type**:
              The client will recieve the URL of the document as the Location header with the response with - `303 See Other`
        parameters:
          - $ref: '#/parameters/apiId'
          - $ref: '#/parameters/documentId'
          - $ref: '#/parameters/If-None-Match'
          - $ref: '#/parameters/If-Modified-Since'
        tags:
          - Document (Individual)
        responses:
          200:
            description: |
              OK.
              File or inline content returned.
            headers:
              Content-Type:
                description: |
                  The content type of the body.
                type: string
              ETag:
                description: |
                  Entity Tag of the response resource.
                  Used by caches, or in conditional requests (Will be supported in future).
                type: string
              Last-Modified:
                description: |
                  Date and time the resource has been modifed the last time.
                  Used by caches, or in conditional requests (Will be supported in future).
                type: string
          303:
            description: |
              See Other.
              Source can be retrived from the URL specified at the Location header.
            headers:
              Location:
                description: |
                  The Source URL of the document.
                type: string
          304:
            description: |
              Not Modified.
              Empty body because the client has already the latest version of the requested resource (Will be supported in future).
          404:
            description: |
              Not Found.
              Requested Document does not exist.
            schema:
              $ref: '#/definitions/Error'
          406:
            description: |
              Not Acceptable.
              The requested media type is not supported
            schema:
              $ref: '#/definitions/Error'

  #----------------------------------------------------------------------------
  # Upload a file or add inline content to a document of a certain API
  #----------------------------------------------------------------------------
      post:
        consumes:
          - multipart/form-data
        x-wso2-curl: "curl -k -H \"Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -F file=@\"sample.pdf\" -X POST \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\""
        x-wso2-request: |
          POST https://127.0.0.1:9443/api/am/publisher/v1.0/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content
          Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
          Content-Length: 8004
          Content-Type: multipart/form-data; boundary=------------------------7b9a53f1ffa452b9

          --------------------------7b9a53f1ffa452b9
          Content-Disposition: form-data; name="file"; filename="sample.pdf"
          Content-Type: application/octet-stream

          [file content]

          --------------------------7b9a53f1ffa452b9--
        x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://127.0.0.1:9443/api/am/publisher/v1.0/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content\nContent-Type: application/json\n\n{\n    \"visibility\":\"API_LEVEL\",\n    \"sourceType\":\"FILE\",\n    \"sourceUrl\":null,\n    \"otherTypeName\":null,\n    \"documentId\":\"daf732d3-bda2-46da-b381-2c39d901ea61\",\n    \"summary\":\"This is a sample documentation pdf\",\n    \"name\":\"Introduction to PhoneVerification API PDF\",\n    \"type\":\"HOWTO\"\n}"
        security:
          - OAuth2Security:
            - apim:api_create
        summary: Upload the content of an API document
        description: |
          Thid operation can be used to upload a file or add inline content to an API document.

          **IMPORTANT:**
          * Either **file** or **inlineContent** form data parameters should be specified at one time.
          * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter.
          * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter.
        parameters:
          - $ref: '#/parameters/apiId'
          - $ref: '#/parameters/documentId'
          - in: formData
            name: file
            description: Document to upload
            type: file
            required: false
          - in: formData
            name: inlineContent
            description: Inline content of the document
            type: string
            required: false
          - $ref: '#/parameters/If-Match'
          - $ref: '#/parameters/If-Unmodified-Since'
        tags:
          - Document (Individual)
        responses:
          200:
            description: |
              OK.
              Document updated
            schema:
              $ref: '#/definitions/Document'
            headers:
              Location:
                description: |
                  The URL of the updated content of the document.
                type: string
              Content-Type:
                description: |
                  The content type of the body.
                type: string
              ETag:
                description: |
                  Entity Tag of the response resource.
                  Used by caches, or in conditional requests (Will be supported in future).
                type: string
              Last-Modified:
                description: |
                  Date and time the resource has been modifed the last time.
                  Used by caches, or in conditional requests (Will be supported in future).
                type: string
          400:
            description: |
              Bad Request.
              Invalid request or validation error.
            schema:
              $ref: '#/definitions/Error'
          404:
            description: |
              Not Found.
              The resource to be updated does not exist.
            schema:
              $ref: '#/definitions/Error'
          412:
            description: |
              Precondition Failed.
              The request has not been performed because one of the preconditions is not met.
            schema:
              $ref: '#/definitions/Error'


######################################################
# The "Scope Collection" resource APIs
######################################################
  /apis/{apiId}/scopes:

#-----------------------------------------------------
# Retrieve the scope associated with an API that qualify under a search condition
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/scopes\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/scopes
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json"
      summary: Get a list of scopes of an API
      description: |
        This operation can be used to retrieve a list of scopes belonging to an API by providing the id of the API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
      tags:
        - Scope (Collection)
      responses:
        200:
          description: |
            OK.
            Scope list is returned.
          schema:
            $ref: '#/definitions/ScopeList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Add a scope to a certain API
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/scopes\""
      x-wso2-request: "POST https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/scopes\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json"
      x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/scopes/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\nContent-Type: application/json"
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Add a new scope to an API
      description: |
        This operation can be used to add a new scope to an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: body
          name: body
          description: |
            Scope object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/Scope'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Scope (Collection)
      responses:
        201:
          description: |
            Created.
            Successful response with the newly created Scope object as entity in the body.
            Location header contains URL of newly added scope.
          schema:
            $ref: '#/definitions/Scope'
          headers:
            Location:
              description: |
                Location to the newly created Scope.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        415:
          description: |
            Unsupported media type.
            The entity of the request was in a not supported format.

######################################################
# The "Individual Scope" resource APIs
######################################################
  '/apis/{apiId}/scopes/{name}':

#-----------------------------------------------------
# Retrieve a particular scope of a certain API
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/scopes/read\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/scopes/read
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n"
      summary: Get a scope of an API
      description: |
        This operation can be used to retrieve a particular scope's metadata associated with an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/scopeName'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - Scope (Individual)
      responses:
        200:
          description: |
            OK.
            Scope returned.
          schema:
            $ref: '#/definitions/Scope'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested Scope does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update a particular scope of a certain API
#-----------------------------------------------------
    put:
      x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" -H \"Content-Type: application/json\" -X PUT -d data.json \"https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/scopes/read\""
      x-wso2-request: "PUT https://127.0.0.1:9443/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/scopes/read\nAuthorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\nContent-Type: application/json\n"
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n"
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Update a Scope of an API
      description: |
        This operation can be used to update scope of an API
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/scopeName'
        - in: body
          name: body
          description: |
            Scope object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/Scope'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Scope (Individual)
      responses:
        200:
          description: |
            OK.
            Scope updated
          schema:
            $ref: '#/definitions/Scope'
          headers:
            Location:
              description: |
                The URL of the updated scope.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Delete a particular scope of a certain API
#-----------------------------------------------------
    delete:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/scopes/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058"
      x-wso2-request: |
        DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/scopes/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK"
      security:
        - OAuth2Security:
          - apim:api_delete
      summary: Delete a scope of an API
      description: |
        This operation can be used to delete a scope associated with an API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/scopeName'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Scope (Individual)
      responses:
        200:
          description: |
            OK.
            Resource successfully deleted.
        404:
          description: |
            Not Found.
            Resource to be deleted does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# Dedicated Gateway API
######################################################
  /apis/{apiId}/dedicated-gateway:
#-----------------------------------------------------
# Retrieve dedicated Gateway Enabled
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9292/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/dedicatedGateway"
      x-wso2-request: |
        GET https://127.0.0.1:9292/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/dedicatedGateway
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n\"isEnabled\":true\n}"
      summary: Get enability of dedicatedGateway
      description: |
        This operation can be used to retrieve whether the dedicated gateway is enabled in a certain API.
      parameters:
        - $ref: '#/parameters/apiId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - DedicatedGateway (Individual)
      responses:
        200:
          description: |
            OK.
            isEnabled of dedicated Gateway returned
          schema:
            $ref: '#/definitions/DedicatedGateway'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested Dedicated Gateway does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported.
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update a dedicated Gateway of a certain API
#-----------------------------------------------------
    put:
      x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" -H \"Content-Type: application/json\" -X PUT -d data.json \"https://127.0.0.1:9292/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/dedicatedGateway"
      x-wso2-request: "PUT https://127.0.0.1:9292/api/am/publisher/v1.0/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/dedicatedGateway\nAuthorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\nContent-Type: application/json\n\n{\n   \"isEnabled\": \"true\"\n}"
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"enabled\": \"true\"\n}"
      security:
        - OAuth2Security:
          - apim:dedicated_gateway
      x-scopes: apim:dedicated_gateway
      summary: Update enabling of dedicated Gateway of API
      description: |
        This operation can be used to update metadata of an API's dedicatedGateway.
      parameters:
        - $ref: '#/parameters/apiId'
        - in: body
          name: body
          description: |
            dedicated Gateway object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/DedicatedGateway'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - DedicatedGateway (Individual)
      responses:
        200:
          description: |
            OK.
            Dedicated Gateway of API updated
          schema:
            $ref: '#/definitions/DedicatedGateway'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# Export Resource API
######################################################
  /export/apis:

    get:
      produces:
        - application/zip
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9292/api/am/publisher/v1.0/export/apis?query=xxx > exported-apis.zip"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/export/apis?query=xxx
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\n Connection: keep-alive\n  Content-Disposition: attachment; filename=\"exported-apis.zip\"\n  Content-Type: application/zip"
      summary: Export information related to an API.
      description: |
        This operation can be used to export information related to a particular API.
      parameters:
        - name: query
          in: query
          description: |
            API search query
          required: true
          type: string
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/offset'
      tags:
        - Export Configuration
      responses:
        200:
          description: |
            OK.
            Export Configuration returned.
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
          schema:
            type: file
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# Import Resource API
######################################################
  /import/apis:

    put:
      consumes:
        - multipart/form-data
      x-wso2-curl: "curl -k -F \"[email protected]\" -X PUT -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9292/api/am/publisher/v1.0/import/apis"
      x-wso2-request: |
        PUT https://127.0.0.1:9292/api/am/publisher/v1.0/import/apis
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"count\":2,\"list\":[{\"id\":\"4df90edc-f76b-4b19-bf57-7d161fa04467\",\"name\":\"testApi2\",\"context\":\"/test2\",\"version\":\"2.0.3\",\"provider\":\"admin\",\"lifeCycleStatus\":\"Created\",\"workflowStatus\":\"APPROVED\"},{\"id\":\"4066bc9e-1d87-4296-bcca-f6e38d3da6d0\",\"name\":\"testApi\",\"context\":\"/testApi\",\"version\":\"1.0.0\",\"provider\":\"admin\",\"lifeCycleStatus\":\"Created\",\"workflowStatus\":\"APPROVED\"}]}"
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Imports API(s).
      description: |
        This operation can be used to import one or more existing APIs.
      parameters:
        - name: file
          in: formData
          description: |
            Zip archive consisting on exported api configuration
          required: true
          type: file
        - name: provider
          in: query
          description: |
            If defined, updates the existing provider of each API with the specified provider.
            This is to cater scenarios where the current API provider does not exist in the environment
            that the API is imported to.
          required: false
          type: string
      tags:
        - Import Configuration
      responses:
        200:
          description: |
            OK.
            Successful response with the updated object as entity in the body.
          schema:
            $ref: '#/definitions/APIList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

    post:
      consumes:
        - multipart/form-data
      x-wso2-curl: "curl -k -F \"[email protected]\" -X POST -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9292/api/am/publisher/v1.0/import/apis"
      x-wso2-request: |
        POST https://127.0.0.1:9292/api/am/publisher/v1.0/import/apis
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"count\":2,\"list\":[{\"id\":\"4df90edc-f76b-4b19-bf57-7d161fa04467\",\"name\":\"testApi2\",\"context\":\"/test2\",\"version\":\"2.0.3\",\"provider\":\"admin\",\"lifeCycleStatus\":\"Created\",\"workflowStatus\":\"APPROVED\"},{\"id\":\"4066bc9e-1d87-4296-bcca-f6e38d3da6d0\",\"name\":\"testApi\",\"context\":\"/testApi\",\"version\":\"1.0.0\",\"provider\":\"admin\",\"lifeCycleStatus\":\"Created\",\"workflowStatus\":\"APPROVED\"}]}"
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Imports API(s).
      description: |
        This operation can be used to import one or more existing APIs.
      parameters:
        - name: file
          in: formData
          description: |
            Zip archive consisting on exported api configuration
          required: true
          type: file
        - name: provider
          in: query
          description: |
            If defined, updates the existing provider of each API with the specified provider.
            This is to cater scenarios where the current API provider does not exist in the environment
            that the API is imported to.
          required: false
          type: string
      tags:
        - Import Configuration
      responses:
        200:
          description: |
            OK.
            Successful response with the updated object as entity in the body.
          schema:
            $ref: '#/definitions/APIList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Subscription Collection" resource APIs
######################################################
  /subscriptions:

#-----------------------------------------------------
# Retrieve all subscriptions of a certain API
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n \n{\n   \"previous\": \"\",\n   \"list\":    [\n            {\n         \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n         \"policy\": \"Gold\",\n         \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n         \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n         \"lifeCycleStatus\": \"UNBLOCKED\"\n      },\n            {\n         \"subscriptionId\": \"7ac22c34-8745-4cfe-91e0-262c50b2f2e3\",\n         \"policy\": \"Gold\",\n         \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n         \"applicationId\": \"367a2361-8db5-4140-8133-c6c8dc7fa0c4\",\n         \"lifeCycleStatus\": \"UNBLOCKED\"\n      }\n   ],\n   \"next\": \"\",\n   \"count\": 2\n}"
      security:
        - OAuth2Security:
          - apim:subscription_view
      summary: Get all Subscriptions
      description: |
        This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of

        1. Retrieving all subscriptions for the user's APIs.
        `GET https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions`

        2. Retrieving subscriptions for a specific API.
        `GET https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed`
      parameters:
        - $ref: '#/parameters/apiId-Q'
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/offset'
        - $ref: '#/parameters/If-None-Match'
      tags:
        - Subscription (Collection)
      responses:
        200:
          description: |
            OK.
            Subscription list returned.
          schema:
            $ref: '#/definitions/SubscriptionList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        406:
          description: |
            Not Acceptable. The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Individual Subscription" resource APIs
######################################################
  '/subscriptions/{subscriptionId}':

#-----------------------------------------------------
# Retrieve a certain subscription
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n   \"policy\": \"Gold\",\n   \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n   \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n   \"lifeCycleStatus\": \"UNBLOCKED\"\n}"
      security:
        - OAuth2Security:
          - apim:subscription_view
      summary: Get details of a subscription
      description: |
        This operation can be used to get details of a single subscription.
      parameters:
        - $ref: '#/parameters/subscriptionId'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - Subscription (Individual)
      responses:
        200:
          description: |
            OK.
            Subscription returned
          schema:
            $ref: '#/definitions/Subscription'
          headers:
            Content-Type:
              description: The content type of the body.
              type: string
            ETag:
              description: 'Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).'
              type: string
            Last-Modified:
              description: 'Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future).'
              type: string
        '304':
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        '404':
          description: |
            Not Found.
            Requested Subscription does not exist.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Block Subscription" Processing Function resource API
######################################################
  /subscriptions/block-subscription:

#-----------------------------------------------------
# Block a certain subscription
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED\""
      x-wso2-request: |
        POST https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n \n{\n   \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n   \"policy\": \"Gold\",\n   \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n   \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n   \"lifeCycleStatus\": \"PROD_ONLY_BLOCKED\"\n}"
      security:
        - OAuth2Security:
          - apim:subscription_block
      summary: Block a subscription
      description: |
        This operation can be used to block a subscription. Along with the request, `blockState` must be specified as a query parameter.

        1. `BLOCKED` : Subscription is completely blocked for both Production and Sandbox environments.
        2. `PROD_ONLY_BLOCKED` : Subscription is blocked for Production environment only.
      parameters:
        - $ref: '#/parameters/subscriptionId-Q'
        - name: blockState
          in: query
          description: |
            Subscription block state.
          type: string
          required: true
          enum:
            - BLOCKED
            - PROD_ONLY_BLOCKED
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Subscription (Individual)
      responses:
        200:
          description: |
            OK.
            Subscription was blocked successfully.
          headers:
            ETag:
              description: |
                Entity Tag of the blocked subscription.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the subscription has been blocked.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            Requested subscription does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Unblock Subscription" Processing Function resource API
######################################################
  /subscriptions/unblock-subscription:

#-----------------------------------------------------
# Unblock a certain subscription
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809\""
      x-wso2-request: |
        POST https://127.0.0.1:9443/api/am/publisher/v1.0/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8`
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n   \"policy\": \"Gold\",\n   \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n   \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n   \"lifeCycleStatus\": \"UNBLOCKED\"\n} "
      security:
        - OAuth2Security:
          - apim:subscription_block
      summary: Unblock a Subscription
      parameters:
        - $ref: '#/parameters/subscriptionId-Q'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      description: |
        This operation can be used to unblock a subscription specifying the subscription Id. The subscription will be fully unblocked after performing this operation.
      tags:
        - Subscription (Individual)
      responses:
        200:
          description: |
            OK.
            Subscription was unblocked successfully.
          headers:
            ETag:
              description: |
                Entity Tag of the unblocked subscription.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the subscription has been unblocked.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            Requested subscription does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Tier Collection" resource APIs
######################################################
  '/policies/{tierLevel}':

#-----------------------------------------------------
# Retrieve the list of all available policies
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9443/api/am/publisher/v1.0/policies/api"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/policies/api
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n\n{\n   \"previous\": \"\",\n   \"list\":    [\n            {\n         \"unitTime\": 60000,\n         \"tierPlan\": \"FREE\",\n         \"tierLevel\": \"api\",\n         \"stopOnQuotaReach\": true,\n         \"requestCount\": 1,\n         \"description\": \"Allows 1 request(s) per minute.\",\n         \"name\": \"Bronze\",\n         \"attributes\": {}\n      },\n            {\n         \"unitTime\": 60000,\n         \"tierPlan\": \"FREE\",\n         \"tierLevel\": \"api\",\n         \"stopOnQuotaReach\": true,\n         \"requestCount\": 20,\n         \"description\": \"Allows 20 request(s) per minute.\",\n         \"name\": \"Gold\",\n         \"attributes\": {}\n      },\n            {\n         \"unitTime\": 60000,\n         \"tierPlan\": \"FREE\",\n         \"tierLevel\": \"api\",\n         \"stopOnQuotaReach\": true,\n         \"requestCount\": 5,\n         \"description\": \"Allows 5 request(s) per minute.\",\n         \"name\": \"Silver\",\n         \"attributes\": {}\n      },\n            {\n         \"unitTime\": 0,\n         \"tierPlan\": null,\n         \"tierLevel\": \"api\",\n         \"stopOnQuotaReach\": true,\n         \"requestCount\": 0,\n         \"description\": \"Allows unlimited requests\",\n         \"name\": \"Unlimited\",\n         \"attributes\": {}\n      }\n   ],\n   \"next\": \"\",\n   \"count\": 4\n}"
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Get all policies
      description: |
        This operation can be used to list the available policies for a given policy level. Tier level should be specified as a path parameter and should be one of `api`, `application` and `resource`.
      parameters:
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/offset'
        - $ref: '#/parameters/tierLevel'
        - $ref: '#/parameters/If-None-Match'
      tags:
        - Throttling Tier (Collection)
      responses:
        200:
          description: |
            OK.
            List of policies returned.
          schema:
            $ref: '#/definitions/TierList'
          headers:
            Content-Type:
              description: The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'


######################################################
# The "Individual Tier" resource APIs
######################################################
  '/policies/{tierLevel}/{tierName}':

#-----------------------------------------------------
# Retrieve a certain policy
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://127.0.0.1:9443/api/am/publisher/v1.0/policies/api/Bronze"
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/policies/api/Bronze
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"unitTime\": 60000,\n   \"tierPlan\": \"FREE\",\n   \"tierLevel\": \"api\",\n   \"stopOnQuotaReach\": true,\n   \"requestCount\": 1,\n   \"description\": \"Allows 1 request(s) per minute.\",\n   \"name\": \"Bronze\",\n   \"attributes\": {}\n}"
      security:
        - OAuth2Security:
          - apim:api_update
      summary: Get details of a policy
      description: |
        This operation can be used to retrieve details of a single policy by specifying the policy level and policy name.
      parameters:
        - $ref: '#/parameters/tierName'
        - $ref: '#/parameters/tierLevel'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - Throttling Tier (Individual)
      responses:
        200:
          description: |
            OK.
            Tier returned
          schema:
            $ref: '#/definitions/Tier'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested Tier does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Endpoint Collection" resource API
######################################################
  /endpoints:

#-----------------------------------------------------
# Retrieve the list of endpoints
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"list\": [\n    {\n      \"id\": \"01234567-0123-0123-0123-012345678901\",\n      \"name\": \"Endpoint 1\",\n      \"endpointConfig\": {\n        \"serviceUrl\": \"http://192.168.56.1:8281\",\n        \"timeout\": 1000\n      },\n      \"endpointSecurity\": {\n        \"enabled\": false\n      },\n      \"maxTps\": 1000,\n      \"type\": \"http\"\n    }\n  ],\n  \"count\": 1\n}"
      security:
        - OAuth2Security:
          - apim:api_view
      summary: Get all endpoints
      description: |
        This operation can be used to retrieve the list of endpoints available.
      parameters:
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - Endpoint (Collection)
      responses:
        200:
          description: |
            OK.
            Endpoint list is returned.
          schema:
             $ref: '#/definitions/EndPointList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Add a endpoint
#-----------------------------------------------------
    post:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints\""
      x-wso2-request: ""
      x-wso2-response: ""
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Add a new endpoint
      description: |
        This operation can be used to add a new endpoint.
      parameters:
        - in: body
          name: body
          description: |
            EndPoint object that needs to be added
          required: true
          schema:
            $ref: '#/definitions/EndPoint'
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - Endpoint (Collection)
      responses:
        201:
          description: |
            Created.
            Successful response with the newly created Document object as entity in the body.
            Location header contains URL of newly added document.
          schema:
            $ref: '#/definitions/EndPoint'
          headers:
            Location:
              description: |
                Location to the newly created Document.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error
          schema:
            $ref: '#/definitions/Error'
        415:
          description: |
            Unsupported media type.
            The entity of the request was in a not supported format.

#-----------------------------------------------------
# The attibutes of the Endpoint existance check resource
#-----------------------------------------------------
    head:
      security:
        - OAuth2Security:
          - apim:api_create
      summary: |
        Check given Endpoint is already exist
      description: |
            Using this operation, you can check a given Endpoint name is already used. You need to provide the name you want to check.
      parameters:
        - name : name
          in: query
          type: string
        - $ref : "#/parameters/If-None-Match"
      tags:
        - Endpoint (Collection)
      responses:
        200:
          description: |
            OK.
            Requested Endpoint attibute status is returned
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
        400:
            description: |
              Bad Request.
              Requested Endpoint attribute does not meet requiremnts.
        404:
          description: |
            Not Found.
            Requested Endpoint does not exist.
          schema:
            $ref: '#/definitions/Error'
        406:
          description: |
            Not Acceptable.
            The requested media type is not supported
          schema:
            $ref: '#/definitions/Error'

  /endpoints/{endpointId}:

#-----------------------------------------------------
# Retrieve the specific endpoint details
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints/1234-123-2111-345\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints/1234-123-2111-345
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n   \"list\": [   {\n      \"showInApiConsole\": true,\n      \"serverUrl\": \"https://192.168.56.1:9444//services/\",\n      \"endpoints\":       {\n         \"http\": \"http://192.168.56.1:8281\",\n         \"https\": \"https://192.168.56.1:8244\"\n      },\n      \"name\": \"Production and Sandbox\",\n      \"type\": \"hybrid\"\n   }],\n   \"count\": 1\n}"
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Get specific endpoints
      description: |
        This operation can be used to retrieve endpoint specific details.
      parameters:
        - $ref: '#/parameters/endpointId'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Endpoint (individual)
      responses:
        200:
          description: |
            OK.
            Endpoint details returned.
          schema:
             $ref: '#/definitions/EndPoint'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Update a certain policy
#-----------------------------------------------------
    put:
      x-wso2-curl: ""
      x-wso2-request: ""
      x-wso2-response: ""
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Update a Tier
      description: |
        This operation can be used to update an existing endpoint.
        `PUT https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints/api/Low`
      parameters:
        - $ref: '#/parameters/endpointId'
        - in: body
          name: body
          description: |
            Tier object that needs to be modified
          required: true
          schema:
            $ref: '#/definitions/EndPoint'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Endpoint (individual)
      responses:
        200:
          description: |
            OK.
            Subscription updated.
          schema:
            $ref: '#/definitions/EndPoint'
          headers:
            Location:
              description: |
                The URL of the newly created resource.
              type: string
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
            Last-Modified:
              description: |
                Date and time the resource has been modifed the last time.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        400:
          description: |
            Bad Request.
            Invalid request or validation error.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            The resource to be updated does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

#-----------------------------------------------------
# Delete the endpoint
#-----------------------------------------------------
    delete:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints/6fb74674-4ab8-4b52-9886-f9a376985060"
      x-wso2-request: |
        DELETE https://127.0.0.1:9443/api/am/publisher/v1.0/endpoints/6fb74674-4ab8-4b52-9886-f9a376985060
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK"
      security:
        - OAuth2Security:
          - apim:api_create
      summary: Delete an endpoint
      description: |
        This operation can be used to delete an existing Endpoint proving the Id of the Endpoint.
      parameters:
        - $ref: '#/parameters/endpointId'
        - $ref: '#/parameters/If-Match'
        - $ref: '#/parameters/If-Unmodified-Since'
      tags:
        - Endpoint (individual)
      responses:
        200:
          description: |
            OK.
            Resource successfully deleted.
        403:
          description: |
            Forbidden.
            The request must be conditional but no condition has been specified.
          schema:
            $ref: '#/definitions/Error'
        404:
          description: |
            Not Found.
            Resource to be deleted does not exist.
          schema:
            $ref: '#/definitions/Error'
        412:
          description: |
            Precondition Failed.
            The request has not been performed because one of the preconditions is not met.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Label Collection" resource API
######################################################
  /labels:

#-----------------------------------------------------
# Retrieve the list of labels
#-----------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9443/api/am/publisher/v1.0/labels\""
      x-wso2-request: |
        GET https://127.0.0.1:9443/api/am/publisher/v1.0/labels
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      security:
        - OAuth2Security:
          - apim:api_publish
      summary: Get all labels
      description: |
        This operation can be used to retrieve the list of labels available.
      parameters:
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - Label (Collection)
      responses:
        200:
          description: |
            OK.
            Label list is returned.
          schema:
             $ref: '#/definitions/LabelList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'

######################################################
# The "Threat Protection Policies" resource API
######################################################
  /threat-protection-policies:
    get:
      summary: Get All Threat Protection Policies
      description: This can be used to get all defined threat protection policies
      tags:
        - Threat Protection Policies
      responses:
        200:
          description: Ok. List of policies is returned
          schema:
            $ref: '#/definitions/ThreatProtectionPolicyList'

######################################################
# The "Threat Protection Policy" resource API
######################################################
  /threat-protection-policies/{policyId}:
    get:
      summary: Get a threat protection policy
      parameters:
        - $ref: '#/parameters/threatProtectionPolicyId'
      tags:
        - Threat Protection Policy
      responses:
        200:
          description: Ok. Policy is returned
          schema:
            $ref: '#/definitions/ThreatProtectionPolicy'
        404:
          description: No policy found for given policy ID

######################################################
# The "Service Discovery" utility API
######################################################
  /external-resources/services:

#-------------------------------------------------------------------
# Retrieve the list of service endpoints present in a cluster
#-------------------------------------------------------------------
    get:
      x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://127.0.0.1:9292/api/am/publisher/v1.0/external-resources/services\""
      x-wso2-request: |
        GET https://127.0.0.1:9292/api/am/publisher/v1.0/external-resources/services
        Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
      x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"list\": [\n    {\n      \"id\": \"ds-0\",\n      \"name\": \"service-1\",\n      \"endpointConfig\": {\n        \"serviceUrl\": \"http://192.168.56.1:8281\",\n        \"serviceType\": \"NodePort\",\n        \"namespace\": \"default\"\n      },\n      \"endpointSecurity\": {\n        \"enabled\": false\n      },\n      \"maxTps\": 1000,\n      \"type\": \"http\"\n    }\n  ],\n  \"count\": 1\n}"
      security:
        - OAuth2Security:
          - apim:external_services_discover
      summary: Get all service endpoints after service discovery
      description: |
        This operation can be used to retrieve the list of service endpoints available in the cluster after a process of service discovery.
      parameters:
        - $ref: '#/parameters/If-None-Match'
        - $ref: '#/parameters/If-Modified-Since'
      tags:
        - External Resources (Collection)
      responses:
        200:
          description: |
            OK.
            Service Endpoint list is returned with other details.
          schema:
             $ref: '#/definitions/EndPointList'
          headers:
            Content-Type:
              description: |
                The content type of the body.
              type: string
            ETag:
              description: |
                Entity Tag of the response resource.
                Used by caches, or in conditional requests (Will be supported in future).
              type: string
        304:
          description: |
            Not Modified.
            Empty body because the client has already the latest version of the requested resource (Will be supported in future).
        404:
          description: |
            Not Found.
            Requested API does not exist.
          schema:
            $ref: '#/definitions/Error'


######################################################
# Parameters - required by some of the APIs above
######################################################
parameters:

# API Identifier
# Specified as part of the path expression
  apiId:
    name: apiId
    in: path
    description: |
      **API ID** consisting of the **UUID** of the API.
      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**.
    required: true
    type: string
# API Identifier
# Specified as part of the path expression
  endpointId:
    name: endpointId
    in: path
    description: |
      **Endpoint ID** consisting of the **UUID** of the Endpoint**.
    required: true
    type: string
# API Identifier
# Specified as part of the query string
  apiId-Q:
    name: apiId
    in: query
    description: |
      **API ID** consisting of the **UUID** of the API.
      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**.
    required: true
    type: string

# API name
# Specified as part of the query string
  name:
    name: name
    in: path
    description: |
      Name of the API
    required: true
    type: string

# API version
# Specified as part of the query string
  version:
    name: version
    in: path
    description: |
      Version of the API
    required: true
    type: string

# Document Identifier
# Specified as part of the path expression
  documentId:
    name: documentId
    in: path
    description: |
      Document Identifier
    required: true
    type: string

# Application Identifier
# Specified as part of the path expression
  applicationId:
    name: applicationId
    in: path
    description: |
      **Application Identifier** consisting of the UUID of the Application.
    required: true
    type: string

# Subscription Identifier
# Specified as part of the path expression
  subscriptionId:
    name: subscriptionId
    in: path
    description: |
      Subscription Id
    required: true
    type: string

# Subscription Identifier
# Specified as part of the query string
  subscriptionId-Q:
    name: subscriptionId
    in: query
    description: |
      Subscription Id
    required: true
    type: string

# Tier Name
# Specified as part of the path expression
  tierName:
    name: tierName
    in: path
    description: |
      Tier name
    required: true
    type: string

# Tier Name
# Specified as part of the query string
  tierName-Q:
    name: tierName
    in: query
    description: |
      Name of the policy
    required: true
    type: string

# Tier Type
# Specified as part of the path expression
  tierLevel:
    name: tierLevel
    in: path
    description: |
      List API or Application or Resource type policies.
    type: string
    enum:
      - api
      - application
      - resource
    required: true

# Tier Type
# Specified as part of the query string
  tierLevel-Q:
    name: tierLevel
    in: query
    description: |
      List API or Application or Resource type policies.
    type: string
    enum:
      - api
      - application
      - resource
    required: true

# Used for pagination:
# The maximum number of resoures to be returned by a GET
  limit:
    name: limit
    in: query
    description: |
      Maximum size of resource array to return.
    default: 25
    type: integer

# Used for pagination:
# The order number of an instance in a qualified set of resoures
# at which to start to return the next batch of qualified resources
  offset:
    name: offset
    in: query
    description: |
      Starting point within the complete list of items qualified.
    default: 0
    type: integer

# The HTTP If-None-Match header
# Used to avoid retrieving data that are already cached
  If-None-Match:
    name: If-None-Match
    in: header
    description: |
      Validator for conditional requests; based on the ETag of the formerly retrieved
      variant of the resourec.
    type : string

# The HTTP If-Modified-Since header
# Used to avoid retrieving data that are already cached
  If-Modified-Since:
    name: If-Modified-Since
    in: header
    description: |
      Validator for conditional requests; based on Last Modified header of the
      formerly retrieved variant of the resource.
    type: string

# The HTTP If-Match header
# Used to avoid concurrent updates
  If-Match:
    name: If-Match
    in: header
    description: |
      Validator for conditional requests; based on ETag.
    type: string

# The HTTP If-Unmodified-Since header
# Used to avoid concurrent updates
  If-Unmodified-Since:
    name: If-Unmodified-Since
    in: header
    description: |
      Validator for conditional requests; based on Last Modified header.
    type: string

# API definition type
  definitionType:
    in: formData
    name: type
    description: Definition type to upload
    type: string
    required: true
    enum:
    - SWAGGER
    - WSDL
    default: SWAGGER

# API definition specified as a file
# Specified as a multipart form-data parameter
  definitionFile:
    in: formData
    name: file
    description: Definition to upload as a file
    type: file
    required: false
# Scope Name
  scopeName:
    name: name
    in: path
    description: |
      Scope name
    required: true
    type: string
# API definition URL
# Specified as a multipart form-data parameter
  definitionUrl:
    in: formData
    name: url
    description: Definition url
    type: string
    required: false

#Threat protection policy ID parameter
  threatProtectionPolicyId:
    name: policyId
    in: path
    description: |
      The UUID of a Policy
    required: true
    type: string

#Threat Protection policy
  threatProtectionPolicy:
    name: threatProtectionPolicy
    in: body
    description: |
      Threat protection policy request parameter
    required: true
    schema: {
      $ref: '#/definitions/ThreatProtectionPolicy'
    }

######################################################
# The resources used by some of the APIs above within the message body
######################################################
definitions:

#-----------------------------------------------------
# The API List resource
#-----------------------------------------------------
  APIList:
    title: API List
    properties:
      count:
        type: integer
        description: |
          Number of APIs returned.
        example: 1
      next:
        type: string
        description: |
          Link to the next subset of resources qualified.
          Empty if no more resources are to be returned.
        example: "/apis?limit=1&offset=2&query="
      previous:
        type: string
        description: |
          Link to the previous subset of resources qualified.
          Empty if current subset is the first subset returned.
        example: "/apis?limit=1&offset=0&query="
      list:
        type: array
        items:
          $ref: '#/definitions/APIInfo'

#-----------------------------------------------------
# The API Info resource
#-----------------------------------------------------
  APIInfo:
    title: API Info object with basic API details.
    properties:
      id:
        type: string
        example: 01234567-0123-0123-0123-012345678901
      name:
        type: string
        example: CalculatorAPI
      description:
        type: string
        example: A calculator API that supports basic operations
      context:
        type: string
        example: CalculatorAPI
      version:
        type: string
        example: 1.0.0
      provider:
        description: |
          If the provider value is not given, the user invoking the API will be used as the provider.
        type: string
        example: admin
      lifeCycleStatus:
        type: string
        example: CREATED
      workflowStatus:
        type: string
        example: APPROVED
      securityScheme:
        type: array
        items:
          type: string

#-----------------------------------------------------
# The API resource
#-----------------------------------------------------
  API:
    title: API object
    required:
      - name
      - context
      - version
      - policies
      - isDefaultVersion
      - transport
      - visibility
    properties:
      id:
        type: string
        description: |
          UUID of the api registry artifact
        example: 01234567-0123-0123-0123-012345678901
      name:
        type: string
        example: CalculatorAPI
      description:
        type: string
        example: A calculator API that supports basic operations
      context:
        type: string
        example: CalculatorAPI
      version:
        type: string
        example: 1.0.0
      provider:
        description: |
          If the provider value is not given user invoking the api will be used as the provider.
        type: string
        example: admin
      wsdlUri:
        description: |
          WSDL URL if the API is based on a WSDL endpoint
        type: string
        example: "http://www.webservicex.com/globalweather.asmx?wsdl"
      lifeCycleStatus:
        type: string
        example: CREATED
      workflowStatus:
        type: string
        example: APPROVED
      createdTime:
        type: string
        example: 2017-02-20T13:57:16.229
      apiPolicy:
        type: string
        example: UNLIMITED
      lastUpdatedTime:
        type: string
        example: 2017-02-20T13:57:16.229
      responseCaching:
        type: string
        example: Disabled
      cacheTimeout:
        type: integer
        example: 300
      destinationStatsEnabled:
        type: string
        example: Disabled
      isDefaultVersion:
        type: boolean
        example: false
      transport:
        description: |
          Supported transports for the API (http and/or https).
        type: array
        items:
          type: string
        example: ["http","https"]
      tags:
        type: array
        items:
          type: string
        example: ["substract","add"]
      hasOwnGateway:
        type: boolean
        example : false
      labels:
        type: array
        items:
          type: string
        example: ["public","private"]
      policies:
        type: array
        items:
          type: string
        example: ["Unlimited"]
      visibility:
        type: string
        enum:
          - PUBLIC
          - PRIVATE
          - RESTRICTED
        example: PUBLIC
      visibleRoles:
        type: array
        items:
          type: string
        example: []
      permission:
        type: string
        example: "[{\"groupId\" : 1000, \"permission\" : [\"READ\",\"UPDATE\"]},{\"groupId\" : 1001, \"permission\" : [\"READ\",\"UPDATE\"]}]"
      userPermissionsForApi:
        type: array
        description: |
          LoggedIn user permissions for the API
        items:
          type: string
        example: ["READ","UPDATE"]
      visibleTenants:
        type: array
        items:
          type: string
        example: []
      gatewayEnvironments:
        description: |
          Comma separated list of gateway environments.
        type: string
        example: Production and Sandbox
      sequences:
        type: array
        items:
          $ref: '#/definitions/Sequence'
        example: []
      businessInformation:
        properties:
          businessOwner:
            type: string
            example: businessowner
          businessOwnerEmail:
            type: string
            example: [email protected]
          technicalOwner:
            type: string
            example: technicalowner
          technicalOwnerEmail:
            type: string
            example: [email protected]
      corsConfiguration:
        description: |
          CORS configuration for the API
        properties:
          corsConfigurationEnabled:
            type: boolean
            default: false
          accessControlAllowOrigins:
            type: array
            items:
               type: string
          accessControlAllowCredentials:
            type: boolean
            default: false
          accessControlAllowHeaders:
            type: array
            items:
              type: string
          accessControlAllowMethods:
            type: array
            items:
              type: string
      endpoint:
        type: array
        items:
         properties:
          key:
           type: string
           example: "01234567-0123-0123-0123-012345678901"
          inline:
           $ref: '#/definitions/EndPoint'
          type:
            type: string
            example: "Production"
      securityScheme:
        type: array
        items:
          type: string
      scopes:
        type: array
        items:
          type: string
      operations:
       type: array
       items:
        properties:
          id:
           type: string
           example: "postapiresource"
          uritemplate:
            type: string
            default: "/*"
          httpVerb:
            type: string
            default: "GET"
          authType:
            type: string
            default: "Any"
          policy:
            type: string
            example: "Unlimited"
          endpoint:
            type: array
            items:
             properties:
              key:
               type: string
               example: "01234567-0123-0123-0123-012345678901"
              inline:
               $ref: '#/definitions/EndPoint'
              type:
                type: string
                example: "Production"
          scopes:
            type: array
            items:
              type: string
      threatProtectionPolicies:
        properties:
          list:
            type: array
            items:
              properties:
                policyId:
                  type: string
                priority:
                  type: integer

#-----------------------------------------------------
# The Application resource
#-----------------------------------------------------
  Application:
    title: Application
    required:
      - name
      - throttlingTier
    properties:
      applicationId:
        type: string
        example: 01234567-0123-0123-0123-012345678901
      name:
        type: string
        example: CalculatorApp
      subscriber:
        type: string
        example: admin
      throttlingTier:
        type: string
        example: Unlimited
      description:
        type: string
        example: Sample calculator application

#-----------------------------------------------------
# The Document List resource
#-----------------------------------------------------
  DocumentList:
    title: Document List
    properties:
      count:
        type: integer
        description: |
          Number of Documents returned.
        example: 1
      next:
        type: string
        description: |
          Link to the next subset of resources qualified.
          Empty if no more resources are to be returned.
        example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=2"
      previous:
        type: string
        description: |
          Link to the previous subset of resources qualified.
          Empty if current subset is the first subset returned.
        example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=0"
      list:
        type: array
        items:
          $ref: '#/definitions/Document'

#-----------------------------------------------------
# The Document resource
#-----------------------------------------------------
  Document:
    title: Document
    required:
      - name
      - type
      - sourceType
      - visibility
    properties:
      documentId:
        type: string
        example: 01234567-0123-0123-0123-012345678901
      name:
        type: string
        example: CalculatorDoc
      type:
        type: string
        enum:
          - HOWTO
          - SAMPLES
          - PUBLIC_FORUM
          - SUPPORT_FORUM
          - API_MESSAGE_FORMAT
          - SWAGGER_DOC
          - OTHER
        example: HOWTO
      summary:
        type: string
        example: "Summary of Calculator Documentation"
      sourceType:
        type: string
        enum:
          - INLINE
          - URL
          - FILE
        example: INLINE
      sourceUrl:
        type: string
        example: ""
      fileName:
        type: string
        example: ""
      inlineContent:
        type: string
        example: "This is doc content. This can have many lines."
      otherTypeName:
        type: string
        example: ""
      permission:
        type: string
        example: "[{\"groupId\" : 1000, \"permission\" : [\"READ\",\"UPDATE\"]},{\"groupId\" : 1001, \"permission\" : [\"READ\",\"UPDATE\"]}]"
      visibility:
        type: string
        enum:
          - OWNER_ONLY
          - PRIVATE
          - API_LEVEL
        example: API_LEVEL
      createdTime:
        type: string
        example: 2017-02-20T13:57:16.229
      createdBy:
        type: string
      lastUpdatedTime:
        type: string
        example: 2017-02-20T13:57:16.229
      lastUpdatedBy:
        type: string

#-----------------------------------------------------
# The Tier List resource
#-----------------------------------------------------
  TierList:
    title: Tier List
    properties:
      count:
        type: integer
        description: |
          Number of Tiers returned.
        example: 1
      next:
        type: string
        description: |
          Link to the next subset of resources qualified.
          Empty if no more resources are to be returned.
        example: "/policies/api?limit=1&offset=2"
      previous:
        type: string
        description: |
          Link to the previous subset of resources qualified.
          Empty if current subset is the first subset returned.
        example: "/policies/api?limit=1&offset=0"
      list:
        type: array
        items:
          $ref: '#/definitions/Tier'

#-----------------------------------------------------
# The Tier resource
#-----------------------------------------------------
  Tier:
    title: Tier
    required:
      - name
      - tierPlan
      - requestCount
      - unitTime
      - stopOnQuotaReach
    properties:
      name:
        type: string
        example: Platinum
      description:
        type: string
        example: "Allows 50 request(s) per minute."
      tierLevel:
        type: string
        enum:
          - api
          - application
          - resource
        example: api
      attributes:
        description: |
          Custom attributes added to the policy policy
        type: object
        additionalProperties:
          type: string
        example: {}
      requestCount:
        description: |
          Maximum number of requests which can be sent within a provided unit time
        type: integer
        format: int64
        example: 50
      unitTime:
        type: integer
        format: int64
        example: 60000
      timeUnit:
        type: string
        example: "min"
      tierPlan:
        description: |
          This attribute declares whether this policy is available under commercial or free
        type: string
        enum:
          - FREE
          - COMMERCIAL
        example: FREE
      stopOnQuotaReach:
        description: |
          By making this attribute to false, you are capabale of sending requests
          even if the request count exceeded within a unit time
        type: boolean
        example: true


#-----------------------------------------------------
# The Subscription List resource
#-----------------------------------------------------
  SubscriptionList:
    title: Subscription List
    properties:
      count:
        type: integer
        description: |
          Number of Subscriptions returned.
        example: 1
      next:
        type: string
        description: |
          Link to the next subset of resources qualified.
          Empty if no more resources are to be returned.
        example: "/subscriptions?limit=1&offset=2&apiId=01234567-0123-0123-0123-012345678901"
      previous:
        type: string
        description: |
          Link to the previous subset of resources qualified.
          Empty if current subset is the first subset returned.
        example: "/subscriptions?limit=1&offset=0&apiId=01234567-0123-0123-0123-012345678901"
      list:
        type: array
        items:
          $ref: '#/definitions/Subscription'

#-----------------------------------------------------
# The Subscription resource
#-----------------------------------------------------
  Subscription:
    title: Subscription
    required:
      - subscriptionId
      - applicationInfo
      - policy
      - subscriptionStatus
    properties:
      subscriptionId:
        type: string
        example: 01234567-0123-0123-0123-012345678901
      applicationInfo:
        $ref: '#/definitions/Application'
      policy:
        type: string
        example: Unlimited
      subscriptionStatus:
        type: string
        enum:
          - BLOCKED
          - PROD_ONLY_BLOCKED
          - SANDBOX_ONLY_BLOCKED
          - ACTIVE
          - ON_HOLD
          - REJECTED
        example: BLOCKED

#-----------------------------------------------------
# The Sequence resource
#-----------------------------------------------------
  Sequence:
    title: Sequence
    required:
      - name
    properties:
      name:
        type: string
        example: log_in_message
      config:
        type: string
        example: ""
      type:
        type: string
        example: in

#-----------------------------------------------------
# The Error resource
#-----------------------------------------------------
  Error:
    title: Error object returned with 4XX HTTP lifeCycleStatus
    required:
      - code
      - message
    properties:
      code:
        type: integer
        format: int64
      message:
        type: string
        description: Error message.
      description:
        type: string
        description: |
          A detail description about the error message.
      moreInfo:
        type: string
        description: |
          Preferably an url with more details about the error.
      error:
        type: array
        description: |
          If there are more than one error list them out.
          For example, list out validation errors by each field.
        items:
          $ref: '#/definitions/ErrorListItem'

#-----------------------------------------------------
# The Error List Item resource
#-----------------------------------------------------
  ErrorListItem:
    title: Description of individual errors that may have occurred during a request.
    required:
      - code
      - message
    properties:
      code:
        type: string
      message:
        type: string
        description: |
          Description about individual errors occurred

#-----------------------------------------------------
# The File Information resource
#-----------------------------------------------------
  FileInfo :
    title: File Information including meta data
    properties:
      relativePath:
        type: string
        description: relative location of the file (excluding the base context and host of the Publisher API)
        example: "apis/01234567-0123-0123-0123-012345678901/thumbnail"
      mediaType:
        type: string
        description: media-type of the file
        example: "image/jpeg"

#-----------------------------------------------------
# The Environment Endpoint resource
#-----------------------------------------------------
  EndPoint :
    title: Endpoints
    properties:
      id:
        type: string
        description: |
          UUID of the Endpoint entry
        example: 01234567-0123-0123-0123-012345678901
      name:
        type: string
        description: |
          name of the Endpoint entry
        example: "Endpoint 1"
      endpointConfig:
        type: string
        description: Endpoint Configuration
        example: "{url: http://localhost:8280, timeout: 1000}"
      endpointSecurity:
        properties:
          enabled:
            type: boolean
            example: false
          type:
            type: string
            example: basic
          username:
            type: string
            example: basic
          password:
            type: string
            example: basic
      maxTps:
        type: integer
        format: int64
        description: Endpoint max tps
        example: 1000
      type:
        type: string
        example: "http"
#-----------------------------------------------------
# The Environment List resource
#-----------------------------------------------------
  EndPointList:
    title: EndPoint List
    properties:
      count:
        type: integer
        description: |
          Number of EndPoints returned.
        example: 1
      list:
        type: array
        items:
          $ref: '#/definitions/EndPoint'

#-----------------------------------------------------
# The Environment Endpoint resource
#-----------------------------------------------------
  Scope :
    title: Scope
    properties:
      name:
        type: string
        description: |
          name of Scope
        example: apim:api_view
      description:
        type: string
        description: |
          description of Scope
        example: 'This Scope can used to view Apis'
      bindings:
        properties:
          type:
            type: string
            description: |
              Type of binding role / permission
          values:
            type: array
            items:
              type: string


#-----------------------------------------------------
# The Scope List resource
#-----------------------------------------------------
  ScopeList:
    title: Scope List
    properties:
      count:
        type: integer
        description: |
          Number of Scopes returned.
        example: 1
      list:
        type: array
        items:
          properties:
            name:
              type: string
              example: "apim:api_view"
            description:
              type: string
              example: "Scope for Api view"

#-----------------------------------------------------
# The Label resource
#-----------------------------------------------------
  Label:
    title: Label
    required:
      - labelId
      - name
      - type
      - access_urls
    properties:
      labelId:
        type: string
      name:
        type: string
      type:
        type: string
      access_urls:
        type: array
        items:
          type: string

#-----------------------------------------------------
# The Label List resource
#-----------------------------------------------------
  LabelList:
    title: Label List
    properties:
      count:
        type: integer
        description: |
          Number of Labels returned.
      next:
        type: string
        description: |
          Link to the next subset of resources qualified.
          Empty if no more resources are to be returned.
      previous:
        type: string
        description: |
          Link to the previous subset of resources qualified.
          Empty if current subset is the first subset returned.
      list:
        type: array
        items:
          $ref: '#/definitions/Label'

#-----------------------------------------------------
# The Lifecycle resource
#-----------------------------------------------------
  LifecycleState:
    title:  Lifecycle State
    properties:
      lcName:
        type: string
        example: "API Lifecycle"
      state:
        type: string
        example: "Created"
      lifecyelId:
        type: string
        example: "01234567-0123-0123-0123-012345678901"
      checkItemBeanList:
        type: array
        items:
          properties:
            permissionBeans:
              type: array
              items:
                properties:
                  roles:
                    type: array
                    items:
                      type: string
                  forTarget:
                    type: string
            name:
              type: string
              example: "Deprecate old versions after publish the API"
            validationBeans:
              type: array
              items:
                properties:
                  classObject:
                    type: object
                  targetName:
                    type: string
                    example: "Published"
                  customMessage:
                    type: string
                    example: "Validation successful"
            targets:
              type: array
              items:
                  type: string
            value:
              type: boolean
              example: false
      inputBeanList:
        type: array
        items:
          properties:
            name:
              type: string
              example: "Gateways to be published"
            isRequired:
              type: boolean
              example:  true
            label:
              type: string
            placeHolder:
              type: string
            tooltip:
              type: string
            regex:
              type: string
            values:
              type: string
            forTarget:
              type: string
              example: "Created"
      customCodeBeanList:
        type: array
        items:
          properties:
            classObject:
              type: object
            targetName:
              type: string
              example: "Published"
            customMessage:
              type: string
              example: "Validation successful"
      availableTransitionBeanList:
        type: array
        items:
          properties:
            event:
              type: string
              example: "Promote"
            targetState:
              type: string
              example: "Created"
      permissionBeanList:
        type: array
        items:
          properties:
            roles:
              type: array
              items:
                type: string
            forTarget:
              type: string

#-----------------------------------------------------
# The workflow executor's response resource
#-----------------------------------------------------
  WorkflowResponse:
    title: workflow Response
    required:
      - workflowStatus
    properties:
      workflowStatus:
        description: |
          This attribute declares whether this workflow task is approved or rejected.
        type: string
        enum:
          - CREATED
          - APPROVED
          - REJECTED
          - REGISTERED
        example: APPROVED
      jsonPayload:
        description: |
          Attributes that returned after the workflow execution
        type: string

#-----------------------------------------------------
# The api definition validation response
#-----------------------------------------------------
  APIDefinitionValidationResponse:
    title: API definition validation Response
    required:
      - isValid
    properties:
      isValid:
        description: |
          This attribute declares whether this definition is valid or not.
        type: boolean
        example: true
      definitionType:
        description: |
          This attribute declares whether this definition is a swagger or WSDL
        type: string
        enum:
        - SWAGGER
        - WSDL
        example: WSDL
      wsdlInfo:
        description:
          Summary of the WSDL including the basic information
        properties:
          version:
            description: |
              WSDL version
            type: string
            example: "1.1"
          endpoints:
            description: |
              A list of endpoints the service exposes
            type: array
            items:
              properties:
                name:
                  type: string
                  description: "Name of the endpoint"
                  example: "StockQuoteSoap"
                location:
                  type: string
                  description: "Endpoint URL"
                  example: "http://www.webservicex.net/stockquote.asmx"
          bindingInfo:
            description: |
              WSDL binding related information
            properties:
              hasHttpBinding:
                description: Indicates whether the WSDL contains HTTP Bindings
                type: boolean
              hasSoapBinding:
                description: Indicates whether the WSDL contains SOAP Bindings
                type: boolean

#-----------------------------------------------------
# The Threat Protection Policy List resource
#-----------------------------------------------------
  ThreatProtectionPolicyList:
    title: "Threat Protection Policy List"
    properties:
      list:
        type: array
        items:
          $ref: '#/definitions/ThreatProtectionPolicy'

#-----------------------------------------------------
# The Threat Protection Policy resource
#-----------------------------------------------------
  ThreatProtectionPolicy:
    title: "Threat Protection Policy Schema"
    required:
      - name
      - type
      - policy
    properties:
      uuid:
        type: string
        description: Policy ID
      name:
        type: string
        description: Name of the policy
      type:
        type: string
        description: Type of the policy
      policy:
        type: string
        description: policy as a json string

#-----------------------------------------------------
# The dedicated Gateway Resource
#-----------------------------------------------------
  DedicatedGateway:
    title: Dedicated Gateway for the API
    required:
      - isEnabled
    properties:
      isEnabled:
        description: |
          This attribute declares whether an API should have a dedicated Gateway or not.
        type: boolean
        example: true




© 2015 - 2025 Weber Informatics LLC | Privacy Policy