shalafi
unread,Apr 25, 2009, 6:27:30 AM4/25/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to OpenSocial - OpenSocial Application Development
I've setup the osapi php client on my project.
I can for example query the logged user or his friends.
I'm using Google Friend Connect as my provider.
Like:
$batch=$this->osapi->newBatch();
$user_params=array(
"userId"=>"@me", // query the logged user
"groupId"=>"@self" // get logger users information
);
$batch->add($this->osapi->people->get($user_params),"self");
$response=$batch->execute(); // execute the job
$this->user=$response["self"]; // store the user for feature access
return $response["self"];
This works out for me.
The problem is that i can't read activities nor create one:
$batch=$this->osapi->newBatch();
$user_params=array(
"userId"=>"@me", // query the logged user
"groupId"=>"@self" // get logger users information
);
$batch->add($this->osapi->activities->get
($user_params),"userActivities");
$response=$batch->execute(); // execute the job
print_r($response);
the response is:
Array
(
[userActivities] => osapiError Object
(
[errorCode:private] => 500
[errorMessage:private] => <HTML>
<HEAD>
<TITLE>Internal Server Error</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Internal Server Error</H1>
<H2>Error 500</H2>
</BODY>
</HTML>
[response] =>
)
)
Also trying to create one:
// Create an activity (you could add osapiMediaItems to this btw)
$batch=$this->osapi->newBatch();
$activity = new osapiActivity(null, null);
$activity->setTitle('osapi test activity at ' . time());
$activity->setBody('osapi test activity body');
$create_params = array(
'userId' => "@me",
'groupId' => '@self',
'activity' => $activity
);
$batch->add($this->osapi->activities->create($create_params),
'createActivity');
$result = $batch->execute();
print_r($result);
The response is:
Array
(
[createActivity] => osapiError Object
(
[errorCode:private] => 400
[errorMessage:private] =>
..
<H1>Bad Request</H1>
Your client has issued a malformed or illegal request.
Is it something with my code or the provider?