2014-07-01 60 views
0

我已經包含雅虎API來閱讀用戶的雅虎聯繫人。但是它不會提取任何數據。 請看看我的代碼:無法從雅虎API獲取聯繫人

session_start(); 
include_once 'config.php'; //This file contains consumer key & all data 
require_once ('Yahoo.inc'); //This is a standard Yahoo file, just copied it 
$session = YahooSession::requireSession($consumer_key,$consumer_secret,$app_id); 
if (is_object($session)) 
{ 
    $user = $session->getSessionedUser(); //This is NOT NULL 
    $profile = $user->getProfile(); //This is NULL 
    $name = $profile->givenNme; 
    $guid = $profile->guid; 
    $contacts=$user->getContacts()->contacts; //This is NULL 
    if($contacts==NULL){ 
     echo "No contacts"; 
    } 
} 

不知何故getProfile() & getContacts()是不工作的,任何人都可以幫助我們發現了錯誤?

回答

相關問題