Export APIM policies

GET https://{controlplane_path}/api/1/rest/public/apim/export_policies      

Overview

This API exports the policies of an API or API version.

Prerequisites

  • Environment (Org) admin permissions

Request

 GET https://{controlplane_path}/api/1/rest/public/apim/export_policies?{query_parameters}

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:
  • uat.elastic.snaplogic.com
  • emea.snaplogic.com

Query parameters

Key Type Description
path string
The path to the API or the API version.
  • The path comparison is case-sensitive.
  • The path must be URL-escaped. That is, spaces must be replaced with %20.
Format:
  • API: /{env_org}/apim/{api_name}
  • API version: /{env_org}/apim/{api_name}/{api_version}
policies_to_export array A comma-separated list of strings containing the policies to export.

Valid values:

  • com-snaplogic-policies-auth-anonymousauthenticator
  • com-snaplogic-policies-auth-apikey
  • com-snaplogic-policies-auth-authorizebyrole
  • com-snaplogic-policies-auth-calloutauthenticator
  • com-snaplogic-policies-auth-clientcredenoauth
  • com-snaplogic-policies-auth-genericoauth2policy
  • com-snaplogic-policies-traffic-clientthrottling
  • com-snaplogic-policies-traffic-corspolicy
  • com-snaplogic-policies-traffic-iprestrictionpolicy
  • com-snaplogic-policies-traffic-requestsizelimit
  • com-snaplogic-policies-transform-requesttransformer
  • com-snaplogic-policies-validation-authorizedrequestvalidator
  • com-snaplogic-policies-validation-earlyrequestvalidator
  • com-snaplogic-policies-validation-jsonvalidator
  • com-snaplogic-policies-validation-sqlthreatdetector
  • com-snaplogic-policies-validation-xmlvalidatordtd
  • com-snaplogic-policies-validation-xmlvalidatorxsd

Example: policies_to_export=com-snaplogic-policies-auth-authorizebyrole,com-snaplogic-policies-traffic-corspolicy

Request header

In the request header, specify Basic for authorization, add your credentials (Login and password of your SnapLogic user or service account), and specify application/json for content type. For more details on accounts refer to Manage accounts.


Authorization: Basic {base64_encoded <email>:<password>}
Content-Type: application/json
          

Example of Basic authentication using Postman

When using JWT authentication, the API requests includes specific headers. In the request header, specify Bearer Token for authorization, add the token, and specify application/json for content type. These headers are automatically added when you configure bearer token authentication in your API client. The authorization header contains the word Bearer followed by a space and your JWT token.


Authorization: Bearer Token {token}
Content-Type: application/json
          

Example of JWT authenthication using Postman

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.