简体   繁体   中英

List-things api using http in AWS-IoT?

I am new to this AWS IoT, i was able to get/update thing shadows using http api ( https://endpoint/things/thingName/shadow ), provided by AWS IoT, but i want the list of things created under my account. Documentation provides the way of getting list-things using AWS CLI, how can i achieve the same using rest-api ?

I found a solution for this, first i build up custom sdk for AWS IoT, using this link you can build, i selected AWS.IoT and AWS.IoTData and build a sdk. After importing that sdk to your solution, you can query like this :

var iot = new AWS.Iot({
            "accessKeyId":"accessKeyId",
            "secretAccessKey":"secretAccessKey",
            "region":"region"
            });

            iot.listThings({}, function(err, data) {
            if (err) console.log(err, err.stack); // an error occurred
              else     console.log(data);           // successful response
            });

You can find the API documentation here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM