exiva / Vizio_SmartCast_API

API documentation for Vizio SmartCast TV's
173 stars 33 forks source link

how to execute T_ACTION_V1? #42

Open DanMabee opened 8 months ago

DanMabee commented 8 months ago

Hoping someone can fill me in on something not mentioned in the docs (i think)

I ran this: curl.exe -k -H "Content-Type: application/json" -H "AUTH: xxx" -X GET https://192.168.1.11:7345/menu_native/dynamic/tv_settings/admin_and_privacy/soft_power_cycle|json_pp

and got this:

{
   "STATUS" : {
      "RESULT" : "SUCCESS",
      "DETAIL" : "Success"
   },
   "HASHLIST" : [
      3194182953,
      4047939753
   ],
   "ITEMS" : [
      {
         "VALUE" : "T_ACTION_V1",
         "TYPE" : "T_ACTION_V1",
         "CNAME" : "soft_power_cycle",
         "NAME" : "Reboot TV",
         "HASHVAL" : 4050647667
      }
   ],
   "PARAMETERS" : {
      "HELPTEXT" : "FALSE",
      "FLAT" : "TRUE",
      "HASHONLY" : "FALSE"
   },
   "URI" : "/menu_native/dynamic/tv_settings/admin_and_privacy/soft_power_cycle"
}

i thought perhaps this would poke it: curl.exe -k -H "Content-Type: application/json" -H "AUTH: xxx" -X PUT -d "{""REQUEST"": ""MODIFY"",""VALUE"": ""T_ACTION_V1"",""HASHVAL"": 4050647667}" https://192.168.1.11:7345/menu_native/dynamic/tv_settings/admin_and_privacy/soft_power_cycle|json_pp

but alas, no. i get:

{
   "PARAMETERS" : {
      "REQUEST" : "MODIFY",
      "VALUE" : "T_ACTION_V1",
      "HASHVAL" : 4050647667
   },
   "URI" : "/menu_native/dynamic/tv_settings/admin_and_privacy/soft_power_cycle",
   "STATUS" : {
      "DETAIL" : "Proxy error",
      "RESULT" : "PROXY_ERROR"
   }
}

Does anyone listening know how to use an action correctly? Thanks.

DanMabee commented 8 months ago

hey, just figured it out. might want to add this to the docs. rather than "REQUEST": "MODIFY" use "REQUEST": "ACTION" and it works