I want to add some labels to user accounts using google API. This is the example code I have:
function createLabel($service, $user, $new_label_name) {
$label = new Google_Service_Gmail_Label();
$label->setName($new_label_name);
try {
$label = $service->users_labels->create($user, $label);
print 'Label with ID: ' . $label->getId() . ' created.';
} catch (Exception $e) {
print 'An error occurred: ' . $e->getMessage();
}
return $label;
}
What I want to know is: how do I create AND NEST the labels? is it even possible using the Google API?