MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

OpenSocial 0.9 Activities REST doesn't work for developers?

Last post 11-03-2009 10:28 AM by Harakiro. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-21-2009 6:52 PM

    • Smart
    • Top 75 Contributor
    • Joined on 02-05-2008
    • Posts 54

    OpenSocial 0.9 Activities REST doesn't work for developers?

    I've tried just about everything to get REST Acitvities working, yet I keep getting 400 errors. 

    The docs mention that templates need to be live before being used. If so, how do we test test templates in developer mode?

    My code:

            $batch = $osapi->newBatch();
           
            $activity = new osapiActivity(null, null);
            $activity->setField('title', 'osapi test activity at ' . time());
            $activity->setField('body', 'osapi test activity body');
           
            $msParameters = array();
            $msParameters[ = array("key"=>"numFriends", "value"=>"5");
            $msParameters[ = array("key"=>"numCoins", "value"=>"5");
            $activity->setField('templateParams', $msParameters);
            $activity->setField('titleId', 'Donate_Coins');

            $create_params = array(
      'userId' => $this->xid,
      'groupId' => '@self',
      'activity' => $activity
    );
    $batch->add($osapi->activities->create($create_params), 'createActivity');

    // Send all batched commands
    $result = $batch->execute();

     

    This fails 400, even though it is VERYsimilar to the code here: http://wiki.developer.myspace.com/index.php?title=OpenSocial_v0.9_Activities

  • 10-30-2009 11:48 AM In reply to

    Re: OpenSocial 0.9 Activities REST doesn't work for developers?

     Hi There-

     Yesterday I found a bug in the osapi SDK and have since created a patch and pushed it live. 

     You can download the latest version from SVN and this correct any issues creating activities.
     http://code.google.com/p/opensocial-php-client/source/checkout

     One thing to note is that you MUST create an activity template for your application before you can send activities. Please refer to here if you're unfamilar with activity templates: http://wiki.developer.myspace.com/index.php?title=Activity_Templates

     Thanks,

    Jesse Edwards

  • 10-30-2009 10:01 PM In reply to

    Re: OpenSocial 0.9 Activities REST doesn't work for developers?

    I think this bug fix should be posted on wiki or somewhere professional. I took me 3 days banding my head over it and today I found this Angry...

     

    There may be other developers out there still banging there heads!

  • 11-03-2009 10:28 AM In reply to

    Re: OpenSocial 0.9 Activities REST doesn't work for developers?

    Sorry to hear about the wasted time Max. I know that can be frustrating. I'll see what I can do about getting this posted some place.

    PS: I've had the download links updated on opensocial.org to the latest versions. So downloading from the svn is no longer needed.

     

    Thanks,

    Jesse

Page 1 of 1 (4 items)