Send API Events to Servicenow using webhook

Hi I am trying to send an API Event using the webhook actions in elasticsearch watcher. However I am getting errors due to unknown fields in EventList. I ca send a API event from elasticsearch server using the CURL, so connection string seems to be fine, but unable to send the same through watcher.

Please point me in the right direction if I am making any mistake here. Action part from my watcher is below.

"actions" : {
"my_webhook" : {
"webhook" : {
"method" : "POST",
"url" : "https://servicenowurl",
"headers" : {
"Content-Type" : "application/yaml",
"x-api-key": "fsfwefasdfwqefdfadsfasfe"
},
"body" : {
"EventList":[
{
"severity":"minor",
"title":"This is a simulated event just for verifying that we can submit an issue to Event Agnostic API as a new event",
"node":"REMOTESERVER",
"eventsourcesendingserver":"elasticsearch",
"eventsourceexternalid":"1644562378276klt586kuy55r59001258",
"eventsourcecreatedtime":"2018-07-26T13:51:00+02:00",
"eventsourcebacksyncserver":"",
"category":"Linux",
"application":"VM",
"object":"Availability",
"relatedcihints": "23u32jjsdfsdf"
}
]
}
}
}
}

Thanks,

1 Like

Hi, I have exactly the same issue. Would it be possible that the json used is in json2 format and that the json parser cannot handle the syntax? Or has anybody figured it out?

Regards,

Philip

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.