0

Cann't get GUID of Contacts

I try to get GUID of contacts but the result is null.

http://social.yahooapis.com/v1/user/<GU...actID>/guids

Please tell me why?

by
1 Reply
  • The GUID's of your contacts from your address book (contact list api)? Can you please provide more information on what you're trying to do (code samples / description / etc.)?

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    Twitter: jcleblanc

    QUOTE (lieumang_hva @ May 5 2009, 08:00 AM) <{POST_SNAPBACK}>
    I try to get GUID of contacts but the result is null.

    http://social.yahooapis.com/v1/user/<GU...actID>/guids

    Please tell me why?
    0
  • QUOTE (Jon @ May 5 2009, 03:51 PM) <{POST_SNAPBACK}>
    The GUID's of your contacts from your address book (contact list api)? Can you please provide more information on what you're trying to do (code samples / description / etc.)?

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    Twitter: jcleblanc


    I use yosdk. This is my code:

    $y = YahooSession::requireSession('xxxx', 'xxxx');
    $yahoo_user = $y->getSessionedUser();

    // My app has a valid session


    $arr_friend = $yahoo_user->getContacts(0,2000);

    // After i have arr result friend, i know Contact id.

    // Fetch GUID form ContactID:

    This is my function that added into Yahoo.inc in class YahooUser, after function getContacts

    function getGuid($cid) {


    $response = $this->client->get(sprintf("http://%s/v1/user/%s/contact/%s/guids",
    SOCIAL_WS_HOSTNAME,
    urlencode($this->guid),$cid));

    if(is_null($response) || $response["code"] != 200) {
    return NULL;
    }
    else return $response["responseBody"];
    }

    I use this function to fetch guid from cid of contacts.

    $yahoo_user->getGuid(cid);

    But the result is null.
    0
  • Hey lieumang_hva,

    If the contacts that you obtain have an associated guid (for instance, added under profiles) you can obtain the GUID from the object returned from getContacts. I just ran a test and the following provided the GUID of the first contact returned:

    CODE
    $contacts = $yahoo_user->getContacts(0,2);
    echo $contacts->contacts->contact[0]->fields[0]->value;


    If you have a yid, you can do a yid to guid conversion using YQL - see http://developer.yahoo.com/yql/console/?q=...D%27spullara%27

    If you don't have a yid or guid, I don't believe there's very much you can do to obtain the guid.

    Hope that helps

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    Twitter: jcleblanc
    0

Recent Posts

in Contacts