URL

POST https://{api-url}/api/v2/tenants/{tenantId}/integrations/install/{intgId}

Headers

  • Authorization: Bearer {accessToken}
  • Content-Type: application/json
  • Accept: application/json

Status code

200 OK

Sample URLs

To install email alerts:

https://{api-url}/api/v2/tenants/client_8/integrations/install/Email Alerts

To install email request:

https://{api-url}/api/v2/tenants/client_9/integrations/install/EMAILINCIDENTS

Parameters

FieldSubFieldData TypeDescription
displayNameN/AStringDisplay name for the integration.
logonameStringLogo name for the integration.
logofileStringBase64 code file of the logo.
ticketTypeN/AStringThe following ticket types are supported:
  • INCIDENT
  • SERVICEREQUEST
  • CHANGE
emailPropsnameStringName of parsing conditions set.
emailPropsidentifierStringUnique value of a set. Email data identifies the set with this identifier and parses with the respective parsing conditions.
emailPropsidentifierSourceStringSource for considering the unique value.
Supported Values: EMAIL_SUBJECT, EMAIL_CONTENT, DEFAULT_VALUE.
emailPropsproperties: nameStringName property for the email. Example: Alert State
emailPropsproperties: defaultValueStringDefault Value is considered if any of the properties do not match with the respective configured values.
emailPropsproperties: condition: contentSourceStringSource condition to filter the values from the email data. Source from which the values should be considered.
Supported Values: EMAIL_SUBJECT, EMAIL_CONTENT, DEFAULT_VALUE.
emailPropsproperties: condition: operatorStringUnique keys condition to filter the values from the email data. Unique keys required to filter the values from the content source.
Supported Values: BETWEEN, BEFORE, AFTER, MATCHES.
emailPropsproperties: condition: startValueStringInitial value condition to filter the values from the email data.
emailPropsproperties: condition: endValueStringEnd value condition to filter the values from the email data.
Start value and End value are filter properties. These properties are used to filter a certain value between the start value and end value.
emailPropsproperties: condition: regexStrStringRegex string condition to filter the values from the email data.
Provide a regex string of the value that considered from the content source.
emailPropsproperties: propertyMappings: attrValues : attrValueStringAttribute values. OpsRamp attributes that map to third-party attributes.
emailPropsproperties: propertyMappings: attrValues: thirdPartyAttrValueStringAttribute values. Map third-party attributes that map to OpsRamp attributes.
inboundConfigdropAlertsOnUnmanagedResourcesBoolean(Optional) When enabled, this parameter discards alerts from resources that are unmanaged. It is applicable only for email alerts. Options: true/false. Default: false

NA indicates that the value is not applicable.

Sample 1 - Install email alert integration

All incoming alert emails are processed. Apply user-defined rules to create, acknowledge, and close alerts incoming emails.

https://{api-url}/api/v2/tenants/client_8/integrations/install/Email Alerts

Convert image to Base64 and enter the code in file field as shown in the following sample request.

Sample request

{
	"displayName" : "email alerts test",
	"inboundConfig" : {
			"dropAlertsOnUnmanagedResources" : "true"
	},
		"emailProps":[{
			"name":"test set 1",
			"identifier":"identify",
			"identifierSource":"EMAIL_CONTENT",
			"properties": [{
				"name":"Alert State",
				"defaultValue":"OK",
				"condition":{
					"contentSource": "EMAIL_CONTENT",
					"operator": "BETWEEN",
					"startValue": "word1",
					"endValue": "word2"
				}
			},{
				"name":"Service Name",
				"condition":{
					"contentSource": "EMAIL_CONTENT",
					"operator": "BETWEEN",
					"startValue": "word1",
					"endValue": "word2"
				}
			},
			{
				"name":"Device Host Name",
				"condition":{
					"contentSource": "EMAIL_CONTENT",
					"operator": "BETWEEN",
					"startValue": "word1",
					"endValue": "word2"
				}
			}
			]
		}]
}

Sample response

