tuya / tuya-connector-nodejs

nodejs sdk
39 stars 18 forks source link

Always got sign invalid #11

Open ffadiuvat opened 2 years ago

ffadiuvat commented 2 years ago

I tried to send a api call witht his sdk, i provide correcte secret and access key. but it always return an sign invalid error. Here the example of the code

const result = await client.request({
    method: 'post',
    path: `/v1.0/iot-03/devices/${deviceID}/commands`,
    body: {
      device_id: deviceID,
      commands: [{
        code: 'switch_led',
        value: value,
      }]
    }
  });
juanrgh commented 1 year ago

I have the same problem, Tuya support was of not much help. Did you manage to find out the answer?

mjpoo commented 1 year ago

I had the same problem. It was giving me a 1106 permission deny error. I found that if I removed /iot-03 from the path it works.

sedhalsoni commented 2 months ago

I have found same error like it always return an sign invalid error.

const response = await tuya.request({ method: 'POST', path: '/v1.0/iot-03/users/login', headers: { // 'Content-Type': 'application/json', 'client_id': tuyaClientId, 'sign': signature, 'sign_method': 'HMAC-SHA256', 't': t }, body: body, });