lib/api/modules/spaces.js
function (spaceIdentifier, data) {
      var path;
      if (spaceIdentifier && data) {
        path = this.constructPath(constants.SPACES, spaceIdentifier, constants.DEVICES);
        return this.Core.POST(path, data);
      } else {
        return this.rejectRequest('Bad Request: A space identifier and device data are required');
      }
    }
function (spaceIdentifier, data) {
      var path;
      if (spaceIdentifier && data) {
        path = this.constructPath(constants.SPACES, spaceIdentifier, constants.DEVICES);
        return this.Core.POST(path, data);
      } else {
        return this.rejectRequest('Bad Request: A space identifier and device data are required');
      }
    }
function ( spaceIdentifier , data ) { var path ; if ( spaceIdentifier && data ) { path = this . constructPath ( constants . SPACES , spaceIdentifier , constants . DEVICES ) ; return this . Core . POST ( path , data ) ; } else { return this . rejectRequest ( 'Bad Request: A space identifier and device data are required' ) ; } }
Create a device in a space
@param  {String|Integer} spaceIdentifier A Robin space identifier
@param  {Object}         data            A data object
@return {Function}                       A Promise
Create a device in a space