{
  "id": "INTG-d9b99937-7906-42c7-955c-68a237144ac7",
  "displayName": "email alerts test",
  "integration": {
    "id": "Email Alerts",
    "name": "Email Alerts",
    "multipleInstallations": true
  },
  "emailAddress": "alerts@5JHqWy4h34xXDwN2gYFtmaYx.opsramp.com",
  "inboundConfig": {
        "dropAlertsOnUnmanagedResources": "true"
  },
  "emailProps": [
    {
      "name": "test set 1",
      "identifier": ".",
      "identifierSource": "EMAIL_CONTENT",
      "properties": [
        {
          "name": "Alert State",
          "defaultValue": "OK",
          "condition": {
            "contentSource": "EMAIL_CONTENT",
            "operator": "BETWEEN",
            "startValue": "word1",
            "endValue": "word2"
          }
        },
        {
          "name": "Service Name",
          "condition": {
            "contentSource": "EMAIL_CONTENT",
            "operator": "BETWEEN",
            "startValue": "word1",
            "endValue": "word2"
          }
        },
        {
          "name": "Device Host Name",
          "condition": {
            "contentSource": "EMAIL_CONTENT",
            "operator": "BETWEEN",
            "startValue": "word1",
            "endValue": "word2"
          }
        }
      ]
    }
  ],
  "alertSource": {
        "id": 6,
        "name": "Email Alerts",
        "displayName": "Email Alerts",
        "techUid": "Email Alerts"
    },
    "installedBy": "opsramp_api_user",
    "installedTime": "2020-10-09T08:30:49+0100",
    "status": "enabled"
}

Sample 2 - Install email request integration

Email request integration creates tickets in OpsRamp using email.

https://{api-url}/api/v2/tenants/client_9/integrations/install/EMAILINCIDENTS

Convert image to Base64 and enter the code in file field as shown in the following sample request.

Sample request

{
	"displayName" : "email incidents test",
	"ticketType": "INCIDENT",
		"emailProps": [{
			"properties": [{
				"name": "Priority",
				"defaultValue": "Low",
				"condition": {
					"contentSource": "EMAIL_CONTENT",
					"operator": "BETWEEN",
					"startValue": "word1",
					"endValue": "word2"
				},
				"propertyMappings": {
					"attrValues": [{
						"attrValue": "Low",
						"thirdPartyAttrValue": "myval"
					}]
				}
			}, {
				"name": "Subject",
				"condition": {
					"contentSource": "EMAIL_CONTENT",
					"operator": "BETWEEN",
					"startValue": "word1",
					"endValue": "word2"
				}
			}, {
				"name": "Description",
				"value":"Email Description"
			} , {
				"name":"Allow anonymous user",
				"value":"true"
			}]
		}]
}

Sample response

{
  "id": "INTG-02d467ee-41f2-4d1e-9c55-e8365b421f21",
  "displayName": "email incidents test",
  "integration": {
    "id": "EMAILINCIDENTS",
    "name": "Email Requests",
    "multipleInstallations": true
  },
  "emailAddress": "incidents@5JHqWy4h34xXDwN2gYFtmaYx.opsramp.com",
  "emailProps": [
    {
      "properties": [
        {
          "name": "Allow anonymous user",
          "value": "true"
        },
        {
          "name": "Subject",
          "value": "Email Subject"
        },
        {
          "name": "Description",
          "value": "Email Description"
        },
        {
          "name": "Priority",
          "defaultValue": "Low",
          "condition": {
            "contentSource": "EMAIL_CONTENT",
            "operator": "BETWEEN",
            "startWord": "word1",
            "endWord": "word2"
          },
          "propertyMappings": {
            "name": "Priority",
            "attrName": "incident.priority.name",
            "entityType": "INCIDENT",
            "attrValues": [
              {
                "attrValue": "Low",
                "thirdPartyAttrValue": "myval"
              }
            ]
          }
        }
      ]
    }
  ],
  "installedBy": "opsramp_api_user",
  "installedTime": "2020-10-08T11:02:23+0100",
  "status": "enabled"
}