Hello everyone, I’m experimenting with HA API. I’m trying to interact with my LG TV to turn it off or change channel through an API call. I want to do it with Apple Shortcuts app but I’m actually experimenting with Postman on my Mac. To turn the TV off the URL I use is: http://IPADDRESS:8123/api/services/media_player/turn_off and as a body { "entity_id": "media_player.lg_tv_remote" }
. The result is an error: 405: Method Not Allowed. How is the correct way to make a correct call?
did you ever get this working?
I just started using HA and I've been working on this as well.
Though this is an older question, my experience may be useful for others.
It works okay with this command:
curl -X POST -H "Authorization: Bearer <secret key>" " -H "Content-Type: application/json" -d '{"entity_id": "media_player.mediabox_2"}' http://xx.xx.xx.xx:8123/api/services/media_player/turn_on
(mediabox_2 is my Ziggo set top box)