Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This page is no longer maintained (). For the most current information, go to https://docs.snaplogic.com/public-apis/post-project-import-import-path.html.

Redirect
filename
locationhttps://docs.snaplogic.com/public-apis/post-project-import-import-path.html

POST /project/import/{import_path}

Overview

This API imports a project to a new location, such as a production Snaplex.

Optionally, you can also update the accounts used and add expressions to the project while importing.

Prerequisites

  • Org Admin permissions

Request

Appsplus panel macro confluence macro
data{"features":["rounded"],"title":"","titleColor":"#FFFFFF","titleColorBG":"#0052CC","titleSize":16,"titleBold":false,"titleItalic":false,"titleUnderline":false,"link":"","linkIcon":false,"linkTab":false,"lozenge":"Hot stuff","lozengeColor":"#172B4D","lozengeColorBG":"#fff0b3","height":200,"panelPadding":12,"panelColor":"#172B4D","panelColorBG":"#dedede","borderColor":"#4C9AFF","borderRadius":3,"borderStyle":"solid","borderWidth":1,"icon":"editor/info","iconPrimary":"#FFFFFF","iconSecondary":"#0052CC","newMacro":false}

POST https://{pod_path}/api/1/rest/public/project/import/{import_path}?{query_parameters}

Path Parameters

Key

Description

pod_path

Required. The path to your SnapLogic pod.

Example: elastic.snaplogic.com

import_path

The path to the target location.

Format: /{org}/{project_space}/{project_name}

Info

The project will be created if it doesn't already exist, but the Org and the project space must already exist.

Query Parameters

Key

Type

Description

duplicate_check

string

Indicates how to handle duplicates between the source and the destination during import.

Valid values:

  • skip or true
    If a project with the same name exists,

    • Any existing assets with the same name are not updated. They appear in the failed section of the response body with a 409 error.

    • Other assets are added.

  • create_new or false
    If a project with the same name exists,

    • A new project is created with a numbered name in the format projectname number. Example: myProjName 1

    This setting has no effect if the target project does not exist.

  • overwrite

    If an asset with the same name exists in the target project and the asset's type is specified in overwrite_types, it is overwritten. Otherwise, it is skipped.

overwrite_types

list

The types of assets that can be overwritten, if an asset with the same name already exists in the destination project. Valid values:

  • Account

  • File

  • Flows

  • Job

  • Pipeline

Note: Policies are always overwritten.

Request Header

Specify Basic for authorization and multipart/form-data for content type.

Appsplus panel macro confluence macro
data{"features":["rounded"],"title":"","titleColor":"#FFFFFF","titleColorBG":"#0052CC","titleSize":16,"titleBold":false,"titleItalic":false,"titleUnderline":false,"link":"","linkIcon":false,"linkTab":false,"lozenge":"Hot stuff","lozengeColor":"#172B4D","lozengeColorBG":"#fff0b3","height":200,"panelPadding":12,"panelColor":"#172B4D","panelColorBG":"#dedede","borderColor":"#4C9AFF","borderRadius":3,"borderStyle":"solid","borderWidth":1,"icon":"editor/info","iconPrimary":"#FFFFFF","iconSecondary":"#0052CC","newMacro":false}

Authorization: Basic {your_encoded_security_credentials}

Content-Type: multipart/form-data

Request Body

Key

Type

Description

file

string

The unmodified zip file of the source project that was exported.

Note

The project zip file must be exported from the source project and must be imported without changes to the new location.

The name of this zip file does not indicate the name of the target project, which is specified in import_path.

file_account

string

Optional. The JSON file containing the list of accounts to modify.

To create this file:

  1. Extract the accounts_template.json file from the exported zip file. The JSON includes nodes for each account associated with the project.

  2. Delete the JSON nodes for accounts that you do not want to modify.

  3. Update the values of the value keys for the accounts that you want to modify.
    Replace any encrypted values (such as the password) with the original plain text value. This is required, even if you are not changing the value itself, because these values are encrypted again during import.

Note

Do not modify the UUID of the account or the structure of the property_map node. The property_map structure might be different for each account and must be preserved.

If this file is not provided, the accounts are not modified.

file_expr

string

Optional. A zip file containing expression files to add to the root of the project in the new location.

If an expression file with the same name already exists in the target location, it is overwritten.

If this file is not provided, no additional expression files are added to the project.

Note

If the zip file contains folders, the folder structure is flattened. If duplicate filenames exist in different folders of the zip file, only one of those files is copied to the new location.

Example: An expression library file (typically with the .expr extension) might contain:

Code Block
 {
  prefix:'test';
  prefixer: x => this.prefix + x
}

Response

Response Body

Appsplus panel macro confluence macro
data{"features":["rounded"],"title":"","titleColor":"#FFFFFF","titleColorBG":"#0052CC","titleSize":16,"titleBold":false,"titleItalic":false,"titleUnderline":false,"link":"","linkIcon":false,"linkTab":false,"lozenge":"Hot stuff","lozengeColor":"#172B4D","lozengeColorBG":"#fff0b3","height":200,"panelPadding":12,"panelColor":"#172B4D","panelColorBG":"#dedede","borderColor":"#4C9AFF","borderRadius":3,"borderStyle":"solid","borderWidth":1,"icon":"editor/info","iconPrimary":"#FFFFFF","iconSecondary":"#0052CC","newMacro":false}
Code Block
{
  "response_map": {
    "successful": [
      {
        "snode_id": "...",
        "name": "..."
      },
      ...
    ],
    "failed": [
      {
        "status_code": 409,
        "reason": "...",
        "snode_id": "...",
        "name": "..."
      },
      ...
    ],
    "warnings": [
      {
        "message": "...",
        "snode_id": "...",
        "name": "..."
      },
      ...
    ]
  },
  "http_status_code": 200
}

Key

Type

Description

successful

array

An array of objects that contain:

  • the node ID

  • the asset or expression file that was successfully imported

For successfully updated accounts, (updated) is added after the label.

failed

array

An array of objects that contain:

  • the status code

  • the reason for the failure

  • the node ID

  • the asset or expression file that failed to be added or updated

warnings

array

An array of objects that contain:

  • the warning message

  • the node ID

  • the asset or expression file that generated warnings