4
votes

I have been using the "Get Label" API to get the details of a particular Label.

It was all working until the last couple of days.

What I now observe is that the "Total Messages" Count is always 0. "UnRead Messages" Count show up properly.

I have used it in my application and also tried it from https://developers.google.com/gmail/api/v1/reference/users/labels/get - "Try It Now" and the result is the same --- 0 Total Messages

1
Does it do that for other labels for you or just that one? Specifically other user labels and other system labels? Is it just messagesTotal? (are threadsUnread, threadsTotal and messagesUnread correct?)Eric D
@EricDeFriez Only for a particular label, MessagesTotal and threadsTotal show as 0. The other fields are populated correctly.ND003
Hmm, that's odd. What happens when you view that label in the Gmail web interface? (Does it correctly show the message count on the left label bar?)Eric D
On the left Label Bar it shows only Unread Message Count, which is returned correct anyways. I have also created a new Label now and it shows the Messages correctly for this new Label. But the older one still fails.ND003
I am facing the same issue - threads count appears correctly in gmail view, its still wrong through API, label was created through IMAP Api - there is a bug posted here: code.google.com/a/google.com/p/apps-api-issues/issues/… as well, but no real activity there.Sushil

1 Answers

0
votes

As noted in the comments to the question, there's an apparent bug in the API as reported here.

FWIW I'm running into the same issue.

In my case I have three accounts, all created programmatically by the same code, all containing messages inserted programmatically by the same code. The get label API repeatably reports the correct number of messages for one account while erroneously reporting zero messages for the other two accounts. Viewing the account in the web interface shows all the messages in all the accounts as expected.