My Index page ( calling page)
echo "get_activities_current\n";
$result = $myspace->Actitivies->post_activities_current('this is from ipulse testing','');
The contents of myspace class
<?php
require_once("api/OAuthTokenAPI.php");
require_once("api/PeopleAPI.php");
require_once("api/ActivitiesAPI.php");
class MySpaceAPI {
public $OAuthToken;
public $People;
public $Activities;
//ctor
public function __construct($application_key, $application_secret) {
$this->OAuthToken = new OAuthTokenAPI($application_key, $application_secret);
$this->People = new PeopleAPI($application_key, $application_secret);
$this->Activities = new ActivitiesAPI($application_key, $application_secret);
}
public function set_oauth_token($oauth_token) {
$this->OAuthToken->set_oauth_token($oauth_token);
$this->People->set_oauth_token($oauth_token);
$this->Activities->set_oauth_token($oauth_token);
}
public function set_oauth_token_secret($oauth_token_secret) {
$this->OAuthToken->set_oauth_token_secret($oauth_token_secret);
$this->People->set_oauth_token_secret($oauth_token_secret);
$this->Activities->set_oauth_token_secret($oauth_token_secret);
}
public function set_output_array($output_array) {
$this->OAuthToken->set_output_array($output_array);
$this->People->set_output_array($output_array);
$this->Activities->set_output_array($output_array);
}
}
?>
The contents of Activities Class
<?php
require_once("../lib/base/Common.php");
require_once("../lib/base/OAuthBaseAPI.php");
class ActivitiesAPI extends OAuthBaseAPI {
//ctor
public function __construct($application_key, $application_secret) {
$this->application_key = $application_key;
$this->application_secret = $application_secret;
$this->oauth_consumer = new OAuthConsumer($this->application_key, $this->application_secret);
$this->oauth_token = '';//new OAuthToken(null, null);
$this->api_version = ApiVersionType::$VERSION_V2;
$this->resource_base = CommonConstants::$URL_ROOT_API;
$this->response_type = ResponseType::$JSON;
}
//OK
public function get_activities_current($query_parameters = null) {
$resource = sprintf("/activities/%s/%s", SelectorType::$ME, SelectorType::$SELF);
$result = $this->do_get($resource, null, $query_parameters);
return $result;
}
public function post_activities_current($post_data, $headers = null) {
$resource = sprintf("/activities/%s/%s", SelectorType::$ME, SelectorType::$SELF);
$result = $this->do_post($resource, $post_data, $headers);
return $result;
}
}
?>
Please suggest me solution if any body has got working using the above way or any other way