Q:

How to check if message is flagged as "important" using Google Mail API?

You can receive message flags such as "Read"/"Unread" or "Flagged"/"Not flagged" using Google Mail API. You can see this information in field labelIds in result of Users.messages: get function:

If label STARRED presents, it means that message was marked with asterisk.
If label UNREAD presents, it means that message is unread yet.

Question I
I can't find how to check if message was marked as "Important".
Does anyone know if there is a way to detect this flag using Google Mail API?
Question II
You can mark message with different asterisks (red, green, blue), but Google Mail API doesn't return this information in Users.messages: get function.
Can I determine what kind (what color) of asterisks has message using Google Mail API?

A:

Based on saying "message flags" I assume you're using Gmail IMAP now?  The Gmail API does expose the common Gmail labels on a message (like Starred and Unread), but not anything IMAP-specific (e.g. \Deleted, \Recent).
IMAP \Flagged maps to the Star in the web interface and "STARRED" in the API:
https://developers.google.com/gmail/api/guides/labels
The Important label (corresponding to the \Important mailbox in IMAP) should be visible in the in the API as well (system label called "IMPORTANT").
The different color stars are not currently supported by API (refer to the above labels guide for the current authoritative list of supported SYSTEM labels).

