List all Labels

// function to delete all labels with info

function listLabelInfo() {

var sheet = SpreadsheetApp.openById(SSID).getSheetByName('Labels');

sheet.clear();

var response = Gmail.Users.Labels.list('me');

for (var i = 0; i < response.labels.length; i++) {

var label = response.labels[i];

sheet.appendRow([i, label.name, label.id, label.type]); Logger.log(JSON.stringify(label));

}

}