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

Nate10
Kilo Contributor

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>

6 REPLIES 6

robertgeen
Tera Guru

Izzy,

Are you meaning to send this to the mid server? Most people send directly to the cloud instance itself but obviously you can send it to the MID server using the new interfaces they deployed in the last few versions. Did you following the instructions in this section (I believe this is where you would do it):

https://docs.servicenow.com/bundle/kingston-it-operations-management/page/product/event-management/task/configure-midwebserver-extension.html#configure-midwebserver-extension

 

 

Thank you Robert.

Yes, this is and effort to integrate with a specific MID server, no directly to the SN instance. We do have a parallel effort to send directly to the SN instance, but that's a separate discussion. 

I'm familiar with the link you provided and have followed the instructions contained within it, but there's not enough detail to provide any further guidance with my specific issue. 

Thank you for your help, but this doesn't answer the question. 

Ok next follow-up question. In the mid server extension section I believe you have to provide it a username/password if you select basic authentication right? I believe that links back to a credential record in ServiceNow so make sure that the username and password matches that credential entry. It won't be an account within ServiceNow it's specifically the credential chosen on that extension form (I do apologize for being vague as I have only done this once and it was a while ago and I don't have access to my PDI at the moment to check).

I agree, the account name on the form matches an account name in the user table. The password is verified matching, but still no change in behavior.