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
變量分析,可能這也許是關鍵?