Ana içeriğe geç

Create API Proxy from URL

Endpoint

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

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}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"],
"hostList": ["api.example.com"]
},
"routingInfo": {
"routingAddressList": [
{
"address": "https://backend.example.com",
"weight": 100,
"healthMonitoringEnabled": true
}
],
"routingEnabled": true,
"mirrorEnabled": false
},
"deploy": false,
"deployTargetEnvironmentNameList": ["production"],
"reParse": false,
"soapToRest": false,
"enableWSA": false,
"enableWSRM": false,
"backendApiVersion": "v1",
"requestBodyReadBehavior": "ALWAYS_READ",
"responseBodyReadBehavior": "ALWAYS_READ",
"maintenanceModeSetting": {
"enabled": false,
"httpStatusCode": 503,
"contentType": "application/json",
"message": "Service is under maintenance"
},
"specAuthorizationValueList": [
{
"keyName": "Authorization",
"value": "Bearer token123",
"type": "header"
}
]
}

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
requestBodyReadBehaviorstringNoALWAYS_READRequest body read behavior. Values: ALWAYS_READ, READ_IF_POLICY_EXISTS, NEVER_READ
responseBodyReadBehaviorstringNoALWAYS_READResponse body read behavior. Values: ALWAYS_READ, READ_IF_POLICY_EXISTS, NEVER_READ
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)
  • EMPTY_API - No-Spec API (no spec file; endpoints are defined manually, see below)

Note: For REVERSE_PROXY and EMPTY_API, specUrl is not required.

No-Spec API (EMPTY_API)

Use apiProxyCreationType: "EMPTY_API" to create an API proxy without any specification file. Unlike REVERSE_PROXY, endpoints are not inferred from a backend spec — after creation the proxy is an empty REST proxy and each endpoint (API method) must be added individually via Create Endpoint.

1. Create the proxy (no specUrl):

{
"apiProxyName": "nospec-api",
"apiProxyCreationType": "EMPTY_API",
"clientRoute": {
"relativePathList": ["/nospec"]
},
"routingInfo": {
"routingAddressList": [
{"address": "http://backend-host:port"}
]
}
}

2. Add endpoints (repeat per endpoint):

POST /apiops/projects/{projectName}/apiProxies/nospec-api/endpoints/
{
"name": "/login",
"httpMethod": "GET",
"backendResourceUrl": "/api/sonuc/login",
"backendHttpMethod": "GET"
}

3. Deploy using the standard Deploy API Proxy endpoint, or set deploy: true in step 1.

Critical rule: final URL = routingAddress + backendResourceUrl

The worker builds the backend request URL by concatenating routingInfo.routingAddressList[].address (host only, no path) with the endpoint's backendResourceUrl (path only, no host). Putting a path in both (e.g. address http://host:port/api/sonuc and backendResourceUrl: "/api/sonuc/login") produces a broken duplicated path (http://host:port/api/sonuc/api/sonuc/login).

  • routingAddress: http://backend-host:port — host only
  • backendResourceUrl: /api/sonuc/login — path only
  • Final backend URL: http://backend-host:port + /api/sonuc/login

Unsupported for EMPTY_API:

  • PUT (reparse, reParse: true) — rejected, since there is no spec to reparse; update endpoints individually with Update Endpoint instead.
  • Create API Proxy from File / its update variant — rejected, since those endpoints require a specFile.

clientRoute

FieldTypeRequiredDescription
relativePathListarrayNoList of relative paths (e.g., ["/api/v1"])
hostListarrayNoList 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
healthMonitoringEnabledbooleanNofalseEnable per-address health monitoring (HTTP type only)

maintenanceModeSetting

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

specAuthorizationValueList Item

FieldTypeRequiredDescription
keyNamestringYesHeader or query parameter name (e.g., "Authorization")
valuestringYesValue (e.g., "Bearer token123")
typestringYesValue type: header or query

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"resultList": null,
"resultCount": null,
"deploymentResult": {
"envName": "production",
"podName": "",
"podIp": "",
"success": true,
"detail": "",
"responseTime": 123,
"detailList": []
}
}

When deploy: false or deployment targets are empty, deploymentResult is null.

Response Fields

FieldTypeDescription
statusstringSUCCESS if the request was successful
deploymentResultobjectDeployment result (present only if deploy=true and environments are specified)
deploymentResult.successbooleanOverall deployment success
deploymentResult.detailListarrayPer-pod deployment results
deploymentResult.detailList[].envNamestringEnvironment name
deploymentResult.detailList[].successbooleanPod-level deployment success
deploymentResult.detailList[].detailstringDetail message (on failure)

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "ApiProxy (name: petstore-api) is already exist!"
}

Common Causes

  • API Proxy name already exists
  • Invalid specification URL
  • Invalid API creation type
  • Invalid specification format
  • Project not found or no permission

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

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. Environment names are validated before the API Proxy is created or re-parsed; an unknown name fails the request with 400 Bad Request and leaves the API Proxy untouched. When re-parsing an existing API Proxy, environments it is already deployed to are preserved and flagged as requiring a redeploy
  • 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