lib/api/content/folders.js
function (name, parent_id, done, config) {
        if (!_.isString(name) || !_.isNumber(parseInt(parent_id, 10))) {
          return done(new Error('Invalid params. Required - name: string, parent_id: number'));
        }
        this._request(['folders'], 'POST', done, null, {
          name: name,
          parent: {
            id: parent_id.toString()
          }
        }, null, null, null, config);
      }
function (name, parent_id, done, config) {
        if (!_.isString(name) || !_.isNumber(parseInt(parent_id, 10))) {
          return done(new Error('Invalid params. Required - name: string, parent_id: number'));
        }
        this._request(['folders'], 'POST', done, null, {
          name: name,
          parent: {
            id: parent_id.toString()
          }
        }, null, null, null, config);
      }
function ( name , parent_id , done , config ) { if ( ! _ . isString ( name ) || ! _ . isNumber ( parseInt ( parent_id , 10 ) ) ) { return done ( new Error ( 'Invalid params. Required - name: string, parent_id: number' ) ) ; } this . _request ( [ 'folders' ] , 'POST' , done , null , { name : name , parent : { id : parent_id . toString ( ) } } , null , null , null , config ) ; }
Used to create a new empty folder. The new folder will be created inside of the
specified parent folder.
@summary Create a New Folder.
@see {@link https://developers.box.com/docs/#folders-create-a-new-folder}
@param {string} name - The folder's name.
@param {number} parent_id - The parent folder's ID.
@param {requestCallback} done - The callback to invoke (with possible errors) when the request returns.
@param {?RequestConfig} [config] - Configure the request behaviour.
Used to create a new empty folder . The new folder will be created inside of the specified parent folder .