How to get the message id after sending a new message with gmail api ?
function sendMessage(userId, email, callback) {
var base64EncodedEmail = btoa(email);
var request = gapi.client.gmail.users.messages.send({
'userId': userId,
'message': {
'raw': base64EncodedEmail
}
});
request.execute(callback);
}
I found the solution : into the callback function we will get an arguments object which contains all the informations about the sent message such as id ,labelId ...ect :
function callback(){
var idMail=arguments[0].id;
/*Stored into the dataBase or others operations */
}