Error 500 inserting a activity with google_api_domain and google-api-php-client

699 Views Asked by At

I have problems when using the api google-api-php-client to create an activity for a circle that I created within the API google+ Domains API. I'm getting a 500 error when I make the request. The code is:

    # insert activity
    $activityObject = new Google_Service_PlusDomains_ActivityObject();
    $activityObject->setOriginalContent("Prueba de actividad desde la API de mensajes");
    $activityAccess = new Google_Service_PlusDomains_Acl();
    $activityAccess->setDomainRestricted(true);
    $resource = new Google_Service_PlusDomains_PlusDomainsAclentryResource();
    $resource->setType("circle");
    $resource->setId("3a2f98470bdb8aa7");
    $resources = array();      
    $resources[] = $resource;

    $activityAccess->setItems($resources);

    $activity = new Google_Service_PlusDomains_Activity();
    $activity->setObject($activityObject);
    $activity->setAccess($activityAccess);
    $plusService->activities->insert("me", $activity);/**/

and here the error that is giving me. Message is null and not know the reason for the error:

api_php_client exception 'Google_Service_Exception' with message 'Error calling POST https://www.googleapis.com/plusDomains/v1/people/me/activities: (500)

     "error": {
      "code": 500,
      "message": null
     }
    }
    ' in /var/www/html/apis/apimensajes/protected/commands/Google/Http/REST.php:82
    Stack trace:
    #0 /var/www/html/apis/apimensajes/protected/commands/Google/Http/REST.php(45): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request))
    #1 /var/www/html/apis/apimensajes/protected/commands/Google/Client.php(499): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
    #2 /var/www/html/apis/apimensajes/protected/commands/Google/Service/Resource.php(194): Google_Client->execute(Object(Google_Http_Request))
    #3 /var/www/html/apis/apimensajes/protected/commands/Google/Service/PlusDomains.php(492): Google_Service_Resource->call('insert', Array, 'Google_Service_...')
    #4 /var/www/html/apis/apimensajes/protected/commands/GplusCommand.php(71): Google_Service_PlusDomains_Activities_Resource->insert('me', Object(Google_Service_PlusDomains_Activity))
    #5 /var/www/html/apis/apimensajes/protected/commands/JobCommand.php(35): GplusCommand->run(Object(Job))
    #6 [internal function]: JobCommand->actionStart()
    #7 /var/www/html/yii/framework/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs(Object(JobCommand), Array)
    #8 /var/www/html/yii/framework/console/CConsoleCommandRunner.php(71): CConsoleCommand->run(Array)
    #9 /var/www/html/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run(Array)
    #10 /var/www/html/yii/framework/base/CApplication.php(180): CConsoleApplication->processRequest()
    #11 /var/www/html/yii/framework/yiic.php(33): CApplication->run()
    #12 /var/www/html/apis/apimensajes/protected/yiic.php(10): require_once('/var/www/html/y...')
    #13 /var/www/html/apis/apimensajes/protected/yiic(4): require_once('/var/www/html/a...')

Where is the error?

Thanks in advanced

0

There are 0 best solutions below