我一直遇到dropbox php api的问题,我只是想使用 getmeta 让它工作。但我不断收到以下错误??
我认为问题就在这里。
public function getToken($email, $password) {
throw new Dropbox_Exception('This API method is deprecated as of the version 1 API');
}
这是我的代码。
$consumerKey = 'oksergerg1x1r';
$consumerSecret = 'zexb0rg6h54tgzzb';
require($_SERVER['DOCUMENT_ROOT'] . '/wp/includes/Dropbox/autoload.php');
//session_start();
$oauth = new Dropbox_OAuth_Wordpress($consumerKey, $consumerSecret);
echo "<pre>";
print_r($oauth);
echo "</pre>";
// If the PHP OAuth extension is not available, you can try
// PEAR's HTTP_OAUTH instead.
// $oauth = new Dropbox_OAuth_PEAR($consumerKey, $consumerSecret);
$dropbox = new Dropbox_API($oauth);
$tokens = $dropbox->getToken('mrhandsome@example.org', 'secretpassword');
// You are recommended to save these tokens, note that you don't
// need to save the username and password, so just ask your user the
// first time and then destroy them.
echo "Tokens:\n";
print_r($tokens);
所以我说 getToken 函数已经贬值了,那么我们应该使用什么来代替?
更新
好的,抱歉,谷歌搜索了一下,我发现新版本不再支持 getTokens,即使它们出于某种原因仍在示例中。
所以我现在很困惑。
我正在尝试设置一个应用程序,以便人们可以输入他们的保管箱电子邮件和密码。然后它将从他们的帐户中提取所有元数据。
使用新代码如何授予用户访问权限?如果他们没有电子邮件和密码,我如何获得正确的令牌???
抱歉,我真的很困惑,过去两天一直在努力解决这个问题。