获取与yahoo api的联系人列表

时间:2014-08-04 17:33:48

标签: oauth yahoo-api

我想使用yahoo api获取用户yahoo联系并在页面中显示我的代码:

// if a session is initialized, fetch the user's profile information
    if($session) {
    // Get the currently sessioned user.
      $user = $session->getSessionedUser();
    //var_dump($user);

    // Load the profile for the current user.
    $profile = $user->getProfile();
    $profile_contacts=XmltoArray($user->getContactSync());
    var_dump( $profile_contacts);
    $contacts=array();
    foreach($profile_contacts['contactsync']['contacts'] as $key=>$profileContact){
      foreach($profileContact['fields'] as $contact){
        $contacts[$key][$contact['type']]=$contact['value'];
       }
     }
  //echo "<pre/>";
  //print_r($contacts);exit; 
  }

但是$ contact是emty,我没有想法帮助

1 个答案:

答案 0 :(得分:1)

您可以通过这种方式看到响应  $ response = $ user-&gt; getContacts(); 后续代码var_dump($响应); 并找到你的问题

相关问题