HTTP ERROR: 401 Problem accessing /api/mid/em/inbound_event. Reason: Unauthorized

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2018 09:23 AM
When testing an external event integration to a MID Server, I'm using a command line utility [curl] to simulate an event message being sent to ServiceNow. I'm getting an error message response "Unauthorized" when trying to POST to the Event web interface. The Service Account seems to have all the necessary roles and Basic Authentication is being used and connectivity seems good. The problem is repeatable. I'm unable to discern anything from the MID Server logs. Can anyone help me understand why the MID Server won't accept the event message being sent?
Edited screenshot of the Web Context configuration attached.
This is Kingston with a dedicated MID Server configured for Event Integration. Output is below.
[root@host:/opt/]#curl -u integrationtestacct:UzNydjFjM04wdw== http://192.168.0.5:443/api/mid/em/inbound_event?Transform=jsonv2
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 </title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /api/mid/em/inbound_event. Reason:
<pre> Unauthorized</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>
- Labels:
-
Event Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 06:14 AM
Okay, let's track everything step-by step:
1. You created and then started the MID Server Web Context shown on the snapshot you attached.
2. Did you create and start a MID server Web Service Event Listener Context? When you do, you need to select the Web Context from point 1 in it:
3. Check the headers and body of the request. Here is an example that works:
Body:
{
"records": [
{
"source": "SCOM",
"event_class": "SCOM 2012 on scom.server.com",
"resource": "D:",
"node": "name.of.node.com",
"metric_name": "Percentage Logical Disk Free Space",
"type": "Disk space",
"severity": "4",
"description": "The disk 😧 on computer V-W2K8-abc.abc.com is running out of disk space. The value that exceeded the threshold is 38% free space.",
"additional_info": {
"scom-severity": "Medium",
"metric-value": "38",
"os_type": "Windows.Server.2008"
}
},
{
"source": "SCOM",
"event_class": "SCOM 2012 on scom.server.com",
"resource": "MSSQL-database-name",
"node": "other.node.com",
"metric_name": "DB Allocated Size (MB)",
"type": "Database Storage",
"severity": "3",
"description": "High number of active connections for MSSQL-database-name running on name.of.node.com. Active connections exceed 5000.",
"additional_info": {
"scom-severity": "High",
"metric-value": "5833",
"os_type": "Windows.Server.2008"
}
}
]
}
I hope that helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2019 03:58 PM
The issue was was finally resolved when the admin configured the JSON payload to be delivered with basic authentication. Although we'd provided instructions to do so, apparently that detail was overlooked by the admin.
By the way, the SN Support was adamant that direct integration of events from BPPM to directly to a ServiceNow Instance without a MID server is not supported at the time the effort was being made. This differed from other sources I researched, but it's what they said so it must be true.
Thank you for your response.