Yes James. Thank you very much!
Search found 7 matches
- 2023年 Dec 18日 10:29
- Forum: Cloud/SaaS Development
- Topic: Fetch with POST gives 'commands param is null'
- Replies: 4
- Views: 3545
- 2023年 Dec 17日 10:13
- Forum: Cloud/SaaS Development
- Topic: Fetch with POST gives 'commands param is null'
- Replies: 4
- Views: 3545
Re: Fetch with POST gives 'commands param is null'
I figured it out. A couple of things I was not doing... The body.... { "commands": [ { "code": "switch_led", "value": true } ] } needs to be converted to JSON.... {"commands":[{"code":"switch_led","value":true}]} and the...
- 2023年 Dec 17日 06:29
- Forum: Cloud/SaaS Development
- Topic: Fetch with POST gives 'commands param is null'
- Replies: 4
- Views: 3545
Re: Fetch with POST gives 'commands param is null'
I just tried it a different way and now I get 'sign invalid' var method2 = "POST"; var timestamp2 = Date.now().toString(); var signUrl2 = '/v1.0/devices/xxxxxxxxxx/commands'; var contentHash2 = CryptoJS.SHA256(signStr2, secretKey); var stringToSign2 = [method2, contentHash2, '', signUrl2]....
- 2023年 Dec 17日 06:18
- Forum: Cloud/SaaS Development
- Topic: Fetch with POST gives 'commands param is null'
- Replies: 4
- Views: 3545
Fetch with POST gives 'commands param is null'
I think this might just be syntax related. I have no problem getting a token and then getting a device response with any GET command. I am trying a fetch with POST to send a command to a device and I am getting " commands param is null " Hope this is something simple that someone may be ab...
- 2023年 Dec 16日 13:04
- Forum: Cloud/SaaS Development
- Topic: Cannot get sign authorized in browser with vanilla JS
- Replies: 3
- Views: 3817
Re: Cannot get sign authorized in browser with vanilla JS
hi, after checking your script, I found that the contentHash processing is incorrect. It should be SHA256, not HmacSHA256. Please check: https://developer.tuya.com/en/docs/iot/new-singnature?id=Kbw0q34cs2e5g#title-4 -Content-SHA256 Wow! What an amazing eye! Thank you so much @panda-cat. That works ...
- 2023年 Dec 16日 12:20
- Forum: Cloud/SaaS Development
- Topic: Cannot get sign authorized in browser with vanilla JS
- Replies: 3
- Views: 3817
- 2023年 Dec 15日 09:49
- Forum: Cloud/SaaS Development
- Topic: Cannot get sign authorized in browser with vanilla JS
- Replies: 3
- Views: 3817
Cannot get sign authorized in browser with vanilla JS
I am working on this for my private home network so security is not really an issue. I'm trying to get sign authorized through a browser, using an HTML file with vanilla JavaScript. I thought this was all I need but I keep getting "sign invalid" and I can't figure out why.... I keep gettin...