Google+ API CommentActivity return 400 Error-Collection of common programming errors

I’m having no luck calling the Google+ API for pushing a CommentActivity moment. I have been able to push an AddActivity successfully as well as a DiscoverActivity.

I read somewhere on the internet whilst searching for a solution that the 400 HTTP Status represents that my user credentials are invalid, but I have been able to post AddActivity & DiscoverActivity after trying CommentActivity and I have tried disconnecting and reconnecting my account and linking the required credentials to no avail.

Here’s my code to generate the moment, I believe this is the error, and it’s probably something to do with the use of a Target and a Result in this moment type (Neither DiscoverActivity nor AddActivity have a Result field). In particular, the Target’s and Result’s URLs are the same but the Result’s has an appended anchor. The documentation implies that this should work fine, however.

  $moment = new Google_Moment();
  $moment->setType("http://schemas.google.com/CommentActivity");
  $target = new Google_ItemScope();
  $target->setUrl(get_permalink($comment->comment_post_id));
  $target->setType("http://schema.org/Article");
  $moment->setTarget($target);
  $result = new Google_ItemScope();
  $result->setId("comment-".$comment_id);
  $result->setType("http://schema.org/Comment");
  $result->setUrl(get_comment_link($comment_id));
  $result->setText($comment->comment_content);
  $moment->setResult($result);
  Soci_Base::getSocial("google")->getUser($user)->GPlus->moments->insert('me', 'vault', $moment);

GPlus is a reference to a Google_PlusService object.

Here’s my exception I receive with stack trace (Pointless parts of the files are omitted, hooks.php and plugin.php are not the Google+ API)

**Fatal error**:  Uncaught exception 'Google_ServiceException' with message 'Error calling POST https://www.googleapis.com/plus/v1/people/me/moments/vault?key=AIzaSyBa27u5PtBgFHO4SY_Fq9_0sO39pFWrRzE: (400) Invalid Value' in /~/src/io/Google_REST.php:66 Stack trace:
#0 /~/G+/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest))
#1 /~/G+/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest))
#2 /~/G+/src/contrib/Google_PlusService.php(167): Google_ServiceResource->__call('insert', Array)
#3 /~/hooks.php(54): Google_MomentsServiceResource->insert('me', 'vault', Object(Google_Moment))
#4 /~/plugin.php(406): soci_comment('108040')
#5 /~ in /~/lib/G+/src/io/Google_REST.php on line 66

I think that’s all of the info I have on the matter – I have no idea to get the exact HTTP request the script makes. Thank you in advance for any and all help and for even having a look ^_^

Here’s the code for the whole login sequence:

Soci_Google::addActionRequirement('http://schemas.google.com/AddActivity');
Soci_Google::addActionRequirement('http://schemas.google.com/CommentActivity');
Soci_Google::addActionRequirement('http://schemas.google.com/CreateActivity');
Soci_Google::addActionRequirement('http://schemas.google.com/DiscoverActivity');

Soci_Google::addActionRequirement:

public static function addActionRequirement($url) {
    self::$activities[] = $url;
}

self::$token is just a reference to a string

$ret = new Soci_Google();
self::$users[$id] = $ret;
$ret->setToken(self::$meta->getMeta($user, self::$token));
return $ret;

Soci_Google __construct():

public function __construct() {
    $this->googleObj = new Google_Client();
    $this->googleObj->setApplicationName(self::$appName);
    $this->googleObj->setClientId(self::$clientID);
    $this->googleObj->setClientSecret(self::$clientSecret);
    $this->googleObj->setRedirectUri(self::$redirectURI);
    $this->googleObj->setDeveloperKey(self::$devKey);
    $this->GPlus = new Google_PlusService($this->googleObj);
    $this->googleObj->setRequestVisibleActions(self::$activities);
}

Soci_Goolge setToken

$this->googleObj->setAccessToken($googleUsrToken);