REST call to /api/now/table/em_event is not generating the additional_info field data in the format I would expect.

stevemacamway
Giga Expert

I am trying to call the Event table REST endpoint to insert a record, and for some reason the additional_info field is not being filled the way I would expect it to. I can't figure out what I am doing wrong. 

Here is the body of what I am sending:

{  
   "source":"postman",
   "event_class":"Dev",
   "message_key":"myMessageKeyXXX",
   "type":"increase",
   "severity":"3",
   "description":"Problem notification test",
   "additional_info":{
      "ProblemID":"XXXX"
   }
}

Everything seems to be showing up correctly, except the additional_info. I would expect to get this:

{"ProblemID":"XXXX"}

But instead I'm getting this:

{ProblemID=XXXX}

Any help someone can give would be much appreciated! 

Steve

1 ACCEPTED SOLUTION

HumanSky
Mega Guru

Try wrapping the braces with quotes. For instance:

"additional_info":"{
  'ProblemID':'XXXX'
}"

Don't forget to replace the double quotes with single quotes within the "additional_info" block.

Hope this helps.

View solution in original post

2 REPLIES 2

HumanSky
Mega Guru

Try wrapping the braces with quotes. For instance:

"additional_info":"{
  'ProblemID':'XXXX'
}"

Don't forget to replace the double quotes with single quotes within the "additional_info" block.

Hope this helps.

That worked perfectly - thanks! The only thing I had to do was remove the carriage returns inside the braces, otherwise I get an error back from ServiceNow (in Postman). Now hopefully where I actually want to do this from will be able to do the same!

Steve