Hi,
I have a web page from where i need to allow users to add the displayed 
events to their Google calendar.
I am using the Zend Google Data APIs Client Library(v 1.2) for this.
I have followed the guide at 
http://code.google.com/apis/calendar/data/1.0/developers_guide_php.html for 
this
and am using the same sample code provided there (
/framework/standard/trunk/demos/Zend/Gdata/Calendar.php<http://framework.zend.com/svn/framework/standard/trunk/demos/Zend/Gdata/Calendar.php>
).
Following is my code i use to initiate the login process and the event 
creation:

require_once('[MY_PATH]/Calendar.php');
//authenticate users to Google accounts
$token = $_GET['token'];
if(!isset($token) && empty($token))
{ 
    $authSubUrl = getAuthSubUrl();
    $this->redirect($authSubUrl);
}
else
{   
    //retrieve a session token from Google and place this value into the 
session variable
    if(! isset($_SESSION['sessionToken']) && isset($token))
    {
        $_SESSION['sessionToken'] = 
Zend_Gdata_AuthSub::getAuthSubSessionToken($token);
    }
    //get a Zend_Http_Client object
    $client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']);

    $this->startdate = '2011-06-28';
    $this->starttime = '15:00:00';
    $this->enddate = '2011-06-29';
    $this->endtime = '18:30:00';
    $this->title = 'the google cal event';
    $this->location = 'California';
    $this->description ='this is a test event that u have to attend if u 
want to live.';
    
    //Create single-occurrence events
    $result = createEvent($client, $this->title, $this->description, 
$this->location,
                $this->startdate, $this->starttime, $this->enddate, 
$this->endtime, '0');

}


So with this it redirects the user to authenticate the application first, 
which works properly, but on return with the token it throws the following 
error
Expected response code 200, got 403
You must be a calendar user to use private feeds.
I used my normal gmail login to login and add the event.
Could some one please tell me if i am missing something.

-- 
You received this message because you are subscribed to the Google
Groups "Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/calendar/community/forum.html

Reply via email to