0

Terminate an event from an integration

Hey guys, 

Trying to terminate an event using code in an integration but running into an error, can you please advise; the code looks right to me :)

(The event is active at the time of this post)

 

Code
======
// Send the request to kill the path to the API
var terminate = '{ "status":"terminated" }';
var killevent = http.request({
"endpoint": "xMatters",
"path": pathtoevent,
"method": "PUT",
"body": terminate,
});
var response = killevent.write();
======

Response
======
> PUT https://<company>.<deployment>.xmatters.com/reapi/2015-01-01/events/293065 HTTP/1.1
> Accept: text/plain, application/json, application/*+json, /
> X-Trace: 882d3e8c-07e4-42e8-a27e-9175c3982f1b,59ef33a7-90d0-4d6d-a5bd-c37b0f3be952
> User-Agent: Xerus (EndpointClient)
> Content-Type: application/json; charset=utf-8
> Content-Length: 0


< HTTP/1.1 400 Bad Request
< Date: Sun, 11 Dec 2016 12:14:15 GMT
< Cache-Control: no-cache,no-store,max-age=0
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Content-Type: text/plain
< Via: 1.1 xmatters
< Vary: Accept-Encoding
< X-FRAME-OPTIONS: SAMEORIGIN
< Strict-Transport-Security: max-age=3600; includeSubDomains; preload
< X-Robots-Tag: noindex
{"type":"DATA_FORMAT_ERROR","message":"Request data is malformed and cannot be parsed.","errorDetails":[{"jsonPath":"$","details":"com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input\n at [Source: [B@5e6ca2a0; line: 1, column: 1]"}]}
======

Used the following as a reference point: https://help.xmatters.com/OnDemand/xmodwelcome/communicationplanbuilder/appendixrestapi.htm?cshid=apiPUTevent#PUTevent

Any help is greatly appreciated... Thanks!

5 comments

Please sign in to leave a comment.