Ana içeriğe atla

Endpoint

GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/export/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name

Query Parameters

None.

Response

Success Response (200 OK)

The response is a ZIP file containing the API Proxy export.

Headers

  • Content-Type: application/octet-stream
  • Content-Disposition: attachment; filename="apiProxyExportFile.zip"

Response Body

  • Binary ZIP file containing:
    • API Proxy JSON definition file
    • All associated policies
    • All configurations and settings

ZIP File Contents

  • {apiProxyName}.json - Complete API Proxy definition in JSON format
  • Contains all endpoints, policies, settings, routing configurations, etc.

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "projectName value can not be empty!"
}
or
{
  "error": "bad_request",
  "error_description": "apiProxyName value can not be empty!"
}
or
{
  "error": "bad_request",
  "error_description": "ApiProxy (name: MyAPI) was not found!"
}

Common Causes

  • Empty projectName or apiProxyName
  • API Proxy does not exist in the project
  • Project does not exist or user does not have access

Error Response (401 Unauthorized)

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

Error Response (404 Not Found)

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

cURL Example

Example 1: Export API Proxy

curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/export/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  --output apiProxyExportFile.zip

Example 2: Export API Proxy with Custom Filename

curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/export/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  --output my-api-export.zip

Notes and Warnings

  • Export Format:
    • Exported file is a ZIP archive
    • Contains JSON file with complete API Proxy definition
    • Includes all policies, endpoints, settings, and configurations
  • File Naming:
    • Default filename: apiProxyExportFile.zip
    • API Proxy name is sanitized for use in internal file names
    • You can rename the downloaded file as needed
  • Complete Export:
    • Export includes all API Proxy configurations
    • Includes all associated policies
    • Includes routing, cache, CORS, and other settings

Permissions

  • User must have API_MANAGEMENT + EXPORT_IMPORT permission in the project
  • Alternatively, user can have project admin role
  • File Size:
    • Export file size depends on API Proxy complexity
    • Large API Proxies with many policies may result in larger files
  • Import Compatibility:
    • Exported files can be imported using Import endpoints
    • Compatible with Import without Override and Import with Override endpoints
  • Security:
    • Export files contain sensitive configuration data
    • Store exported files securely
    • Do not share exported files publicly
  • API Proxy State:
    • Export includes current state of API Proxy
    • Includes deployed and undeployed configurations
    • Deployment status is preserved in export