1

Looking at the list of properties here: https://developers.google.com/gmail/api/v1/reference/users/messages You can see all of the properties. However, currently for me, only Id and Thread ID is working. Is it user error or something wrong with the API?

 function listMessages() { gapi.client.gmail.users.messages.list({ 'maxResults': 1000, 'userId': 'me', 'format': 'full', }).then(function(response) { appendPre('Files:'); var messages = response.result.messages; if (messages && messages.length > 0) { for (var i = 0; i < messages.length; i++) { var message = messages[i]; appendPre(message.threadId + ' (' + message.snippet + ')'); } } else { appendPre('No files found.'); } }); } 

Any help with getting the name of the email printed would be appreciated. I can only print out message.ThreadID and message.ID, with everything else (such as message.snippet) printed out as undefined.

This is what happens when the ID and snippet are printed out: The ID prints out but nothing else, I've tried this with a few other varables as well, all of them but ID and threadID prints out as undefined. .

How can I fix this issue?

1 Answer 1

1

You may want to try adding format=RAW in your Users.messages: get request.

As also mentioned in Users.messages,

The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.

Sign up to request clarification or add additional context in comments.

1 Comment

Ok thanks! Also, is there a way to have two client_ids in the same script? If so, how?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.