2014-10-28 23 views
0

我有一個Gmail服務通過PHP API運行:Gmail的API - Users.labels得到一個日期範圍指定

$client = new Google_Client(); 
$client->setClientId('{{CLIENT_ID}}.apps.googleusercontent.com'); 
$client->setRedirectUri('{{REDIRECT_URL}}'); 
$client->setClientSecret('{{CLIENT_SECRET}'); 
$client->setScopes(array('https://www.googleapis.com/auth/gmail.modify')); 
$client->setAccessToken($credentials); 

我再取(得到 - https://developers.google.com/gmail/api/v1/reference/users/labels/get)的所有標籤匹配某ID :

$service = new Google_Service_Gmail($client); 
$labels = $service->users_labels->get("{{EMAIL}}", $gmail_label_id); 

這是完美的。我怎樣才能指定一個參數,只有得到線程之間的某個日期範圍?綜觀API瀏覽我只看到指定的能力:

  • 用戶id
  • ID
  • 領域什麼,我試圖做

其中沒有適合。

我已經看過了Google_Service_Gmail_UsersLabels_Resource類,特別是get方法:

public function get($userId, $id, $optParams = array()) 
{ 
    $params = array('userId' => $userId, 'id' => $id); 
    $params = array_merge($params, $optParams); 
    return $this->call('get', array($params), "Google_Service_Gmail_Label"); 
} 

我看到,你可以在$optParams變量分析,可能這也許是關鍵?

回答

1

如果我正確理解你的問題,你想獲得某個日期範圍之間的線程?我認爲你必須使用'list'方法和可選參數'q'。爲了獲得單獨的線程,你可以調用'get'方法。

相關問題