Php Gmail API返回聊天与;“发送”;标签
使用Gmail API调用 返回标签已发送的聊天记录 我使用了以下代码来获取消息内容Php Gmail API返回聊天与;“发送”;标签,php,gmail,gmail-api,Php,Gmail,Gmail Api,使用Gmail API调用 返回标签已发送的聊天记录 我使用了以下代码来获取消息内容 $url = "https://www.googleapis.com/gmail/v1/users/$useremail/messages/$messageid?format=full"; $response = $gmailInstance->performHttpRequest($gmailAuthObj, $useremail, $url); $responseBody = json_decode
$url = "https://www.googleapis.com/gmail/v1/users/$useremail/messages/$messageid?format=full";
$response = $gmailInstance->performHttpRequest($gmailAuthObj, $useremail, $url);
$responseBody = json_decode($response->getResponseBody(), TRUE);
对于上面的API调用,我得到了以下响应
{
"id": msgid,
"threadId": threadid,
"labelIds": [
"CHAT",
"SENT"
],
"snippet": "sometext",
"historyId": 7 digit numeric,
"internalDate": "1371160444361",
"payload": {
"partId": "",
"mimeType": "text/html",
"filename": "",
"headers": [{
"name": "From",
"value": "Test User \u003ctuser@tdom.com\u003e"
}],
"body": {
"size": 20,
"data": somerandomstring
}
},
"sizeEstimate": 100
}
有人知道为什么API响应返回带有已发送标签的聊天消息吗?有没有办法避免这种情况(从聊天响应中发送标签)?不太清楚您询问的是什么:)这是正确的响应数据。您想要响应的
text/plain
或text/html
部分还是类似的内容?@Tholle我想知道为什么API响应返回聊天信息的标签。有没有办法避免这种情况(通过聊天响应发送标签)?