Skip to main content
Skip table of contents

Environments Manager API

Overview

This document describes the way the Environments Manager API interacts and allows the Environments Manager to transfer applications' information between different OCP environments.

Authentication

Navigate to the API Authentication to learn more about Authorization Token Endpoint and Authentication process.

HTTP Code Responses

Omilia's HTTP response codes can be found on the HTTP Codes Responses page.

API Reference

Application Status

Report API version, authentication parameters, and external services status.

GET/envs-manage/api/status

Response Success

JSON
{
  "version": "1.12.0",
  "auth": {
    "realm": "master",
    "client_id": "ocp",
    "url": "https://aws-dev-m.ocp.ai/auth"
  },
  "server_start_time": "2023-12-08T13:50:22.371715+00:00",
  "services_status": {}
}

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}
}

Export application

Exports the application.

GET/envs-manager/api/v1/apps/{{app_id}}/export

Query parameters

Parameter

Type

Required

Description

app_id

string

yes

The Application ID

include_nlus

boolean

no

Select to include NLUs that exist in the target environment in the export. Default is false.

Response success

JSON
"string"

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Validation Error

JSON
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Promote Application

POST/envs-manager/api/v1/apps/{{app_id}}/promote

URL parameters

Parameter

Type

Required

Description

app_id

string

yes

The Application ID

Response success

JSON
{
  "data": "string"
}

Bad Request

JSON
{
  "errors": [
    {
      "status": 400,
      "code": "1022",
      "title": "Bad Request",
      "detail": "Description too long",
      "source": "/body/description",
      "meta": {}
    }
  ]
}

Conflict

JSON
{
  "errors": [
    {
      "status": 400,
      "code": "1022",
      "title": "Bad Request",
      "detail": "Description too long",
      "source": "/body/description",
      "meta": {}
    }
  ]
}

Validation Error

JSON
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Import File

Import an application.

Parameter include_nlu, defines whether NLUs that exist in target environment are included.

POST/envs-manager/api/v1/apps/import

Headers

Content-type : multipart/form-data

Body parameters

Parameter

Type

Required

Description

file

string

yes

The application file

target_app_name

string

no

Select a name for the application name

target_group

string

yes

Select the group where the application will be imported

include_nlu

boolean

no

Select to include NLUs that exist in the target environment in the import. Default is false.

skip_nlu_models

boolean

no

The parameter used to import NLUs without creating the models, only apps. (Default is false)

Response success

JSON
{
  "data": "string"
}

Bad Request

JSON
{
  "errors": [
    {
      "status": 400,
      "code": "1022",
      "title": "Bad Request",
      "detail": "Description too long",
      "source": "/body/description",
      "meta": {}
    }
  ]
}

Conflict

JSON
{
  "data": "string"
}

Validation Error

JSON
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Get Apps

Gets all the applications.

GET/envs-manager/api/v1/apps

Response success

JSON
[
  {
    "id": "string",
    "created_at": "2023-06-20T12:50:54.362Z",
    "updated_at": "2023-06-20T12:50:54.362Z",
    "user_id": "string",
    "name": "string",
    "group": "string",
    "component_id": "string",
    "sandbox_flowapp_id": "string",
    "production_flowapp_id": "string"
  }
]

Bad Request

JSON
{
  "errors": [
    {
      "status": 400,
      "code": "1022",
      "title": "Bad Request",
      "detail": "Description too long",
      "source": "/body/description",
      "meta": {}
    }
  ]
}

Get Token

Acquire an access token by providing username and password.

POST/envs-manager/api/v1/auth/token

Body parameters

Parameter

Type

Required

Description

username

string

yes

The name of the user

password

string

yes

Provide a password

Response success

JSON
{
  "access_token": "string"
}

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Validation Error

JSON
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}


Introspect Token

Get the endpoint to introspect tokens.

GET/envs-manager/api/v1/auth/token/introspect

Response success

JSON
{
  "data": {
    "sub": "string",
    "email": "string",
    "preferred_username": "string",
    "resource_access": {
      "ocp": {
        "roles": [
          "string"
        ]
      }
    },
    "ocp_groups": [],
    "given_name": "string",
    "family_name": "string"
  }
}

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Tags

Gets tags.

GET/envs-manager/api/v1/apps/{{app_id}}/tags

URL parameters

Parameter

Type

Required

Description

app_id

string

yes

The Application ID

Response success

JSON
{
  "total": 0,
  "data": [
    "string"
  ]
}

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Validation Error

CODE
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Export Tag

GET/envs-manager/api/v1/apps/{{app_id}}/tags/{{tag}}/export

Body parameters

Parameter

Type

Required

Description

app_id

string

yes

The Application ID

tag

string

yes

Select a tag

include_nlu

boolean

no

Select to include NLUs that exist in the target environment in the import. Default is true.

Response success

JSON
"string"

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Validation Error

CODE
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Delete App Tag

Deletes Application Tag.

DELETE/envs-manager/api/v1/apps/{{app_id}}/tags/{{tag}}

Body parameters

Parameter

Type

Required

Description

tag

string

yes

Select a tag

app_id

string

yes

The Application ID

Response success

JSON
"string"

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Validation Error

CODE
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Promote Tag

Promotes tag.

POST/envs-manager/api/v1/apps/{{app_id}}/tags/{{tag}}/promote

Body parameters

Parameter

Type

Required

Description

tag

string

yes

Select a tag

app_id

string

yes

The Application ID

Response success

JSON
{
  "data": "string"
}

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]

Conflict

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Validation Error

CODE
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Import Tag

Imports the resources provided in the zip file but only in the runtime.

POST/envs-manager/api/v1/apps/{{app_id}}/tags/import

URL Parameters

Parameter

Type

Required

Description

app_id

string

yes

The Application ID

Body Parameters

Parameter

Type

Required

Description

file

string

yes

The application file

deployment_type

string

no

The type of deployment

Response success

JSON
{
  "data": "string"
}

Bad Request

JSON
{
  "errors": [
    {
      "code": "1022",
      "detail": "Description too long",
      "meta": {},
      "source": "/body/description",
      "status": 400,
      "title": "Bad Request"
    }
  ]
}

Conflict

JSON
{
                "data": {
                    "id": None,
                    "name": None,
                    "group": "ocp-qa",
                    "has_errors": True,
                    "created": False,
                    "message": "Errors occurred during app import.",
                },
                "errors": [
                    {
                        "title": "orc_export_test",
                        "detail": "Oops",
                    },
                    {
                        "title": "orc_export_test_flow",
                        "detail": "Oops",
                    },
                ],
            },

Validation Error

CODE
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.