Gmail REST API를 사용하여 메일을 읽음으로 표시하려고합니다.Gmail REST API - 메일을 읽음으로 표시
$('#markGmailRead').click(function(){
var request = $.ajax({
type: 'POST',
dataType: 'json',
headers: { "Authorization": "Bearer <<ACCESS KEY>>",
"Content-Type": "application/json"},
url: 'https://www.googleapis.com/gmail/v1/users/me/messages/<<MESSAGEID>>/modify',
data: {"addLabelIds": ["UNREAD"]}
})
request.done(function(data){
// when the Deferred is resolved.
console.log(data);
})
request.fail(function(){
// when the Deferred is rejected.
console.log('fail');
})
})
이 다음 JSON 결과가 반환 :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "parseError",
"message": "Parse Error"
}
],
"code": 400,
"message": "Parse Error"
}
}
은 다른 사람이 이것을 경험 했습니까? 나는 이것이 무엇을 일으킬 지 모른다고 생각합니다.
왜 제목이 말하고 있는가 '마크 메시지 근무 변경 및 데이터' "addLabelIds"를 포함 : [ "UNDREAD"]'? –