MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

PHP Client Library

Last post 11-05-2009 2:18 AM by sandy. 133 replies.
Page 3 of 9 (134 items) < Previous 1 2 3 4 5 Next > ... Last »
Sort Posts: Previous Next
  • 02-21-2008 10:47 PM In reply to

    Re: PHP Client Library

    Thanks man, it is really a great work.
    I upload the two php file to my server and tested some functions such as

    $s->details($myId);
    $s->friends($myId);
    $s->profile($myId);
    $s->get_calls());

    They works pretty well. except that  the currentUser seems doesn't return the current user as its name indicate. I am now using the function JS provided to get the userId and pass it to my php page.

    How can I get the current user id using this library? Thanks in advance.

  • 02-22-2008 11:37 AM In reply to

    Re: PHP Client Library

    I just wanted to mention that the user ID is under the API tool in the top right corner(for people who are looking for it). Thanks.

  • 02-22-2008 12:02 PM In reply to

    Re: PHP Client Library

    I am getting the following error when I try to use the libraries:

    string(136) "401User has not installed the current application."

     Does anyone know what I am supposed to do? Thank you!

  • 02-22-2008 1:50 PM In reply to

    Re: PHP Client Library

    how are

    Buzz:

    oreowookie:

    Fatal error: Uncaught exception 'Exception' with message '401 ' in /Users/roger/Sites/mysite/Space.php:185 Stack trace: #0 /Users/roger/Sites/mysite/Space.php(143): Space->_do_request('currentuser', Array) #1 /Users/roger/Sites/mysite/Space.php(50): Space->do_request('currentuser') #2 /Users/roger/Sites/mysite/index.php(6): Space->currentUser() #3 {main} thrown in /Users/roger/Sites/mysite/Space.php on line 185

     

    THat is all I seem to be able to get.. currentUser() being the attempted method this time.

    Let me note.. that I can do profile(profileIdOfAFriend) and it works.

     

    currentUser() just doesn't seem to work :)
     

     

    I also receive a 401 but I say the fault is not the libary, since it works great with some user_ids, but not other (with the same code). See my particular problem here... discuss if you'd like..

    http://developer.myspace.com/Community/forums/t/209.aspx 

    how are you able to get these user_ids?  Where are these user_ids listed?

  • 02-22-2008 1:58 PM In reply to

    Re: PHP Client Library

    I am trying to cerate a web application which will ask the user for his user name and password and then pull information from myspace and show him his profile. I was wondering if this is possible with these libraries. One of my concerns is how my application will know what the user_id of the user is?  Thank you!

  • 02-22-2008 2:30 PM In reply to

    Re: PHP Client Library

    When I try to use currentUSer() I get the following error message:

    string(158) "401Application does not have the required permissions to make this call."

    Any ideas? Thanks!

    Filed under:
  • 02-22-2008 4:00 PM In reply to

    Re: PHP Client Library

    *Editted to reflect changes in App Details page :: Application Domain changed to Security Key* 

    First, to use the library -- in fact, to make use of the RESTful API at all -- you'll have to create a MySpace App through which your server can access MySpace data.

    Once you've created an App, the App details screen will give you two pieces of information: Application URI (a URL which points to your App) and a Security Key (a long string of letters and/or numbers). These are your Consumer Key and Consumer Secret, respectively. You'll have to set the variables '$key' and '$secret' in your PHP code to these values.

    The last thing you'll need to do is install the App on the profile you want to get information about: for example, your own. In other words, the UserID you use must be one that has the App installed on it's profile. This is how a User grants permission to your App (and through it, your server) to access their personal information. Without this you'll recieve the "401: Application does not have required permissions to make this call." error.

    Now, as far as asking a person for their username and password -- you can't. Well, you can, and you might even get away with posting them to MySpace to log them in, but that won't help you get their UserID, and most people aren't going to comfortably hand over their password to a third-party site anyway. There's also no way to poll MySpace for UserIds (except those of friends of a UserId you already have, but that doesn't help you either) using this or any RESTful API library. Privacy is a of paramount concern to MySpace and it's users, as much as that might hinder developers.

    To collect that information, you'll have to find another way. There's a few suggestions in some other forums, or you could ask for more. I suggest you don't do it here, though, as this thread is specifically about the PHP Client Library.

  • 02-22-2008 11:44 PM In reply to

    • yair
    • Not Ranked
    • Joined on 02-10-2008
    • Posts 4

    more questions

    I have some questions:

    I have a facebok application which I want to transfer to myspace.

     

    I dont see the "Application Domain " but I see instead a "security key" with a long string.

    is that what I should put in the $secret?

     

    Now where can I host my PHP files? is there a free company like joynet in facebook? and where should I put the host domain?

     Is it in the "Install callback URL"?

    Should I write there the domain of my hosting?

    thanks.

     

     

    Filed under:
  • 02-23-2008 12:52 PM In reply to

    Re: PHP Client Library

    Hey, thanks for making this library available.

    As a former Facebook Platform developer, I don't fully understand how this library ties into the MySpace OpenSocial platform. I have the files hosted on my server, and inputting the correct data and loading the URL that I have it hosted at returns valid data (my information, with $s->profile(myid).)

    I'm just wondering how to make this integrate with MySpace's Application Builder form. IFrame? Ajax?

    Thanks. 

  • 02-23-2008 7:26 PM In reply to

    Re: PHP Client Library

     This library is indeed a great work and saves a lot of time..inspite of the still-under development-phase of the platform. Thanks Jerome.

    But I do see some issues with  the currentUser function. I did all that Jeremy mentioned in his last post, but I am getting this error

    <error xmlns="api-v1.myspace.com"><statuscode>401</statuscode><message>Application does not have the required permissions to make this call.</message></error>

     But other calls like user(userid) etc are going fine.. I think that currentUser API is still not on official documention 

    http://developer.myspace.com/community/RestfulAPIs/resources.aspx

     

     Any thoughts from any one on this? Is it required to get the current-user only by some other calls like the one posted in this link (opensocial calls) 

     http://developer.myspace.com/Community/forums/t/426.aspx

  • 02-23-2008 10:01 PM In reply to

    Re: PHP Client Library

    I'm not sure why the currentUser function is even present in the library - I don't think I've ever seen it mentioned anywhere as ever being a part of the RESTful resource collection, even in theory. The fact is, these resource requests are coming from your server, and aren't tied to a specific user, only to an application, so there's no way to ask MySpace who the current user is. Mike gave a brilliant explanation in the thread that inspired the one linked above.

    My point is, don't expect CurrentUser to ever work. If you're running a RESTful-based App through MySpace surfaces, you'll have to rely on OpenSocial and javascript to pass the required Id (which shouldn't be a problem, since it's included in the header of every signed HTTP request a MySpace surface would make to an external server). If you're attempting to build an application that brings in MySpace data outside the context of MySpace itself (such as an independant mashup gadget), you'll need to think of another way to get the Id.

  • 02-25-2008 1:48 AM In reply to

    Re: PHP Client Library

    I am using the MySpace API with opensocial to get the current Userid.

     I am passing OpenSocial Authentication params to the Rest API and Rest API is getting the current User_id, key & secret values from the passed data and then returning the proper application URL to be processed in IFRAME.

    <iframe id="appiframe" name="msiframe" src="" height="1000" width="790" frameborder="0"></iframe>

    <script type="text/javascript">

    var serverURL='http://myserver.com/authenticate';

    function init() {
        var params = {};
        params[opensocial.ContentRequestParameters.METHOD] = opensocial.ContentRequestParameters.MethodType.GET;
        params[opensocial.ContentRequestParameters.CONTENT_TYPE] = opensocial.ContentRequestParameters.ContentType.HTML;
        params[opensocial.ContentRequestParameters.AUTHENTICATION] = opensocial.ContentRequestParameters.AuthenticationType.SIGNED;
        opensocial.Container.get().makeRequest(serverURL, loadiframe, params);
    }

    function loadiframe(targetURL) { document.getElementById('appiframe').src = targetURL; }

    init();
    </script> 

     

    I have written a small application getting the list of friends.It is working fine for me but when my friends installed the application and go to the application they are getting exceptions "User has not installed the application". 

     

    Can any one help me on this ?

     

     

  • 02-25-2008 2:50 AM In reply to

    Re: PHP Client Library

    Does any one have idea when MySpace is launching thier official REST API.

  • 02-25-2008 3:58 PM In reply to

    Re: PHP Client Library

    The library provided works great, but I am not sure in what ways we can use it since it requires userIDs to make the function calls and there is no way of obtaining these userIDs. Any suggestions? Thank you!

    Filed under:
  • 02-27-2008 9:51 PM In reply to

    • sham
    • Not Ranked
    • Joined on 02-27-2008
    • Posts 3

    Re: PHP Client Library

    Hello

    I have any query help me out if you know anything about it

     

    I  want to post  & publish blog on my account of myspace when i post blog on my site.

    its somthing like Automated Blog posting .

     

     

    Filed under:
Page 3 of 9 (134 items) < Previous 1 2 3 4 5 Next > ... Last »