Moogsoft Docs

/integrations

The /integrations endpoint allows you to create new integrations.

To read and update existing integrations see /integrations/{integrationId}.

Back to Integrations API Endpoint Reference.

POST

Creates an integration's configuration.

Request arguments

The POST request takes the following request arguments:

Name

Type

Required

Description

type_id

String

Yes

Type of integration to add, for example Webhook

inputs

String

Yes

The key and value of inputs to substitute into the integration's configuration. This can include username, password, URL to poll, and timing intervals.

name

String

Yes

Name of the integration to add, for example Webhook1

version

String

Yes

Version of the integration to use. For validation purposes, this must be the most recent version.

Response

The POST request returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Description

readonly

List

Read-only details about the integration. This can include the webhook URL of the integration and authorisation details.

type_id

String

Type of integration you have created.

inputs

String

Username (value) and password (key) you have configured to authenticate with the integration.

name

String

Name of the integration you have created.

id

Integer

ID of the integration you have created.

version

String

Version of the integration you have created.

config

Object

The integration's configuration.

Examples

The following examples demonstrate typical use making a POST request to the endpoint integrations:

Request example

Example cURL POST request to create a Webhook integration:

curl -X POST \
https://example.com/integrations/api/v1/integrations \
-u John.Doe:MyPassword \
-d '{
    "type_id": "Webhook",
    "inputs": [
    {
        "name": "username",
        "value": "<username>"
    },
    {
        "name": "password",
        "value": "<integrationpassword>"
    }
    ],
    "name": "Webhook1",
    "version": "1.14"
    }'
Response example

Example response returning the new Webhook integration's configuration:

{
    "id": 4,
    "name": "Webhook2",
    "type_id": "Webhook",
    "version": "1.14",
    "config": {
        "category": "monitoring",
        "description": "A webhook integration to allow events to be sent via generic REST and processed by Moogsoft AIOps.",
        "display_name": "Webhook",
        "type_id": "Webhook",
        "version": "1.14",
        "config": {
            "monitor": {
                "name": "Webhook Lam Monitor",
                "class": "CRestMonitor",
                "port": "$config#port()",
                "authentication_type": "basic_auth_static",
                "basic_auth_static": {
                    "username": "John.Doe",
                    "password": "Password123"
                },
                "use_ssl": false,
                "accept_all_json": true,
                "lists_contain_multiple_events": true,
                "num_threads": 5,
                "rest_response_mode": "on_receipt",
                "rpc_response_timeout": 20
            },
            "constants": {
                "severity": {
                    "CLEAR": 0,
                    "INDETERMINATE": 1,
                    "WARNING": 2,
                    "MINOR": 3,
                    "MAJOR": 4,
                    "CRITICAL": 5,
                    "0": 0,
                    "1": 1,
                    "2": 2,
                    "3": 3,
                    "4": 4,
                    "5": 5,
                    "moog_lookup_default": 1
                }
            },
            "conversions": {
                "sevConverter": {
                    "input": "STRING",
                    "output": "INTEGER",
                    "lookup": "severity"
                },
                "stringToInt": {
                    "input": "STRING",
                    "output": "INTEGER"
                }
            },
            "filter": {
                "presend": "WebhookLam-SolutionPak.js",
                "modules": [],
                "dependencies": {
                    "lambot": [
                        "LamBot.js",
                        "WebhookLam-SolutionPak.js"
                    ],
                    "contrib": []
                }
            },
            "mapping": {
                "lambotOverridden": [],
                "catchAll": "overflow",
                "rules": [
                    {
                        "name": "signature",
                        "rule": "$source::$type"
                    },
                    {
                        "name": "source_id",
                        "rule": "$source_id"
                    },
                    {
                        "name": "external_id",
                        "rule": "$external_id"
                    },
                    {
                        "name": "manager",
                        "rule": "$manager"
                    },
                    {
                        "name": "source",
                        "rule": "$source"
                    },
                    {
                        "name": "class",
                        "rule": "$class"
                    },
                    {
                        "name": "agent",
                        "rule": "$LamInstanceName"
                    },
                    {
                        "name": "agent_location",
                        "rule": "$agent_location"
                    },
                    {
                        "name": "type",
                        "rule": "$type"
                    },
                    {
                        "name": "severity",
                        "rule": "$severity",
                        "conversion": "sevConverter"
                    },
                    {
                        "name": "description",
                        "rule": "$description"
                    },
                    {
                        "name": "agent_time",
                        "rule": "$agent_time",
                        "conversion": "stringToInt"
                    }
                ]
            }
        },
        "ha_profile": "active_active"
    },
    "inputs": [
        {
            "key": "username",
            "value": "password"
        }
    ],
    "readonly": [
        {
            "name": "url",
            "description": "URL:",
            "value": "https://example.com/integrations/api/v1/events/webhook2"
        },
        {
            "name": "userid",
            "description": "User ID:",
            "value": "<username>"
        },
        {
            "name": "readonly_password",
            "description": "Password:",
            "value": "<password>"
        },
        {
            "name": "auth",
            "description": "Base64 Encoded Auth:",
            "value": "Basic YWRtaW46"
        }
    ]
}