Create an API version from a project
Creates an API version with the assets of an existing project.
POST https://{controlplane_path}/api/1/rest/public/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
- The "plex_path" attribute is case sensitive.
- Only Snaplexes placed in the global
sharedfolder are accessible in APIM.
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:
|
Query parameters
None.
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
{
"project_path": "...",
"plex_path": "...",
"api": "...",
"version": "...",
"tags": [...],
"description": "...",
"asset_types": [...]
}
| Key | Type | Description |
|---|---|---|
project_path |
string | Required. The path to the source project. |
plex_path |
string | Required. The path to the Snaplex. Note: This attribute is case sensitive and only Snaplexes in the global shared folder are accessible in APIM. |
api |
string | Required. The name of the API. |
version |
string | Required. The version identifier for the API version. |
tags |
array | Optional. Array of tags to apply to the API version. |
description |
string | Optional. Description of the API version. |
asset_types |
array | Required. Array of asset types to include. Allowed values: File, Job, Account, Pipeline, Policy. |
Response
{
"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:
|
400 |
{"message": "Invalid asset type. Allowed assets are ['File', 'Job',
'Account', 'Pipeline', 'Policy']."} |
|