Submit and Fetch with Webdat or TCP to communicate with API

I’m trying to work out communication with an HRS API for turning on and off TVs. The documentations says it receives messages in json to trigger macros in the api. Curious if anyone has tried this before and the best strategy for doing so. Here is the documentation for the api:
hrscontrol.com/releases/Ente … rvices.pdf

I’m currently working on sending it through a webdat with tables but I’m not making any ground. The network is local. The macros are set and named. Thanks in advance.

I didn’t read the docs, but normally you communicate with hardware through TCP/IP DAT or UDP DAT. Web DAT is more-so geared for pinging web servers. Easiest way to test is to make your JSON by hand first and use the Python script:

some_json = '{"some":"json"}'
op('tcpip1').send(some_json)

Be aware you might need to add terminators to the send() command, you can see those here:
derivative.ca/wiki088/index. … pDAT_Class

Have you done Python stuff in TouchDesigner?

I have been using some python but lately less so on conventional stuff.
I got it worked out using:

import json
macroOne= json.dump({'this':way','to':'macro','number':'1'})
op('udpout').send(macroOne, terminator = '\r\n')

Got it to control 4 tv’s turning on or off simultaneously! next test is 21 tv’s :smiley: .
Thanks man, very much appreciate the help!

No problem, glad it worked.