Create an API version from a project

Creates an API version with the assets of an existing project.

POST /apim/create_from_project

Overview

This API creates an API version with the assets of an existing project.

The new API version can be created either in the same or another API, Project, Environment/Org, or Snaplex.

Prerequisites

  • Read access to the source project
  • Write access to the target Org

Request

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

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

None.

Request header

In the request header, specify Basic for authorization, add your credentials, and specify application/json for content type:


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

Request body


{
  "project_path": "/Automation2/Rachana/Importversion",
  "plex_path": "/Automation2/shared/Sidekick",
  "api": "doctest",
  "version": "1.0",
  "tags": ["test", "document"],
  "description": "Testing Doc API",
  "asset_types": []
}
        
Key Type Description
project_path string
Required. The path to the SnapLogic project.

Format: /{env_org}/{project_space}/{project_name}

Important: The path comparison is case-sensitive.
plex_path string
The path to the Snaplex.
  • The path comparison is case-sensitive.
  • The path must be URL-escaped. That is, spaces must be replaced with %20.

Format: /{env_org}/{project_space}/{project_name}/{snaplex_name}

api string The name of the API for which to create a new version.
version string The new version.
tags array Tags to associate with the new version.

Default: An empty array

description string Additional information to associate with the new version.

Default: An empty string

asset_types array The list of asset types to copy to the new version.
Valid values:
  • Account
  • File
  • Job (task)
  • Pipeline
  • Policy

Default: All valid asset types.

Note:
  • The "plex_path" attribute is case sensitive.
  • Only Snaplexes placed in the global shared folder are accessible in APIM.

Response

Response body

{
    "response_map": {},
    "http_status_code": 200
}

Error handling

{
    "http_status_code": 400,
    "response_map": {
        "error_list": [
            {
                "message": "The asset /Automation2/apim/doctest/1.0 conflicts with an existing asset, so cannot create."
            }
        ]
    }
}

{
    "http_status_code": 400,
    "response_map": {
        "error_list": [
            {
                "message": "Invalid asset type. Allowed assets are ['File', 'Job', 'Account', 'Pipeline', 'Policy']."
            }
        ]
    }
HTTP status codes Message Resolution
400 {"message": "The asset /Automation2/apim/doctest/1.0 conflicts with an existing asset, so cannot create."} If the same name assets exists in the API version, an empty API version is created. To avoid creation of an empty API version:
  • Verify and update the existing asset name.
  • Remove the asset from the API version.
400 {"message": "Invalid asset type. Allowed assets are ['File', 'Job', 'Account', 'Pipeline', 'Policy']."}
  • Reference the asset type to create the API version. For example: ["File", "Pipeline"]
    Note:
    • If you request the asset type File, it will retrieve all the files in the project.
    • You cannot request a specific asset with its name.
  • Verify if an API version with the same name already exists