Hi here is a another solution using template nodes, less code involved
The incoming payload is used to replace the {{ }} elements
[{"id":"d73dc21f.27ed1","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload.value","v":"20","vt":"num"},{"p":"payload.units","v":"c","vt":"str"},{"p":"payload.type","v":"temp","vt":"str"},{"p":"payload.channel","v":"2","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":310,"y":380,"wires":[["92d7423f.eba6f"]]},{"id":"92d7423f.eba6f","type":"template","z":"190c8195.72b3be","name":"set topic","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"v1/A1234B5678C/things/0123-4567-89AB-CDEF/data/{{payload.channel}}","output":"str","x":460,"y":400,"wires":[["ed920794.90dd8"]]},{"id":"ed920794.90dd8","type":"template","z":"190c8195.72b3be","name":"set payload","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.type}},{{payload.units}}={{payload.value}}","output":"str","x":650,"y":400,"wires":[["aed6a948.29dd68"]]},{"id":"aed6a948.29dd68","type":"debug","z":"190c8195.72b3be","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":440,"wires":[]}]
This way you can copy and paste any JSON and use {{ }} to replace any element of that JSON.
@Colin see links above they take you straight to the formats in my browser