lib/client/messages/custom-labels/index.js
function addPsidtoCustomLabel (psid, label_id) {
  return new Promise (async (resolve, reject) => {
    if (!psid || !label_id) {
      reject('PSID and label_id required');
      return;
    }
    let options = {
      'path': `/${label_id}/label`,
      'payload': {'user': psid}
    };
    try {
      let response = await  this.callCustomLabelsApi(options);
      resolve(response);
    } catch (e) {
      reject(e);
    }
  });
}
function addPsidtoCustomLabel (psid, label_id) {
  return new Promise (async (resolve, reject) => {
    if (!psid || !label_id) {
      reject('PSID and label_id required');
      return;
    }
    let options = {
      'path': `/${label_id}/label`,
      'payload': {'user': psid}
    };
    try {
      let response = await  this.callCustomLabelsApi(options);
      resolve(response);
    } catch (e) {
      reject(e);
    }
  });
}
function addPsidtoCustomLabel ( psid , label_id ) { return new Promise ( async ( resolve , reject ) => { if ( ! psid || ! label_id ) { reject ( 'PSID and label_id required' ) ; return ; } let options = { 'path' : ` ${ label_id } ` , 'payload' : { 'user' : psid } } ; try { let response = await this . callCustomLabelsApi ( options ) ; resolve ( response ) ; } catch ( e ) { reject ( e ) ; } } ) ; }
Associates a user's PSID to a custom label.
@param  {Integer}  psid  PSID of the user to associate with the custom label.
@param  {Integer}  label_id  The ID of a custom label. Created with {@link #createcustomlabel|createCustomLabel()}.
@return {Promise<Object>}  The API response
@memberof  Client#
@example
let psid = 49670354734069743,
custom_label_id = 0957209720496743;
Client.addPsidtoCustomLabel(psid, custom_label_id)
.then(res => {
console.log(res); // {"success": true}
});
Associates a user s PSID to a custom label .