I am trying to test your code. But I have my own domain name. In that case, what the $uri parameter should be?? I get the error "Passed parameter is not a valid HTTP URI." Thanks in advance.
On Apr 29, 11:44 pm, Ryan Valdron <[email protected]> wrote: > Trav, > > If you're using the Zend php api, I wrote a method in the Docs class > > public function addContributor($data, $uri, $className='Zend_Gdata_Entry'){ > return $this->insertEntry($data, $uri, $className); > > } > > that works similar to insertDocument. > where $uri = "http://docs.google.com/feeds/acl/private/full/document%3A".$id; > and $id is the document's ID. > > and $data follows this layout: > <entry xmlns="http://www.w3.org/2005/Atom" > xmlns:gAcl='http://schemas.google.com/acl/2007'> > <category scheme='http://schemas.google.com/g/2005#kind' > term='http://schemas.google.com/acl/2007#accessRule'/> > <gAcl:role value='writer'/> > <gAcl:scope type='user' value='[email protected]'/> > </entry> > as given in the developer's guide > (http://code.google.com/apis/documents/docs/2.0/developers_guide_proto...). > > You could also do it in a batch run using this function (untested) > > public function executeBatch($data, $uri, > $className='Zend_Gdata_App_Feed', $extraHeaders=array()){ > $response = $this->post($data, $uri, null, null, $extraHeaders); > > $returnFeed = new $className($response->getBody()); > $returnFeed->setHttpClient(self::getstaticHttpClient()); > > $etag = $response->getHeader('ETag'); > if (!is_null($etag)) { > $returnEntry->setEtag($etag); > } > > return $returnEntry; > } > > in the App class. Where $data is laid out according to the link above > and $uri is the same as above with /batch at the end of it. > > Either way you're going to have to adjust the scope in the Docs > implementation from $scope = 'http://docs.google.com/feeds/documents'; > to $scope = 'http://docs.google.com/feeds/';in order for either > function to work. > > -Ryan > > On Wed, Apr 29, 2009 at 12:21 PM, Trav <[email protected]> wrote: > > > Hi, > > > I have completed the portion of my application that uploads a document > > to Google Docs with the PHP api, However, I need to invite > > collaborators to the document automatically through PHP, how can I > > accomplish this? > > > I am using Google docs on my own domain through Google Apps. The > > collaborators that I need to invite will all be in the same domain. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Docs Data APIs" 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://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---
