Developer Guide > Data Integration Hub Publications and Subscriptions APIs > Events API
  

Events API

Use the Data Integration Hub Events REST API to view the list of events based on the search criteria. The API returns details such as the event history and the child events. The Data Integration Hub also returns the response code of the action that you perform in the API response.
The API uses the POST method.
Sample Files
The <DIH_InstallationDir>\samples\api\restapi\examples\event folder contains a sample client application and a readme file that describes the application.

Event Details REST API Request

To get the details of an event, use the following API URL:
http://<dih_serverHost>:<18080_port>/dih-console/api/v1/events
For example:
http://serverhost:18080/dih-console/api/v1/events
You must provide the required header, body, and authorization details.
To get the details of an event, use the following request syntax:
{
"applicationName": "String",
"partnerId": "int",
"topicName": "String",
"pubSubName": "String",
"timeFrame": "String or in the UTC Timezone format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')",
"descendantsEventState": "String",
"firstResult": "int",
"maxResults": "int",
"matchAll": "boolean",
"useExactMatch": "boolean",
"eventId": "Long",
"eventType": "String",
"eventStatus": "String"
}
The following table describes the elements of the request:
Property
Description
applicationName
Name of the publishing or of the subscribing application.
partnerId
The application ID of the partner that is associated with the publication or with the subscription.
topicName
Name of the topic that is associated with the publication or with the subscription.
pubSubName
Name of the publication or of the subscription.
timeFrame
You can either enter the UTC Timezone format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z') or select the range from the list of enum values.
{
"range": enum values
}
You can select the range from the following enum values:
  • - TODAY
  • - YESTERDAY
  • - LAST_24_HOURS
  • - LAST_7_DAYS
  • - LAST_30_DAYS
  • - CUSTOM
  • - NO_RANGE
Default range is TODAY.
You must mention the fromDate and toDate in the request body if the timeFrame range is set to CUSTOM.
{
"fromDate": "Date",
"toDate": "Date",
"range": "CUSTOM"
}
The fromDate and toDate must be in UTC Timezone format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
descendantsEventState
Optional. Specify the event state consumption status value from the following enum values:
  • - NONE
  • - DELAYED
  • - ERROR
  • - FINAL
  • - IN_PROCESS
firstResult
Specify the event number from which the results should be displayed. Default is zero.
maxResults
Specify the maximum number of results to display.
matchAll
Provide all the matches to the search expression when performing the search. Default is true.
useExactMatch
Exactly match the search expression when performing the search. Default is false.
eventId
ID of the event that Data Integration Hub generates for the publication or for the subscription.
eventType
The type of the event that Data Integration Hub generates for the publication or for the subscription. Select the value from the following enum values:
  • - PUBLICATION
  • - SUBSCRIPTION
  • - COMPOUND_SUBSCRIPTION
  • - UNBOUND_SUBSCRIPTION
  • - AGGREGATED_SUBSCRIPTION
  • - SYSTEM
eventStatus
The status of the event that Data Integration Hub generates for the publication or for the subscription. Select the value from the following enum values:
  • - ERROR
  • - COMPLETE
  • - DELAYED
  • - DISCARDED
  • - PROCESSING
  • - REPROCESSED
For example:
{
"applicationName": "CompoundSub",
"timeFrame": {
"fromDate": "2021-03-02T15:00:00.000+05:30",
"toDate": "2021-04-02T18:30:00.000+05:30",
"range": "CUSTOM"
},
"useExactMatch": "false",
"maxResults": "2"
}

Events API Response

