Gmail api get labels avoid capital letters

Viewed 52

I'm currently using Gmail api and getting gmail api labels return capitalized letters.

Like Inbox is returned as INBOX

    id = INBOX;
    name = INBOX;
    type = system;

Could anyone please share what query to pass to get correct label names?

1 Answers

In the API, system labels (e.g. INBOX, SPAM, etc.) are capitalized, there's just no way to return them "correct" (as in the UI).

If you want to retrieve the label with only the first letter capitalized, you'll have to modify the label string after it is returned by the API.

Reference:

Related