I want to develop a Remote control for iOS devices. For that, I am using the below API to get a token from Samsung TV but it's not returning me Token which I can use for further Remote control commands. ws://192.168.29.53:8001/api/v2/channels/samsung.remote.control?name=U2Ftc3VuZ1JlbW90ZUFwcA==
I am able to get connected TV information by iOS SDK. My TV and app are connected to the same network connection.
The above API gives me the response as below:
{ "event": "ms.channel.connect", "data": { "id": "9bcfee40-66a0-11ee-885d-ed03655c04c0", "clients": [ { "id": "9bcfee40-66a0-11ee-885d-ed03655c04c0", "connectTime": 1696855048996, "attributes": { "name": "U2Ftc3VuZ1JlbW90ZUFwcA==" }, "deviceName": "U2Ftc3VuZ1JlbW90ZUFwcA==", "isHost": false } ] } }
Can anyone help me out by getting a token from a connected socket?
I tried both port 8002 and 8001 but I am getting device info with only 8001 and with ws://
Create the token on their website and then include the token in your request. Try with this: https://developer.smartthings.com/docs/advanced/authorization-and-permissions#:~:text=To%20generate%20a%20Personal%20Access,%22Personal%20Access%20Tokens%22%20page. I don't know if you're doing it on Swift (you used the Swift tag) but would be nice if you included some extra code to see exactly what you're doing.