javascript - Lightify-Rest API with JS - CORS Error -
i'd use osram-lightify rest-api (https://eu.lightify-api.org/), everytime post initial token error (invalid credentials) have used these credentials in node js example. guess related fact api doesn't allow cross origin request, have found service works.
my code (without cors related, yes have inserted real credentials):
$.post("https://eu.lightify-api.org/lightify/services/session", {"username" : "username", "password" : "password", "serialnumber" : "sn"}, function(data,error){ console.log(data); console.warn(error); });
Comments
Post a Comment