lib/client/messages/custom-labels/index.js
function createCustomLabel (name) {
  return new Promise (async (resolve, reject) => {
    if (!name) {
      reject('name required');
    }
    let options = {
      'payload': {'name': name}
    };
    try {
      let response = await  this.callCustomLabelsApi(options);
      resolve(response);
    } catch (e) {
      reject(e);
    }
  });
}
function createCustomLabel (name) {
  return new Promise (async (resolve, reject) => {
    if (!name) {
      reject('name required');
    }
    let options = {
      'payload': {'name': name}
    };
    try {
      let response = await  this.callCustomLabelsApi(options);
      resolve(response);
    } catch (e) {
      reject(e);
    }
  });
}
function createCustomLabel ( name ) { return new Promise ( async ( resolve , reject ) => { if ( ! name ) { reject ( 'name required' ) ; } let options = { 'payload' : { 'name' : name } } ; try { let response = await this . callCustomLabelsApi ( options ) ; resolve ( response ) ; } catch ( e ) { reject ( e ) ; } } ) ; }
Creates a new custom label.
@param  {String}  name  The name of the custom label.
@return {Promise<Object>}  The API response
@memberof  Client#
@example
Client.createCustomLabel('my_custom_label')
.then(res => {
console.log(res); // {"id": "9485676932424"}
});
Creates a new custom label .