Hey all, currently trying to pass a FreshService API call that contains html inside of the body (To pass tables), I’m unsure if this is possible or the best way to do it. I’ll show what I’m passing through right now, which is giving an invalid json format due to the html.
Your HTML code is incomplete, it cuts a tag at the end of your line. Wouldn’t it be part of your problem ?
Your code block shows color difference between the first lines and the last lines, which makes it look like there’s something not correct in the way it is built.
By passing it into VSCode I can see errors on your HTML line. The “margin: 0px” quotes are confusing the string you’re passing as the “description” value. Same issue happens on your path line.
I suggest you use escape characters for those. Use \" instead of just " for the margin part and \\ instead of just \ for the path part.
As you can see, it didn’t change the color issue. BUT, correcting the HTML incomplete tags issue will correct it, so you better look that out. Looking at it precisely in VSCode I see it was cut at the middle of the line 62.
Looking more closely, there’s something that bothers me but I’m not a HTML expert : Your tags are all in uppercase and in my editor they doesn’t show as working tags. But I’m not an expert so I don’t know about that behavior
So close your HTML code properly with the JSON I supplied you and retry
keep in mind, that attribute values will be surrounded by doublequotes
type=text/css vs type="text/css"
For placing doublequotes within a string we ahve to escape it with another doublequote: like: "Hello ""New"" World"
As it is about JSON we would also mention that it can be an option to serialize the HTML String and use the result as value e.g. for the description property