Eric, If I do it this way:
string payload = @" <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='reader'/> <gAcl:scope type='user' value='everyone'/> </entry> "; string url = entry.AccessControlList.ToString(); Stream s = service.StringSend( new Uri(url), payload, GDataRequestType.Insert); XmlDocument fd = new XmlDocument(); fd.Load(s); I get this result ?fd.OuterXml <?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http:// schemas.google.com/acl/2007" xmlns:batch="http://schemas.google.com/ gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/ "Dk8EQ3o_fCp7ImA9WxJbFEs.""> <id>http://docs.google.com/feeds/acl/private/full/spreadsheet %3At9_ZnvUwXHJkORMMzq-SEwg/user%3Aeveryone</id> <updated>2009-07-24T19:46:42.444Z</updated> <app:edited xmlns:app="http://www.w3.org/2007/ app">2009-07-24T19:46:42.444Z</app:edited> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule" /> <title>Document Permission - everyone</title> <link rel="self" type="application/atom+xml" href="http:// docs.google.com/feeds/acl/private/full/spreadsheet %3At9_ZnvUwXHJkORMMzq-SEwg/user%3Aeveryone" /> <link rel="edit" type="application/atom+xml" href="http:// docs.google.com/feeds/acl/private/full/spreadsheet %3At9_ZnvUwXHJkORMMzq-SEwg/user%3Aeveryone" /> <gAcl:role value="reader" /> <gAcl:scope type="user" value="everyone" /> </entry> But in Google Docs, the document is still listed as "Not Shared" On Jul 24, 2:50 pm, Eric Bidelman <api.e...@google.com> wrote: > You should be using the ACL feed of that spreadsheet: > .../feeds/acl/private/full/spreadsheet%3A123456 > > Eric > > On Thu, Jul 23, 2009 at 8:24 PM, chrissky <back5...@gmail.com> wrote: > > > Hi Eric, > > > Below is the code I tried, and the error message I got back. > > Fails on line > > insertedEntry = service.Insert(feedUri, aclentry) as AclEntry; > > > Chris > > > // first, get entry to be updated > > > DocumentsListQuery query = new DocumentsListQuery(); > > query.NumberToRetrieve = 1; > > query.Title = title; > > query.TitleExact = true; > > > DocumentsFeed feed = service.Query(query); > > > DocumentEntry entry = null; > > > AclEntry insertedEntry = null; > > > if (feed.Entries.Count > 0) > > entry = feed.Entries[0] as DocumentEntry; > > > // next, if successful, then update the document > > if (entry != null) { > > > AclEntry aclentry = new AclEntry(); > > > aclentry.Scope = new AclScope(); > > aclentry.Scope.Type = AclScope.SCOPE_USER; > > aclentry.Scope.Value = "everyone"; > > > aclentry.Role = AclRole.ACL_CALENDAR_READ; > > //aclentry.Role = "read"; > > > Uri feedUri = new Uri(entry.SelfUri.ToString()); > > > insertedEntry = service.Insert(feedUri, aclentry) as > > AclEntry; > > > } > > > Google.GData.Client.GDataRequestException was unhandled by user code > > Message="Execution of request failed: > > >http://docs.google.com/feeds/documents/private/full/spreadsheet:twltQ... > > " > > Source="Google.GData.Client" > > ResponseString="Invalid request URI" > > StackTrace: > > at Google.GData.Client.GDataRequest.Execute() > > at Google.GData.Client.GDataGAuthRequest.Execute(Int32 > > retryCounter) > > at Google.GData.Client.GDataGAuthRequest.Execute() > > at Google.GData.Client.Service.EntrySend(Uri feedUri, AtomBase > > baseEntry, GDataRequestType type, AsyncSendData data) > > at Google.GData.Client.Service.Insert(Uri feedUri, AtomEntry > > newEntry, AsyncSendData data) > > at Google.GData.Client.Service.Insert[TEntry](Uri feedUri, > > TEntry entry) > > at SetAcl.mGDataSetAcl(String title) in f: > > \ActiveInterfaceBusiness\client-folders\pittsburghtoday.org\web > > \SetAcl.aspx.cs:line 142 > > at SetAcl.HandleButton(Object sender, EventArgs e) in f: > > \ActiveInterfaceBusiness\client-folders\pittsburghtoday.org\web > > \SetAcl.aspx.cs:line 72 > > at System.Web.UI.WebControls.Button.OnClick(EventArgs e) > > at System.Web.UI.WebControls.Button.RaisePostBackEvent(String > > eventArgument) > > at > > > System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent > > (String eventArgument) > > at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler > > sourceControl, String eventArgument) > > at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection > > postData) > > at System.Web.UI.Page.ProcessRequestMain(Boolean > > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) > > > On Jul 23, 6:41 pm, Eric Bidelman <api.e...@google.com> wrote: > > > Calendar's .NET examples may help: > >http://code.google.com/apis/calendar/docs/2.0/developers_guide_dotnet... > > > > And reference the DocList docs: > >http://code.google.com/apis/documents/docs/2.0/developers_guide_proto... > > > <http://code.google.com/apis/calendar/docs/2.0/developers_guide_dotnet.. > > .> > > > Eric > > > > On Thu, Jul 23, 2009 at 3:31 PM, chrissky <back5...@gmail.com> wrote: > > > > > This is a repost: > > > > > Can this now be done. Previous discussion on this was ambiguous. Any > > > > code samples in C# for this? Eric? Please. I need to automate this. > > > > > Thanks!, > > > > Chris --~--~---------~--~----~------------~-------~--~----~ 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 Google-Docs-Data-APIs@googlegroups.com To unsubscribe from this group, send email to google-docs-data-apis+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---