# Logic make web request

**URL:** <https://community.homey.app/t/logic-make-web-request/10335>\
**Category:** Questions & Help\
**Created:** [March 9, 2019, 4:36pm UTC](https://community.homey.app/t/logic-make-web-request/10335 "2019-03-09T16:36:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpol](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alpol/32/9485_2.png) [@Alpol](https://community.homey.app/u/Alpol)\
**Post date:** [March 9, 2019, 4:36pm UTC](https://community.homey.app/t/logic-make-web-request/10335/1 "2019-03-09T16:36:10Z")

</div>

Hello!

As Sony Android app no longer works on V2. I decided to make a flow which will make a POST request to my TV.

I’ve found a Siri shortcut for it: [https://www.reddit.com/r/shortcuts/comments/9oh4zh/control\_sony\_tv\_power\_offon\_and\_other\_tv\_commands/](https://www.reddit.com/r/shortcuts/comments/9oh4zh/control_sony_tv_power_offon_and_other_tv_commands/)

This shortcut works pretty well.

I know that homey has a http request app and also in v2 it can make requests via logic make web request. So I made a flow with logic card like this:  
Method: POST  
URL: [http://192.168.8.10/sony/IRCC](http://192.168.8.10/sony/IRCC)  
Headers: Content-Type:text/xml: charset=UTF-8 SOAPACTION:“urn:schemas-sony-com:service:IRCC:1#X\_SendIRCC” X-Auth-PSK:sony  
Body: \<?xml version="1.0"?\>\<s:Envelope xmlns:s=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)” s:encodingStyle=“[http://schemas.xmlsoap.org/soap/encoding/](http://schemas.xmlsoap.org/soap/encoding/)”\>\<s:Body\>\<u:X\_SendIRCC xmlns:u=“urn:schemas-sony-com:service:IRCC:1”\> AAAAAQAAAAEAAAAVAw==\</u:X\_SendIRCC\>\</s:Body\>\</s:Envelope\>

Everything just copied from shortcut.

But it returns 403, which means no pre-shared-key  
I didn’t use a {}.

I think problem with headers.

Could anyone help, how should I list headers there?

Or may be how should use this request in http request app?

Please help)

---

<div class="post-metadata">

**Author:** ![Alpol](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alpol/32/9485_2.png) [@Alpol](https://community.homey.app/u/Alpol)\
**Post date:** [March 15, 2019, 5:44pm UTC](https://community.homey.app/t/logic-make-web-request/10335/2 "2019-03-15T17:44:34Z")

</div>

Thanks to Ricardo Snoek, Jorden Chamid (legacy), Marco Frijmann (legacy).  
They just released new Sony Android app. Thanks!

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [August 16, 2020, 6:34am UTC](https://community.homey.app/t/logic-make-web-request/10335/3 "2020-08-16T06:34:43Z")

</div>

Did you manage to get this working. I am using the Logic web request card with PSK. But it wont work. The request gets send but nothing happens.

I did manage to get the Sony Android tv to start a app without using a PSK.

---

<div class="post-metadata">

**Author:** ![Alpol](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alpol/32/9485_2.png) [@Alpol](https://community.homey.app/u/Alpol)\
**Post date:** [August 16, 2020, 5:18pm UTC](https://community.homey.app/t/logic-make-web-request/10335/4 "2020-08-16T17:18:33Z")

</div>

I’m using this [Sony android tv](https://homey.app/en-us/app/name.ricardoismy.sonybraviaandroidtv/Sony-BRAVIA-Android-TV/) app. Before they released the app, I had to try requests, but no luck. So the app helped me a lot. Request in homey are too dumb, they do not support authentication, good xml headers and etc.

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [August 18, 2020, 7:56pm UTC](https://community.homey.app/t/logic-make-web-request/10335/5 "2020-08-18T19:56:14Z")

</div>

Thanx for your reply.

It took some thinking and some try and error, but I got it working. The quotes surrounding the Soapaction need to be taken literally and need to be escaped upon encoding by using the \ symbol. This means the url and the body look like this when using the http request app, POST XML card to toggle the tv on and off:

`{"method":"POST","protocol":"http:","host":"192.168.68.60","path":"/sony/ircc","headers":{"SOAPACTION":"\"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\"","X-Auth-PSK":"1111"}}`

`<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:X_SendIRCC xmlns:u="urn:schemas-sony-com:service:IRCC:1"> <IRCCCode>AAAAAQAAAAEAAAAVAw==</IRCCCode> </u:X_SendIRCC> </s:Body> </s:Envelope>`

Replace the host value to your tv’s IP and change the PSK to your own.

Hope this helps!
