Import APIM policies

POST /apim/import_policies

Overview

This API imports a set of policies into an API or API version.

Prerequisites

  • Org admin (Environment admin) permissions

Request

 POST https://{controlplane_path}/api/1/rest/public/apim/import_policies

Path Parameters

Key Description
controlplane_path Required. The path to the SnapLogic control plane.

Example: control-plane-name.snaplogic.com

Where control-plane-name is the control plane you are using. For example,
  • elastic
  • uat
  • emea

Query Parameters

None.

Request Header

Specify Basic for authorization and application/json for content type.

 Authorization: Basic {your_encoded_security_credentials}
Content-Type: application/json

Request Body

   {
    "path" : "...",
    "policies_to_import" : { ... }
  }
Key Type Description
path string
The path to the API or the API version.
  • The path comparison is case-sensitive.
Format:
  • API: /{env_org}/apim/{api_name}
  • API version: /{env_org}/apim/{api_name}/{api_version}
policies_to_import JSON object The JSON object returned by the Export APIM policies API.
Example:
 "policies_to_import" : {
  "0": [
    {
      "class_id": "com-snaplogic-policies-validation-earlyrequestvalidator",
      "class_build_tag": "...",
      "class_fqid": "...",
      "class_version": 1,
      ...
    }
  ],
  "class_id": "com-snaplogic-policy-export",
  "class_version": 1,
  "source_org": "myEnvOrg"
}

Response

Response Body

 {
  "response_map": {
    "import_results": {
      "overrode": [ ... ],
      "ignored": [ ... ],
      "imported": [ ... ]
    }
  },
  "http_status_code": 200
}
Key Type Description
overrode array An array of strings containing the names of the policies that were overridden.
ignored array An array of strings containing the names of the policies that were ignored.
imported array An array of strings containing the names of the policies that were successfully imported.