I’m not sure what I’m doing wrong with the formatting here. I’m running this in a Mac terminal. The command is direct from the docs with the spaces removed and escape characters added before the "
Executing activities works fine
curl -X POST localhost:47147/api/v1/runactivity -d ‘{“activity_uuid”:“5DCDB8AE-0F7D-49D1-B4AB-7E53E676AB23”}’
{“status”:“success”,“data”:{},“code”:200}
But running device commands does not
curl -X POST localhost:47147/api/v1/sendcommands -X POST -d ‘{“delay”:“1000”,“commands”:[{“type”:“command”,“params”:{“command”:“PAUSE”,“device”:“7E0B4B82-5919-487E-A3C7-6205A9F2BF27”,“repeat”:“constant”}}]}’
{“status”:“fail”,“data”:“BadParams”,“code”:400,“message”:“Missing command array”}
Tries without the escape characters
curl -X POST localhost:47147/api/v1/sendcommands -X POST -d ‘{“delay”:“1000”,“commands”:[{“type”:“command”,“params”:{“command”:“PAUSE”,“device”:“7E0B4B82-5919-487E-A3C7-6205A9F2BF27”,“repeat”:“constant”}}]}’
{“status”:“fail”,“data”:“BadParams”,“code”:400,“message”:“Invalid command(s)”}