Welcome Developers!

in

Welcome!

in

Failed to obtain friends' data

Last post 10-07-2009 10:39 AM by krunal. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-07-2009 6:48 AM

    Failed to obtain friends' data

    Hello,

    I'm developing a web application that needs to import birthdays into a database from various social networks (it's already working with Facebook and Hyves).
    Now, I'm trying to add support for MySpace, and I ran into a few issues with the Person APIs:

    I'm trying to use OpenSocial 0.9 REST APIs, since v 0.8 doesn't allow to get friends' data.
    If I request http://opensocial.myspace.com/roa/09/people/@me/@friends , though, no matter what fields I ask (birthdate, @all, etc): I always get a basic response.
    This does happen also when I try to request my own data: http://opensocial.myspace.com/roa/09/people/@me/@self : I just get basic data plus pictures.

    Additionally, when I call directly http://opensocial.myspace.com/roa/09/people/503007995/@self (503007995 is a test user I created), I still get only basic data, even if fields is @all.
    Using OpenSocial 0.8 here is even worse: the url http://api.myspace.com/v2/people/503007995/@self returns this error: "oauth_problem=permission_denied"

    How can I obtain a list of all my friends' birthdays?
    Am I doing something wrong?
  • 10-07-2009 10:39 AM In reply to

    Re: Failed to obtain friends' data

     Hi Alessandro,

    First of all, It's MySpace terms of violation to import and store any user data into your database. Please review Terms of Use (http://wiki.developer.myspace.com/index.php?title=Developer_Addendum_to_MySpace.com_Terms_of_Use_Agreement), specially section 10.

    To answer your questions on how to fetch specific data using these APIs, see my answers below -

    To get all the data about yourself, make a call to http://opensocial.myspace.com/roa/09/people/503007995/@self?fields=@all. Please note this call will return the data based on what permission you have given to the requesting app. In order to get all the user profile data, go to App Settings page and issue following 2 permissions 

    1. View my personal info & details

    2. View my profile interests & companies

    For your specific need to fetch user birthday,  following 2 permissions required -

    1.  "View my personal info & details" on app settings page

    2.  "Show my birthday to my friends" checked under My Account -> Privacy -> General Privacy -> Birthday

    Please check these two settings for yourself and make a call. You should get your birthday.

    To answer your another question, currently a call to get friends data only returns basic info about the friends. In order to get more data about each friend, you have to loop through all friends and make a call to http://opensocial.myspace.com/roa/09/people/<friendId>/@self?fields=birthday. You can use the same authorization token you have used to make a call to get all friends.

    Please note, as mentioned before, app needs special permission in order to get user's birthday so you will only get the birthday of the friends who have the app install and given the special permission to that app. You can use hasApp filter on @friends call to remove friends from the result set who don't have app install. On the top of that, friend also needs to be showing the birthday publicly.

    You can't get friends' birthday without these two special settings.

    I hope this will help.

     

Page 1 of 1 (2 items)