tuya / tuya-connector-nodejs

nodejs sdk
39 stars 18 forks source link

"Get the device list" api not working #4

Closed jigneshk5 closed 3 years ago

jigneshk5 commented 3 years ago

Here is my code snippet to get all list of devices:

var device = await tuya.request({
        method: 'GET',
        path: '/v1.0/devices',
        body: {
            page_size:10,
            page_no:1
        }
    })

But its giving the following response: { code: 1100, msg: 'param is empty', success: false, t: 1629498362573 } I have also tried this api explorer at https://iot.tuya.com/ but getting the same response. Please let me know what other parameter need to be passed in this api for getting the correct response.

Erchoc commented 3 years ago

GET method please use params field, body field is uesd by POST method.