google API - Users.labels: create - Is is possible to "nest" labels?

0 views
Skip to first unread message

Alberto Alexander Rodriguez via StackOverflow

unread,
Apr 21, 2015, 12:13:52 PM4/21/15
to google-appengin...@googlegroups.com

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?



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/29777602/google-api-users-labels-create-is-is-possible-to-nest-labels
Reply all
Reply to author
Forward
0 new messages