2
votes

So when mail is archived in gmail, the message can be left without any labels attached.

In this case, the message is still accessible in the "All Mail" view.

I am using the gmail API, and I would like to represent All Mail as a label.

Is it possible to fetch the All Mail label via the API? I'm looking at the documentation here and I'm not seeing anything.

Also, in case it helps, I am using the google php client library to interact with this API.

1
Once you archive the message even though it goes to "all mail", you cannot retrieve it giving this as label name in the query of messages.list. You can give -in:inbox from:[email protected] in messages.list, retrieve this particular archived email. Hope this explains your question.SGC

1 Answers

4
votes

You could have a All Mail-label in your application, and under the hood simply call User.messages: list with no labelIds given. That way you would get all the messages, disregarding labels completely.