MySpace Developer Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

API not returning data when SWF embedded in My Space App, but works elsewhere

Last post 05-10-2008 6:00 PM by rondata@myspace. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-09-2008 4:04 PM

    • J
    • Top 500 Contributor
    • Joined on 05-07-2008
    • Posts 7

    API not returning data when SWF embedded in My Space App, but works elsewhere

     We are trying connect to the my space open social API from Flash (AS3). We used the API by Joseph Estrada as well as performing REST calls directly. For example,

    var url:String = "http://api.msappspace.com/opensocial/v1/VIEWER/friends.xml?opensocial_token="
                        + mAuthToken + "&opensocial_mode=" + mSurface + "&page=1&page_size=40";

    The calls return with data just fine running from the Flash IDE. They work as expected when running the SWF locally (as with publish ctrl-12). However when we host the SWF in our My Space app, the calls to not work. But pasting the URL into the address bar of a browser does.

    The AS3 library reports "INTERNAL ERROR" from the My Space API. At one point we thought it could be a crossdomain issue but a couple people on IRC think otherwise.

    Any suggestions as to why the SWF running in the My Space app does not work when the same swf running locally or in the IDE do, and the requested URL from the My Space embedded SWF pasted into the browser also works?

    Seems like it doesn't like the auth token, but it works everywhere else?? 

  • 05-09-2008 4:56 PM In reply to

    • J
    • Top 500 Contributor
    • Joined on 05-07-2008
    • Posts 7

    Re: API not returning data when SWF embedded in My Space App, but works elsewhere

    Here's a related error we see:

     [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=0]
    securityErrorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: http://ourdomain.com/ourpath/ourswf.swf cannot load data from http://api.msappspace.com/opensocial-api-v1.svc/JSON/opensocial/VIEWER/friends?opensocial_token=big long token&opensocial_mode=canvas&page=1&page_size=40."]

     (just experimenting with JSON to try anything)

  • 05-09-2008 6:29 PM In reply to

    • J
    • Top 500 Contributor
    • Joined on 05-07-2008
    • Posts 7

    Re: API not returning data when SWF embedded in My Space App, but works elsewhere

    All indications point to this is a cross domain issue... Would someone please confirm that they are using the open social API from flash?

  • 05-09-2008 11:46 PM In reply to

    Re: API not returning data when SWF embedded in My Space App, but works elsewhere

     Hi J,

    Though I'm technically ignoring these forums until myspace allow me to cleanly update my Flash apps rather than blindly but that's another story.

    I have  6 Flash apps, 2 AS2, 4 AS3 of which 5 (2&3) use REST API calls (xml) - none use JE's AS3 lib (though I did rip some code out for updating app data but can't get that cleanly live yet...). All run as 'native' myspace flash apps and use the flashvars token passed.

    You do get a little too technical for me. Others flashers, who use to be active here but may also be sulking, may understand more than me.

    I'm unclear how your swf is called from myspace and also what's in your mAuthToken. 

    I believe when running on myspace you need to use the token passed in flashvars by myspace and when running from your pc you need to use oauth and secret key bits for calls to work. I'm not sure they are interchangable.

    Regarding crossdomain - if you need to grab data from your servers make sure yours has both

      <allow-access-from domain="*.myspace.com" />
      <allow-access-from domain="*.myspacecdn.com" />

    I don't want to confuse the issue anymore but hope it helps a bit

    Eddie 

     

     

     

  • 05-10-2008 6:00 PM In reply to

    Re: API not returning data when SWF embedded in My Space App, but works elsewhere

    "Though I'm technically ignoring these forums"

     

    Eddie, 

    You can ignore all you want. You don't have to answer any posts.

    To be honest, your disrespect for the folks who are trying to help is why most don't want to communiacte with you.

    You continually shoot the messenger.

    I thought a lot about posting this before I did, but that's the fact. It has nothing to do with not wanting to help you. It has everything to do with the way you interact with the rest of us.

    Regardless of what you think, we really read all issues. We're not ignoring you. Some of us have no desire to interact with you because nothing we say will make you feel better. No fix we're working on, no support in the forums. You'd rather just be upset and while you have every reason to be at times, it in NO WAY makes up for the disrespect of the people who are trying to help.

    Know that your issues are brought up to the proper folks. I no longer respond to you to say we're working on it, because if we don't get an on the spot fix or fix in your time frame, then we just get bashed.

    Know that there are OTHER issues besides yours.

    Rhonda 

    I won't tell you that I'm trying to help or to be patient, because it really doesn't matter with you at this point.  

     

    Follow us on Twitter:
    http://www.twitter.com/MySpaceDevTeam
Page 1 of 1 (5 items)