{"action":"created","issue":{"url":"https://api.github.com/repos/flowthings/angular-client/issues/3","repository_url":"https://api.github.com/repos/flowthings/angular-client","labels_url":"https://api.github.com/repos/flowthings/angular-client/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/flowthings/angular-client/issues/3/comments","events_url":"https://api.github.com/repos/flowthings/angular-client/issues/3/events","html_url":"https://github.com/flowthings/angular-client/issues/3","id":134345354,"number":3,"title":"POST https://ws.flowthings.io/session 400 (Bad Request)","user":{"login":"citynorman","id":4677339,"avatar_url":"https://avatars.githubusercontent.com/u/4677339?v=3","gravatar_id":"","url":"https://api.github.com/users/citynorman","html_url":"https://github.com/citynorman","followers_url":"https://api.github.com/users/citynorman/followers","following_url":"https://api.github.com/users/citynorman/following{/other_user}","gists_url":"https://api.github.com/users/citynorman/gists{/gist_id}","starred_url":"https://api.github.com/users/citynorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citynorman/subscriptions","organizations_url":"https://api.github.com/users/citynorman/orgs","repos_url":"https://api.github.com/users/citynorman/repos","events_url":"https://api.github.com/users/citynorman/events{/privacy}","received_events_url":"https://api.github.com/users/citynorman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-17T17:24:06Z","updated_at":"2016-02-17T18:19:29Z","closed_at":null,"body":"Hi flowthings team,\r\n\r\nI'm using test/client.html and getting the below response, any idea what's happening? Using an unmodified version of the html with the .min.js files. My credentials are correct because I used the same ones to push some data.\r\n\r\nPOST https://ws.flowthings.io/session 400 (Bad Request)(anonymous function) @ angular.min.js:99r @ angular.min.js:95g @ angular.min.js:93(anonymous function) @ angular.min.js:126m.$eval @ angular.min.js:141m.$digest @ angular.min.js:138m.$apply @ angular.min.js:141(anonymous function) @ angular.min.js:265Rf @ angular.min.js:36Qf.d @ angular.min.js:36\r\n\r\nUsing angular 1.5.0 https://opensource.keycdn.com/angularjs/1.5.0/angular.min.js"},"comment":{"url":"https://api.github.com/repos/flowthings/angular-client/issues/comments/185333455","html_url":"https://github.com/flowthings/angular-client/issues/3#issuecomment-185333455","issue_url":"https://api.github.com/repos/flowthings/angular-client/issues/3","id":185333455,"user":{"login":"gmmeyer","id":3253673,"avatar_url":"https://avatars.githubusercontent.com/u/3253673?v=3","gravatar_id":"","url":"https://api.github.com/users/gmmeyer","html_url":"https://github.com/gmmeyer","followers_url":"https://api.github.com/users/gmmeyer/followers","following_url":"https://api.github.com/users/gmmeyer/following{/other_user}","gists_url":"https://api.github.com/users/gmmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/gmmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmmeyer/subscriptions","organizations_url":"https://api.github.com/users/gmmeyer/orgs","repos_url":"https://api.github.com/users/gmmeyer/repos","events_url":"https://api.github.com/users/gmmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/gmmeyer/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T18:19:29Z","updated_at":"2016-02-17T18:19:29Z","body":"If you simply change it to this, it will work:\r\n\r\n```html\r\n<!doctype html>\r\n<script src=\"../node_modules/flowthings-browser/dist/flowthings-browser.js\"></script>\r\n<script src=\"../node_modules/angular/angular.js\"></script>\r\n<script src=\"../flowthings-angular.js\"></script>\r\n<script>\r\n var CREDS;\r\n angular.module('app', ['flowthings'])\r\n        .config(function(flowthingsProvider) {\r\n          CREDS = flowthingsProvider.options = {};\r\n          flowthingsProvider.options.account = '<account_name>';\r\n          flowthingsProvider.options.token = '<token>';\r\n        })\r\n        .controller('MainCtrl', function($scope, flowthings) {\r\n          var count = 1;\r\n          $scope.drops = [];\r\n          $scope.model = CREDS;\r\n          $scope.status = 0;\r\n          $scope.connect = function() {\r\n            $scope.status = 1;\r\n            flowthings.ws.connect().then(\r\n              function() { $scope.status = 3 },\r\n              function() { $scope.status = 2 }\r\n            );\r\n            flowthings.ws.subscribe($scope.model.path, function(drop) {\r\n              $scope.drops.push(drop);\r\n            }).result.then(\r\n              function() { $scope.status = 5 },\r\n              function() { $scope.status = 4 }\r\n            );\r\n          };\r\n          $scope.publish = function() {\r\n            flowthings.drop.create({\r\n              path: $scope.model.path,\r\n              elems: {\r\n                test: count++\r\n              }\r\n            });\r\n          };\r\n        });\r\n</script>\r\n<div ng-app=\"app\" ng-controller=\"MainCtrl\">\r\n  <table>\r\n    <tr>\r\n      <th>Account</th>\r\n      <td><input type=\"text\" ng-model=\"model.account\"></td>\r\n    </tr>\r\n    <tr>\r\n      <th>Token</th>\r\n      <td><input type=\"text\" ng-model=\"model.token\"></td>\r\n    </tr>\r\n    <tr>\r\n      <th>Path</th>\r\n      <td><input type=\"text\" ng-model=\"model.path\"></td>\r\n    </tr>\r\n    <tr>\r\n      <th></th>\r\n      <td>\r\n        <button ng-click=\"connect()\" ng-disabled=\"status\">Connect</button>\r\n        <span ng-if=\"status === 1\">Connecting</span>\r\n        <span ng-if=\"status === 2\">Connection error</span>\r\n        <span ng-if=\"status === 3\">Connected</span>\r\n        <span ng-if=\"status === 4\">Subscription error</span>\r\n        <span ng-if=\"status === 5\">Subscribed</span>\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <th></th>\r\n      <td><button ng-click=\"publish()\" ng-disabled=\"status < 5\">Publish</button></td>\r\n    </tr>\r\n  </table>\r\n  <pre ng-repeat=\"drop in drops\">{{ drop }}</pre>\r\n</div>\r\n```"}}