I am using the opensocial php client and I am trying to get a users status. I tried the example code that comes with the client (seen below), but it keeps giving me a blank status. I set the status a couple of days ago, so I know it isn't blank. I've been able to get different details about the user so I know that everything isn't coming back blank. Does anyone have any ideas??? Thanks!
try {
$batch = $this->myspace->newBatch();
// Fetch the current user.
$self_request_params = array(
'userId' => $this->ms_user_id, // Person we are fetching.
'groupId' => '@self', // @self for one person.
'fields' => array('status') // Which profile fields to request.
);
$batch->add($this->myspace->people->get($self_request_params), 'self');
$result = $batch->execute();
//put the field names as keys in an array
foreach ($result as $key => $result_item) {}
if ($result_item instanceof osapiError) {
$code = $result_item->getErrorCode();
$message = $result_item->getErrorMessage();
echo 'There was a $code error with the $key request:';
echo htmlentities($message);
} else {
echo 'Response for the $key request:';
echo htmlentities(print_r($result_item, True));
}
return $result_item->status;
} catch (Exception $e) {
return false;
}