Welcome Developers!

in

Welcome!

in

Read me first -- Common Questions & Announcements

Last post 11-12-2008 3:11 PM by Justin. 27 replies.
Page 1 of 2 (28 items) 1 2 Next >
Sort Posts: Previous Next
  • 02-14-2008 11:10 AM

    Read me first -- Common Questions & Announcements

    Basic information


    Q: What version of OpenSocial do you support?
    A: We support version 0.7 and 0.8.



    opensocial.makeRequest


    Q: Do I have to use port 80 to send requests back to my server?
    A: Yes.  Only port 80 is available at the moment, we are discussing opening a port in a higher range but that is not finalized.


    Q: How do I validate that a makeRequest call actually came from the particular viewer and owner identified in the request?
    A: Send opensocial.ContentRequestParameters.AuthenticationType.SIGNED into your makeRequest call.  Doing so will cause OAUTH to digitally sign the request and will allow you to verify the identity of the viewer and owner.


    Q: What types of feeds do you support?
    A: We currently support RSS2.



    Common usage


    Q: I’m new to all this, how do I do ... anything?
    A: A great starter document was written to help you get ramped up, find it here.


    Q: How do I get all the photos for a particular album?
    A: To do this, you'll need to send the following into the opt_param of a newFetchPhotosRequest:

    opt_params[MyOpenSpace.DataRequest.PhotoRequestFields.ALBUM_ID] = <some album id>;

    Where <some album id> is the integer ID of an album you (probably) discovered from a newFetchAlbumsRequest call.

     

    Q: I want to figure out what books the viewer likes, how do I do that?  What about additional data?
    A: Use the code below to get the data you need (version 0.7):


    var request = opensocial.newDataRequest();
    var personFields = [opensocial.Person.Field.ID,MyOpenSpace.Person.Field.ABOUT,MyOpenSpace.Person.Field.BOOKS];
    var param = {};
    param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = personFields;
    var newReq = request.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER, param);
    request.add(newReq);
    request.send(callback);

    For 0.8, the same code applies except replace the second line with this one: 

    var personFields = [opensocial.Person.Field.ID,opensocial.Person.Field.ABOUT_ME,opensocial.Person.Field.BOOKS];


    And then in the callback (0.7):

    response.get(opensocial.DataRequest.PersonId.VIEWER).getData().getField(MyOpenSpace.Person.Field.BOOKS);

     

    For 0.8:

    response.get(opensocial.IdSpec.PersonId.VIEWER).getData().getField(opensocial.Person.Field.BOOKS);


    You can replace the fields inside personFields with any of those defined in MyOpenSpace.Person.Field or opensocial.Person.Field.


    Q: Great!  So I do the same thing to get extra data on viewer and owner friends right?
    A: No, sorry, we don’t support that at this time.



    Q: I want to access some of the extended entities, like videos, how do I do that?
    A: For now, this will work similar to the code sample above, just replace newFetchPersonRequest with newFetchAlbumsRequest or newFetchVideoRequest, etc. However, very soon this won’t work, please see the code below for how to fetch video, album and photo data in the near future.

    0.7:

    var request = opensocial.newDataRequest();
    var albumReq = MyOpenSpace.DataRequest.newFetchAlbumsRequest(opensocial.DataRequest.PersonId.VIEWER);
    var photoReq = MyOpenSpace.DataRequest.newFetchPhotosRequest(opensocial.DataRequest.PersonId.VIEWER);
    var videoReq = MyOpenSpace.DataRequest.newFetchVideosRequest(opensocial.DataRequest.PersonId.VIEWER);
    request.add(albumReq);
    request.add(photoReq);
    request.add(videoReq);
    request.send(callback);

    For 0.8 replace opensocial.DataRequest.PersonId.VIEWER with opensocial.IdSpec.PersonId.VIEWER. 



    Flash


    Q: What is loaded into my .swf and how is it loaded?
    A: We currently use FlashVars to pass in the following parameters: opensocial_token, opensocial_surface and opensocial_consumer_key.



    Miscellaneous


    Q: Can the height of my application only be set from the Application Builder form?  Is 1000px the maximum?  Isn’t it dynamic?  What about the width?
    A: For now the width is static.  As for the height, it can be adjusted dynamically with the following call:


    gadgets.window.adjustHeight(opt_height);


    This can't exceed 1000px on the home and profile views, but the maximum on the canvas is very large and can exceed 1000px.  Leaving an empty opt_height will cause the iframe to attempt to resize itself based on the contents.


    Q: How do I navigate between surfaces, and how do I pass data between surfaces?
    A: To navigate between surfaces make this call:


    gadgets.views.requestNavigateTo(surface, params);


    Where "params" are some optional parameters that you can pass between surfaces.  To collect the parameters on the other side of the call, you’ll do this:


    gadgets.views.getParams();



    Q: Do I have to store all my data on my servers using the makeRequest call?  Isn’t there anything better?
    A: Great question!  There is indeed – our data store is up and running.  You can save data for the current viewer with a key/value pair. Data can be retrieved for viewer, owner, viewer friends and owner friends.  Use opensocial.DataRequest.newFetchPersonAppDataRequest and opensocial.DataRequest.newUpdatePersonAppDataRequest.  More info on this can be found on the opensocial docs site.


    newFetchPersonAppDataRequest
    newUpdatePersonAppDataRequest
  • 02-14-2008 11:16 AM In reply to

    Re: Read me first -- Common Questions

    Hey - a page on what is NOT currently supported (with ETA where applicable)  will be good too. i.e. notifications for non app users, pre/post url etc

    This will be helpful (especially for the majority that came from FB/Bebo env).

     

    thanks. 

     

    PS: I've taken the initiative here: http://developer.myspace.com/Community/forums/t/327.aspx 

     

     

     

  • 02-14-2008 2:32 PM In reply to

    Re: Read me first -- Common Questions

    > Q: How do I validate that a makeRequest call actually came from the particular viewer and owner identified in the request?
    > A: Send opensocial.ContentRequestParameters.AuthenticationType.SIGNED into your makeRequest call.  Doing so will cause OAUTH to digitally sign the request and will allow you to verify the identity of the viewer and owner.

     I'm still getting empty 'oauth_token' and 'oauth_signature' params when using SIGNED.  The params are sent to our server, they just don't have any values.  The oauth_nonce, oauth_timestamp, etc. all seem to be sent correctly though.

     I'm invoking the makeRequest like so:

    var params = {};
    params[opensocial.ContentRequestParameters.METHOD] =
      opensocial.ContentRequestParameters.MethodType.GET;
    params[opensocial.ContentRequestParameters.AUTHORIZATION] =
      opensocial.ContentRequestParameters.AuthorizationType.SIGNED;
    
    opensocial.Container.get().makeRequest(uri, callback, params); 
    I tried substituting AUTHORIZATION w/ AUTHENTICATION and no change.  I don't see any such value 'opensocial.ContentRequestParameters.AuthenticationType' in the opensocial.js file, so I assume you mean 'opensocial.ContentRequestParameters.AuthorizationType'.
    Filed under:
  • 02-14-2008 2:42 PM In reply to

    Re: Read me first -- Common Questions

    I am having the same issue as SodaHead. 

    var makeRequestParams = {};
    // tried AUTHENTICATION
    makeRequestParams[opensocial.ContentRequestParameters.AUTHENTICATION] = opensocial.ContentRequestParameters.AuthorizationType.SIGNED;
    makeRequestParams[opensocial.ContentRequestParameters.MethodType] = opensocial.ContentRequestParameters.MethodType.GET;
    // tried AuthorizationType
    makeRequestParams[opensocial.ContentRequestParameters.AuthorizationType] = opensocial.ContentRequestParameters.AuthorizationType.SIGNED;
    
    opensocial.makeRequest(url, insideCallback, makeRequestParams);
    

    The parameters I receive from the Test Harness:

    "oauth_consumer_key":"http:\/\/viphaklay.com\/vipymyspace6",
    "oauth_token":"",
    "oauth_signature_method":"HMAC-SHA1",
    "oauth_signature":"",
    "oauth_timestamp":"1",
    "oauth_nonce":"-100094",
    "oauth_version":"1.0"

     

    I even tried adding the "opensocial_authtype": "SIGNED" parameter as discussed:
    http://developer.myspace.com/Community/forums/p/126/372.aspx#372
    http://developer.myspace.com/Community/forums/p/51/1045.aspx#1045

    That doesn't appear to work, either. Of course I don't know if the above suggestion are from MySpace developers or not, since MySpace has not implemented a way to tell if a forum poster is just some regular Joe or someone that actually knows what the heck they're talking about.

      

    Filed under:
  • 02-15-2008 10:29 AM In reply to

    Re: Read me first -- Common Questions

    Hi, I thought this would be fixed by the time the FAQ went up, guess I timed it wrong, let me look into it, and I'll update the FAQ.
  • 02-19-2008 6:16 AM In reply to

    Re: Read me first -- Common Questions

    ping devs.myspace.com -t

     

    What's the status on this? Any updates? Nothing has been mentioned about authentication on the blog or elsewhere that I can find. 

    Filed under:
  • 02-21-2008 12:06 PM In reply to

    Re: Read me first -- Common Questions

     Updated to reflect the fact that requestNavigateTo is now operational!  Navigate away!

  • 02-23-2008 3:16 PM In reply to

    Re: Read me first -- Common Questions

    is there a place where we can get the latest updates to the myspace api?  for example, how do we know that requestNavigateTo() works now? 

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

    • Qloud
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 5

    Re: Read me first -- Common Questions

     is there an example on how to use the requestNavigateTo(), cause i am not able to get it work.

     

    i am doing :

     var surfaces = env.getSupportedSurfaces();

    var surface=surfaces[0];

     

    console.log(surface)

    opensocial.requestNavigateTo(surface);

     

     and the output for the console.log(surface) is an object

    Object name=canvas isPrimaryContentValue=true

     

    but th requestNavigateTo does nothing ... so i am still on the profile box .

     

    Can anyone help me ? 

  • 02-25-2008 11:15 AM In reply to

    Re: Read me first -- Common Questions

    There was a bug with requestNavigateTo, it needs the surface name not the actual object.  So:

    opensocial.requestNavigateTo(surface.getName()) ;

    However, this will be fixed very shortly (hopefully today), your above example looks like it will work fine when that happens.  Also note that rNT doesn't work from the home page right now, that will take a bit longer to fix.

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

    Re: Read me first -- Common Questions

    I'm currently developing on Orkut and I'm using the data API to store account information about the users. Can I assume that the data API will be there for launch on MySpace?

     I know you guys are swamped. Thanks so much for any info you might be able to give.

    -Michael 

  • 02-25-2008 11:56 PM In reply to

    Re: Read me first -- Common Questions

    Yep, the data store should be available at launch.
  • 02-26-2008 11:11 AM In reply to

    Re: Read me first -- Common Questions

    Quick note: requestNavigateTo is now correctly following the opensocial spec and taking in an opensocial.Surface object instead of the surface name. 

  • 02-26-2008 11:11 AM In reply to

    Re: Read me first -- Common Questions

    under crimson: I'll try to announce things in this thread. 

  • 02-26-2008 12:47 PM In reply to

    Re: Read me first -- Common Questions

    SodaHead had posted this:

    var makeRequestParams = {};
    // tried AUTHENTICATION
    makeRequestParams[opensocial.ContentRequestParameters.AUTHENTICATION] = opensocial.ContentRequestParameters.AuthorizationType.SIGNED;
    makeRequestParams[opensocial.ContentRequestParameters.MethodType] = opensocial.ContentRequestParameters.MethodType.GET;
    // tried AuthorizationType
    makeRequestParams[opensocial.ContentRequestParameters.AuthorizationType] = opensocial.ContentRequestParameters.AuthorizationType.SIGNED;
     opensocial.makeRequest(url, insideCallback, makeRequestParams);

    The parameters I receive from the Test Harness:

    "oauth_consumer_key":"http:\/\/viphaklay.com\/vipymyspace6",
    "oauth_token":"",
    "oauth_signature_method":"HMAC-SHA1",
    "oauth_signature":"",
    "oauth_timestamp":"1",
    "oauth_nonce":"-100094",
    "oauth_version":"1.0"

    I've never, once, been able to get ANY of those oauth params to show up on my server side.. nothing is *ever* added as a param.

     I dont mean that token/signature is empty.. I mean that they DO NOT get sent/set at all :)

     

Page 1 of 2 (28 items) 1 2 Next >