- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-09-2025 02:54 AM
Hello Everyone,
Hope you are doing good. 
I am trying to configure push connector for events integration. When I am trying this in API Explorer, its not working as expected.
Below are my configurations
Created a push connector 
URL Parameter: https://<Instance_name>/api/sn_em_connector/em/inbound_event?source=TestEvent
Copied the code from ServiceNow docs "integrate with push connector" and modified the source value in the code by following the below link
(function process(/*RESTAPIRequest*/ request, body) {
	/*Function that receives a JSON object, adding all its fields to the Additional information object. The field name is a concatenation of the field key and the parent field key if it exists.*/
	function updateAdditionalInfo(event, field,jsonObject,additionalInfo) {
        for (var key in jsonObject) {
            var newKey = key;
            if (field != "") {
                newKey = field + '_' + key;
            }
			// You can do some transformation here and set fields on the event
			//if(key == "MySource")
			//   event.source = jsonObject[key];
            additionalInfo[newKey] = jsonObject[key];
        }
    }
    
    try
	{		
        gs.info("TransformEvents_generic received body:" + body);
		var jsonObject = JSON.parse(body);
        var event = new GlideRecord('em_event');
		event.source = "TestEvent"; //TODO: Need to define
        event.event_class = "GenericJsonClass"; //TODO: Need to define
        event.severity = "5";
		
        var additionalInfo = {};
        updateAdditionalInfo(event, "",jsonObject,additionalInfo);
		/*Iterates over Additional information JSON object and adds all nested objects' fields as fields of the Additional information object*/
        var notDone = true;
        while (notDone) {
            notDone = false;
            for (var key in additionalInfo) {
                if (Object.prototype.toString.call(additionalInfo[key]) == '[object Object]') {
                    notDone = true;
                    updateAdditionalInfo(event, key,additionalInfo[key],additionalInfo);
					additionalInfo[key] = "";
                }
            }
        }
		gs.info("TransformEvents_generic generated additional information:" + JSON.stringify(additionalInfo));
        event.additional_info = JSON.stringify(additionalInfo);
        event.insert();
	}
	catch(er){
		gs.error(er);
		status=500;
		return er;
	}
	return "success";
})(request, body);
When I am testing in Rest API explorer with below details its not working as expected
JSON code I add in explorer
{
  "source": "TestEvent",
  "node": "Test",
  "type": "Test",
  "message_key": "1234",
  "description": "Description Value",
  "severity": "1"
}
after execution getting the bad request error as below.
{
  "error": {
    "message": "No Push Connector Listener script found for given header or source ",
    "detail": ""
  },
  "status": "failure"
}
I know I might be doing something wrong in my configuration. Please help me to fix this issue. Thanks in advance!
Best Regards,
Ganesh
Solved! Go to Solution.
- Labels:
 - 
						
							
		
			Event Management
 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-10-2025 12:20 AM
Hello Everyone,
After configuring the steps mentioned in my question description
Followed the steps which are mentioned in below article
https://www.servicenow.com/docs/bundle/yokohama-it-operations-management/page/product/service-operat...
then copied the URL from URL parameter for end point, used basic auth and some sample json pay of event.
It was successfully able to create event in Event table. 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-09-2025 02:09 PM
Hi Ganesh,
In your push connector configuration, try changing Header name value to "user-agent" and Header value to "TestEvent"
This should fix your problem.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-09-2025 10:45 PM
@Jeffreys Quinti : I have modified the changes you suggested
In api explorer added the below information
JSON body as below
{
"source": "TestEvent",
"node": "Test",
"type": "Test",
"message_key": "1234",
"description": "Description Value",
"severity": "1"
}
but still getting the same error. Could you please help me here what else I should try.
Thanks for your reply. 
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
04-10-2025 12:20 AM
Hello Everyone,
After configuring the steps mentioned in my question description
Followed the steps which are mentioned in below article
https://www.servicenow.com/docs/bundle/yokohama-it-operations-management/page/product/service-operat...
then copied the URL from URL parameter for end point, used basic auth and some sample json pay of event.
It was successfully able to create event in Event table. 
