Export APIM policies
GET https://{controlplane_path}/api/1/rest/public/apim/export_policies
Overview
Export the policies of an API or API version.
Important: This page describes a Classic APIM API.
Prerequisites
- Environment (Org) admin permissions
Request
GET https://{controlplane_path}/api/1/rest/public/apim/export_policies?{query_parameters}
Example
This example uses basic authentication. For a JWT example, refer to Authentication.
curl -X 'GET' \
'https://elastic.snaplogic.com/api/1/rest/public/apim/export_policies?path=acme/apim/BookStore/1.0&policies_to_export=com-snaplogic-policies-auth-authorizebyrole,com-snaplogic-policies-traffic-corspolicy' \
-H 'Authorization: Basic {base64_encoded email:password}'
Path parameters
| Key | Description |
|---|---|
controlplane_path |
Required. The path to the SnapLogic control plane:
elastic.snaplogic.com
For the UAT or EMEA control plane, substitute the name for elastic. For
example:
|
Query parameters
| Key | Type | Description |
|---|---|---|
path |
string |
The path to the API or the API version.
Format:
|
policies_to_export |
array | A comma-separated list of strings containing the policies to export.
Valid values:
Example: |
Request header
Use the application/json content type with basic authentication (email
and password) or a JWT. For examples, refer to Authentication.
Request body
None.
Response
The response is a JSON object containing information about the exported policies.
{
"0": [
...
],
"class_id": "com-snaplogic-policy-export",
"class_version": 1,
"source_org": "..."
}
Note: If you use the Import APIM policies API to import these policies to another API or API version,
you must provide the entire JSON object as the value for
policies_to_import in the request body.
Error handling
| HTTP status codes | Message | Resolution |
|---|---|---|
| 400 | May not have Read permission for org: {org_name} | Verify you have Read permission on the Org. |
| 401 | Unauthorized | Verify your credentials and permissions. |
| 403 | Cannot fetch policies for unsupported assets | Verify the path points to a supported asset type (API, API version, Proxy, or Proxy Endpoint). |
| 404 | The given path ({path}) doesn't exist | Verify the path is correct and the asset exists. |