Import an API version
POST https://{controlplane_path}/api/1/rest/public/apim/import_version/{import_path}?{query_parameter}
This API imports an API version from one control plane/Org to another using a public API. Alternatively, when import you can both update the accounts used and add expressions to the API version.
Prerequisites
- Write permission on the target API to import the API version
Path parameters
| Key | Description |
|---|---|
import_path |
The path to the target API.
Note: The path is case-sensitive.
|
Query parameters
| Key | Type | Description |
|---|---|---|
duplicate_check |
boolean |
|
overwrite_types |
list |
The types of assets that can be overwritten, if an asset with the same name already exists in the destination API version. Valid values:
Note:
|
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
| Key | Type | Description |
|---|---|---|
file |
string | The unmodified ZIP file of the exported source API version. |
file_account |
string |
The JSON file containing the list of accounts to modify.
|
file_expr |
string |
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:
|
Response
{
"response_map": {
"successful": [
{
"snode_id": "65b124ad2c22dd5a9d774dff",
"name": "Sample Book API-Test-1.0.0.json"
},
{
"snode_id": "65b124daca75d153d3026009",
"name": "Sample Book API-Test-1.0.0-2024-01-24 14:55:20.json"
},
{
"snode_id": "65b129e90d78973459c47123",
"name": "Sample Book API-Test-1.2.0.json"
},
{
"snode_id": "65b124aa411a3e956a84876a",
"name": "books_pipeline"
},
{
"snode_id": "65b124aa505cc8be84f2707e",
"name": "books"
}
],
"failed": [],
"warnings": []
},
"http_status_code": 200
}
Error handling
{
"response_map": {
"successful": [
{
"snode_id": "65b124ad2c22dd5a9d774dff",
"name": "Sample Book API-Test-1.0.0.json"
},
...
],
{
"http_status_code": 400,
"response_map": {
"error_list": [
{
"message": "Expecting body argument for endpoint import_version: file_handle"
}
]
}
}
{
"response_map": {
"successful": [],
"failed": [
{
"reason": "SLDB put request failed for https://canary.elastic.snaplogicdev.com/api/1/rest/slfs/Automation2/apim/testapi/1.1/Sample%20Book%20API-Test-1.0.0.json",
"snode_id": "65b124ad2c22dd5a9d774dff",
"name": "Sample Book API-Test-1.0.0.json",
"status_code": 409
},
"warnings": [
{
"snode_id": "65b124aa505cc8be84f2707e",
"name": "books",
"message": "If this task gets imported, it will be disabled as there is no pipeline found."
}
]
},
"http_status_code": 200
}
| HTTP Status Codes | Status | Description | Resolution |
|---|---|---|---|
200 |
successful |
An array of objects that contains the successfully imported node ID, the asset, or an expression file. | N/A |
400 |
Bad Request |
The request was unacceptable, often because of a missing required parameter. |
|
409 |
Conflict |
This response is sent when a request conflicts with the current state of the server. |
|
warnings |
warning |
This response is sent when your request of the import will disable the task because the asset is not present. | Verify that all the assets are in place to avoid disabling the task that is being imported. |