This is the code, called from a shell script:

ubus call mqtt pub ‘{“api”:“/user/data”, “data”:"’“$message”‘"}’

$message is a multiline shell string collected from a few prior commands. The same string is similarly put into a JSON that gets posted to slack and does come through as multiline. I haven’t poked into it too much to see if I can get it to do the multiline with different formatting.