我有一个通过 PHP API 运行的 Gmail 服务:
$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);
然后我获取 (get - 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 Explorer,我只看到指定的功能:
我查看了
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
变量,这可能是关键吗?