When you use the Data Integration Hub Events API to get the details of a publication or a subscription event, the API returns the following event response:
The following is the response syntax to a request to query the details of an event:
{
"eventId": "Long",
"eventTypeName": "String",
"applicationName": "String",
"topicName": "String",
"pubSubName": "String",
"startTime": "Event StartTime :: Date",
"completedTime": "Event Completed Time :: Date",
"delayedTime": "Long (in milliseconds)",
"parentEventId": "Long",
"descendantsEventState": "enum mentioned in the request body.",
"childEvents": "List<EventDetailResponse>",
"eventHistory": {
"eventId": "Long",
"timeStamp": "Date",
"eventStatusName": "String",
"comments": "String"
}
}
The following table describes the elements of the request:
Property
Description
eventId
ID of the event that Data Integration Hub generates for the publication or for the subscription.
eventTypeName
Name of the type of the event that Data Integration Hub generates for the publication or for the subscription.
applicationName
Name of the application that is associated with the publication or with the subscription.
topicName
Name of the topic that is associated with the publication or with the subscription.
pubSubName
Name of the publication or of the subscription.
StartTime
The date when the publication or the subscription event started.
completedTime
The date when the publication or the subscription event ended.
delayedTime
Time taken for the event to change from delayed state to the next state such as, processing or discard state.
parentEventId
Creates a child event based on a profile ID and returns the event ID of the child event.
descendantsEventState
The enum value mentioned in the request body.
childEvents
The events available within the parent event.
eventHistory
The details of the complete event process. The following syntax appears in the eventHistory response:
{
"eventId": "Long",
"timeStamp": "Date",
"eventStatusName": "String",
"comments": "String"
}
Response codes
When you use the Data Integration Hub Events API to get the details of an existing event, Data Integration Hub returns the response code of the action that you perform in the API response.
The API can return the following response codes:
Code
Description
500
Internal Server Error. A response is returned if the filter parameters are invalid.
404
Not Found. A response is returned if there is a mistake in the request url.
200
OK. A response is returned when the request succeeds.
400
Bad Request. A response is returned when the request body is malformed or invalid.
For example:
[
{
"eventId": 9275,
"eventTypeName": "Subscription",
"eventStatusName": "Complete",
"applicationName": "TestCompoundSub",
"topicName": "ReprocessTest",
"pubSubName": "CompoundSub",
"startTime": "2021-04-01T08:55:09.486Z",
"completedTime": "2021-04-01T08:56:52.607Z",
"delayedTime": 80729,
"parentEventId": 10079,
"descendantsEventState": "NONE",
"childEvents": [],
"eventHistory": [
{
"eventId": 9275,
"timeStamp": "2021-04-01T08:55:09.486Z",
"eventStatusName": "Processing",
"comments": ""
},
{
"eventId": 9275,
"timeStamp": "2021-04-01T08:55:09.548Z",
"eventStatusName": "Delayed",
"comments": "Compound subscription."
},
{
"eventId": 9275,
"timeStamp": "2021-04-01T08:56:30.293Z",
"eventStatusName": "Processing",
"comments": "This event is a part of a compound subscription."
},
{
"eventId": 9275,
"timeStamp": "2021-04-01T08:56:52.607Z",
"eventStatusName": "Complete",
"comments": "reflected by event 9278"
}
]
},
{
"eventId": 9278,
"eventTypeName": "Compound Subscription",
"eventStatusName": "Complete",
"applicationName": "TestCompoundSub",
"topicName": "(multiple)",
"pubSubName": "CompoundSub",
"startTime": "2021-04-01T08:56:30.293Z",
"completedTime": "2021-04-01T08:56:52.622Z",
"delayedTime": 0,
"descendantsEventState": "NONE",
"childEvents": [],
"eventHistory": [
{
"eventId": 9278,
"timeStamp": "2021-04-01T08:56:30.293Z",
"eventStatusName": "New",
"comments": ""
},
{
"eventId": 9278,
"timeStamp": "2021-04-01T08:56:30.308Z",
"eventStatusName": "Processing",
"comments": "Released"
},
{
"eventId": 9278,
"timeStamp": "2021-04-01T08:56:52.622Z",
"eventStatusName": "Complete",
"comments": "Subscription to topic completed successfully"
}
]
}
]