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