This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed

is rest api working ?

i wanted to play with my homey, so i tried the rest api. but i only get 404 not found. your bearer key can be found  by inspecting the element when you want to choose your homey in my.athom

https://github.com/athombv/homey/issues/159

var http = require('http');
var homey;
(function (homey) {
    function speak() {
      
        var callback2 = function (response) {
            var str = '';
                 response.on('data', function (chunk) {
                str += chunk;
                   });
                      response.on('end', function () {
                console.log("end" + str);
                var cache2 = str;
                         });
                  };
             var options2 = {
            host: "192.168.10.17",
            port: 80,
            path: '/api/managers/speech-output/',
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'Authorization': "Bearer yourbearerkey",
                'Content-Length': 26
            }
        };
        
                var sendstring2 = '{ "text" : "Hello world" }';
        var req = http.request(options2, callback2);
        req.on('error', function (e) {
            console.log("problem with request: " + e.message);
         
        });
        req.write(sendstring2);
        req.end();
    }
    speak();
})(homey = exports.homey || (exports.homey = {}));

Comments

This discussion has been closed.