Ana içeriğe atla

Endpoint

POST /apiops/projects/{projectName}/apiProxies/url/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name

Request Body

Full JSON Body Example

{
  "apiProxyName": "petstore-api",
  "apiProxyDescription": "Petstore API Proxy",
  "apiProxyCreationType": "OPEN_API",
  "specUrl": "https://petstore.swagger.io/v2/swagger.json",
  "clientRoute": {
    "relativePathList": ["/api/v1"],
    "virtualHostList": ["api.example.com"]
  },
  "routingInfo": {
    "routingAddressList": [
      {
        "address": "https://backend.example.com",
        "weight": 100,
        "healthCheckEnabled": true
      }
    ],
    "routingEnabled": true,
    "mirrorEnabled": false
  },
  "deploy": false,
  "deployTargetEnvironmentNameList": ["production"],
  "reParse": false,
  "soapToRest": false,
  "enableWSA": false,
  "enableWSRM": false,
  "backendApiVersion": "v1",
  "maintenanceModeSetting": {
    "enabled": false,
    "httpStatusCode": 503,
    "contentType": "application/json",
    "message": "Service is under maintenance"
  },
  "specAuthorizationValueList": [
    {
      "headerName": "Authorization",
      "headerValue": "Bearer token123"
    }
  ]
}

Request Body Fields

FieldTypeRequiredDefaultDescription
apiProxyNamestringYes-API Proxy name (must be unique within project)
apiProxyDescriptionstringNo-API Proxy description
apiProxyCreationTypestringYes-API creation type
specUrlstringYes*-Specification URL (required if not reverse proxy)
clientRouteobjectNo-Client route configuration
routingInfoobjectNo-Routing configuration
deploybooleanNofalseWhether to deploy after creation
deployTargetEnvironmentNameListarrayNo[]List of environment names to deploy to
reParsebooleanNofalseWhether to reparse existing API proxy
soapToRestbooleanNofalseEnable SOAP to REST transformation
enableWSAbooleanNofalseEnable WS-Addressing (SOAP only)
enableWSRMbooleanNofalseEnable WS-ReliableMessaging (SOAP only)
backendApiVersionstringNo-Backend API version
maintenanceModeSettingobjectNo-Maintenance mode settings
specAuthorizationValueListarrayNo[]Authorization headers for spec URL access

EnumApiProxySpecType

  • OPEN_API - OpenAPI 3.0 specification
  • SWAGGER - Swagger 2.0 specification
  • WSDL - WSDL specification (SOAP)
  • REVERSE_PROXY - Reverse proxy (no spec file)
Note: For REVERSE_PROXY, specUrl is not required.

clientRoute

FieldTypeRequiredDescription
relativePathListarrayNoList of relative paths (e.g., [“/api/v1”])
virtualHostListarrayNoList of virtual hosts (e.g., [“api.example.com”])

routingInfo

FieldTypeRequiredDefaultDescription
routingAddressListarrayNo-List of backend addresses
routingEnabledbooleanNotrueWhether routing is enabled
mirrorEnabledbooleanNofalseWhether mirroring is enabled

routingAddressList Item

FieldTypeRequiredDefaultDescription
addressstringYes-Backend address URL
weightintegerNo100Load balancing weight
healthCheckEnabledbooleanNofalseEnable health check

maintenanceModeSetting

FieldTypeRequiredDefaultDescription
enabledbooleanNofalseEnable maintenance mode
httpStatusCodeintegerNo503HTTP status code for maintenance
contentTypestringNoapplication/jsonContent type for maintenance response
messagestringNo-Maintenance message

specAuthorizationValueList Item

FieldTypeRequiredDescription
headerNamestringYesHeader name (e.g., “Authorization”)
headerValuestringYesHeader value (e.g., “Bearer token123”)

Response

Success Response (200 OK)

{
  "success": true,
  "deploymentResult": {
    "success": true,
    "deploymentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Deployment successful"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful
deploymentResultobjectDeployment result (if deploy=true)
deploymentResult.successbooleanOverall deployment success
deploymentResult.deploymentResultsarrayIndividual environment deployment results

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "ApiProxy (name: petstore-api) is already exist!"
}

Common Causes

  • API Proxy name already exists
  • Invalid specification URL
  • Invalid API creation type
  • Invalid specification format

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}

Error Response (404 Not Found)

{
  "error": "not_found",
  "error_description": "Project (MyProject) is not found or user does not have privilege to access it!"
}

cURL Example

curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/url/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "apiProxyName": "petstore-api",
    "apiProxyDescription": "Petstore API Proxy",
    "apiProxyCreationType": "OPEN_API",
    "specUrl": "https://petstore.swagger.io/v2/swagger.json",
    "clientRoute": {
      "relativePathList": ["/api/v1"]
    },
    "deploy": false,
    "reParse": false,
    "soapToRest": false
  }'

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project. For deployment operations (when deploy: true is set), user must also have API_MANAGEMENT + DEPLOY_UNDEPLOY permission.

Notes and Warnings

  • Unique Names: API Proxy names must be unique within a project
  • Specification Access: Ensure the specification URL is accessible. Use specAuthorizationValueList if authentication is required
  • Reparse: Set reParse: true to update an existing API proxy from a new specification
  • Deployment: If deploy: true, ensure environments exist and user has deployment permissions
  • SOAP Features: enableWSA and enableWSRM are only applicable for SOAP APIs
  • Reverse Proxy: For reverse proxy, specUrl is not required
  • License Limits: Creating API proxies may be subject to license limits