I have donwloaded new Gmail API source code from Google PHP client library.
I inititalized the service using:
set_include_path(\"./google-api-php-cli
I'd start here: https://developers.google.com/gmail/api/v1/reference/users/messages/list and https://developers.google.com/gmail/api/v1/reference/users/messages/get
note that when you get a list of messages only the IDs of those messages are returned then you use the ID with the get method to actually get the message content: