---
sourceDocument: Zurich IT Operations Management
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/it-operations-management

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# Pushing events to the MID Server using web service API

# Pushing events to the MID Server using web service API {#ariaid-title1}

* Release version: Zurich
* 
* Updated July 31, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read

Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Pushing events to the MID Server using web service API

This documentation explains how to configure and use the MID WebService Event Collector to push event messages to the MID Server via a web service API.
It enables ServiceNow customers to send event data from external event generators through the MID Server to their instance for Event Management purposes.
Show full answer Show less  

## Key Features

* **Default URL for event push:** Use the URL `http://{MIDServerIP}:{MIDWebServerPort}/api/mid/em/jsonv2` to send event messages in JSON v2 format, which matches the format used by clients sending events directly to the instance.
* **Support for custom payloads:** The MID Server accepts custom payloads in JSON, XML, or plain text formats. The events are transformed using a user-supplied script include before being sent to the instance.
* **Transformation scripts:** Users provide a script include with a `transform()` function to parse and map incoming event messages into ServiceNow event fields. A sample script, `TransformEventsxmlSample`, is provided for XML events.
* **Generic JSON support:** For generic JSON events, the provided script include `TransformEventsMidJsonGeneric` transforms fields into event data, storing unmapped fields as Additional Information.
* **Event message headers:** Set the `Content-Type` header according to the event format: `application/json` for JSON, `application/xml` for XML, and `text/plain` for text.
* **Authentication and security:** Supports API Key, mTLS, or Basic authentication. Secure data transmission options include using certificates from trusted authorities and the MID Unified Keystore for managing encryption and custom certificates.
* **Connectivity validation:** The API endpoint `/api/mid/em/ping` is available to verify connectivity with the MID Server.

## Practical Application for ServiceNow Customers

By configuring the MID WebService Event Collector and providing appropriate transform scripts, customers can integrate event sources that push events directly to the MID Server. This setup offers flexible data ingestion for Event Management, supports multiple data formats, and ensures secure, authenticated communication. Using the supplied examples and configuring headers correctly enables rapid integration and reliable event processing. The ability to handle custom payloads and transform them into ServiceNow events allows customers to tailor event ingestion to their specific needs.  
Configure the MID WebService Event Collector to provide a URL method to push event
messages to the MID Server.
The MID WebService Event Collector, by default, enables you to connect to an event generator and send event messages through the MID Server, using a URL in the format: `http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/jsonv2`

The JSON v2 format is the same as the format that clients use to send event messages
to the instance. This URL provides good performance.
For more information, see [Configure the MID WebService Event Collector Context](https://www.servicenow.com/docs/xz_3EnP5twMrVy9mNuOSIQ "Configure the MID WebService Event Collector Context to provide a URL method to push event messages from an external source to the MID Server.").  
Note:  
Event Management accepts events in the timezone of the MID Server through which the listener has sent the event message. If you require a different timezone, you can configure the script as required, see [Integrate with push connectors](https://www.servicenow.com/docs/2dfCgqDnqQVp~cUwef8ZSA "Integrate with a push connector to connect to an external event source. Push connectors process the collected event messages and transform them to the required event format.").

## URL to push custom payloads

The MID Server can also
receive a custom payload in JSON, XML, or plain text format. In this case, the MID Server transforms the event messages using the script include
that you provide, and then sends the events to the instance. The URL in this case
is:
`http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/inbound_event?Transform={Transform_script_name}` For an example of a script include, see the default `TransformEvents_xmlSample` script include.

For an example of how
the MID WebService Event Collector transforms JSON formatted event messages, see
[Event collection from BMC TrueSight and BMC TrueSight_v2](https://www.servicenow.com/docs/juzoWAaf4Dq8isigQhFlVw "The MID WebService Event Collector enables you to collect JSON formatted event messages sent from BMC TrueSight Operations Management (TrueSight), previously known as BMC ProactiveNet Performance Management (BPPM), utilizing event stream notification capabilities.").

To send events in generic JSON format, you can use the URL in this
format:

`http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/inbound_event?Transform=TransformEvents_MidJsonGeneric`

In
this case, the `TransformEvents_MidJsonGeneric` MID script include
that is provided in the base instance transforms the event messages into the event
fields. All fields are added as Additional Information fields
into the ServiceNow event that is generated.  
Note:  
The URL in the format `http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/{transform_script_name}`is also supported.

The REST API URL for validating connectivity is:
`http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/ping`

## Script include to transform collected events

Use the required MID Server
script include to transform (parse) collected event messages and populate them into
the mapped event field. The MID Server script include name
is composed of a prefix and suffix. The prefix is the mandatory text
`TransformEvents_` and the suffix is the transform name on the
URL, for example,
`http://{MID_Server_IP}:{MID_Web_Server_Port}/api/mid/em/xmlSample`
. The composed script name is therefore
`TransformEvents_xmlSample`.

You must supply a script include that receives the event messages in a text variable.
The script must have a `transform()` function that performs the
transformation and prepares the return array of Event objects. When the Event Management plugin is
activated, you are provided with the `TransformEvents_xmlSample`
sample include script that transforms events from XML format.  
Note:  
Event fields that are not identical to fields in the event table are saved in the Additional information field.

## Event message headers

Specify the relevant request header value for the Content-Type
field according to the format of the event message.
{#event-collection-via-MID-using-push__table_uqf_ldy_dy__entry__2}

| Message format | Content-Type value |
|-|-|
| JSON | application/json |
| XML | application/xml |
| text | text/plain |
[Table 1. Request header values for the Content-Type]

{#event-collection-via-MID-using-push__table_uqf_ldy_dy}

## Authentication and data security options

Options for authentication and data security:

* Authentication type, which can be set to either <kbd class="ph userinput">API Key</kbd>, <kbd class="ph userinput">mTLS</kbd>, or <kbd class="ph userinput">Basic</kbd>.
* Secure Connection, which lets you choose whether incoming and outgoing data is secured when transmitted. If you choose the advanced secured option, it requires that you obtain a certificate from a well-known certificate authority, and then provide the Keystore Certificate Alias and the Keystore Password.
* Use MID Unified Keystore, which provides encryption protection and enables you to install a custom certificate in the MID Server unified keystore. For details, see [Install custom
  certificates in the MID Server unified key store](https://www.servicenow.com/docs/access?context=mid-unified-keystore&version=zurich&pubname=zurich-servicenow-platform&ft:locale=en-US).
* Users must supply a script that receives the JSON, XML, or text formatted event messages in a text variable. The script must have a transform() function that performs the transformation and prepares the return array of event objects. The `TransformEvents_xmlSample` include script that transforms events from XML format is provided as an example when the Event Management plugin is activated.

{#event-collection-via-MID-using-push__ul_pz5_cgt_2x}For more information about authentication and data security, see [Configure the MID Web Server extension](https://www.servicenow.com/docs/RPQvfJbpCp6qgI_dATuFRg "The MID Web Server is a MID Server extension that enables developing REST APIs to send events and metrics to the MID Server. The extension is leveraged by other MID Server extensions, such as Metric Intelligence, MID WebService Event Listener, and the Agent Client Collector websocket endpoint extension.").
**Related tasks**   

* [Pushing events to the instance using web service API](https://www.servicenow.com/docs/1a4Dq7_J57RHmhmhqebnCw "You can use a web service interface, supported by ServiceNow, that operates on the JSON object as the data input and output format.")

