Reputation: 815
I tried from gmail.com UI, but i didn't found any way to create nested folders under system labels. Then i tried using APIs and it's not possible from there also.
But i am not able to find any documentation where this behaviour is specified. Am i missing something or doing something wrong. I am using gmail apis to create labels. https://developers.google.com/gmail/api/v1/reference/users/labels/create
The problem is we have a customer who has nested labels under inbox. I think may be its old gmail feature and does not exists anymore. Can someone clear my understanding. Thanks in advance
Upvotes: 1
Views: 2878
Reputation: 1
I was able to accomplish this by linking my gmail account to windows 10 "mail" program. Then used the windows mail UI to create my nested folders under my inbox then when I go back to gmail using chrome ::boom:: nested under my inbox.
Upvotes: 0
Reputation: 480
It appears that USER labels cannot currently be nested under SYSTEM labels with the Gmail API. I'm not sure if they could have been at a point in the past using the Gmail API or another deprecated API. Finding information to indicate it was possible in the past may be difficult as the older "offical" APIs such as the Email Migration v2 API (and its predecessor) appear to have had there documentation taken down.
Maybe @Rubén is onto something here. Though I would assume that Google's servers in their current configuration would return some sort of error while attempting this from any client. It is probably deprecated functionality that has since been removed that made this possible. Maybe when using the old obsolete Email Migration v2 API this was possible. I unfortunately cannot recall/prove if it allowed said functionality.
I cannot find a link with information directly from Google. However, I have found the following:
ScottG_TC said: "You are creating a new Label, did you check off Nest Under and then the drop down will show you all of the user created lables. Those are the only ones you can nest under." https://productforums.google.com/forum/#!topic/gmail/DqWSicdPTSs
ScottG_TC said: "You can not nest labels in Inbox." https://productforums.google.com/forum/#!topic/inbox/78TdouDE0s4
Gmail API
Having used the .NET wrapper/version of the API I have noticed that I cannot create a nested label under the 'Inbox' SYSTEM label programmatically. Attempting to do so produces the same result as using the GUI. It creates a flat USER defined label named 'Inbox/Foo'. This appears to be the standard result of attempting to create a nested USER label under a SYSTEM label. That is, a flat USER defined label will be created independent of the intended SYSTEM label.
Gmail
Example using the Gmail UI itself.
And after creation.
As I'm sure you've already noticed in the UI using the "Nest label under:" has no option to specify any of the SYSTEM labels.
Creation of a USER defined label using the name of a SYSTEM label is also invalid.
"Duplicate Question"
I don't believe this is a duplicate question, the Gmail API has the concept of USER and SYSTEM labels. The provided duplicate question/answer only goes over the idea of creating a nested label under a USER defined label. It does not state whether or not a nested label can be created under a SYSTEM label such as 'Inbox'
Difference between USER and SYSTEM labels: https://developers.google.com/gmail/api/guides/labels
The difference can also be observed by going to https://mail.google.com/mail/u/0/#settings/labels SYSTEM labels have there own section.
Upvotes: 1