Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:26:42+00:00 2026-06-01T19:26:42+00:00

I am using Google Data API for .Net(version 1.9) in my application. I have

  • 0

I am using Google Data API for .Net(version 1.9) in my application.
I have created a Google apps account and i have set the “Users cannot share documents outside this organization” setting under Google Docs.

When i try to share a file outside of the domain(organization) from Google docs web, i get a error saying the file cannot be shared outside of my domain.

But when i try the same thing from the API, it succeeds. I get a 200 success from the API. When i try to access the file from the share link it says ‘You need permission to access this resource’. My question is shouldn’t the API return with a error? how can i handle this case?


Here is the code that I am using:

DocumentsRequest request = null;   

/* request  initialization */

string csBatchReqBody = "<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:gAcl="http://schemas.google.com/acl/2007" xmlns:batch="http://schemas.google.com/gdata/batch"><category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/acl/2007#accessRule"/><entry><id>https://docs.google.com/feeds/default/private/full/document:1DsELtiNwq-ogOrp8cAONdMpGR4gBF79PjijTae-vVNg/acl/user:myusername@mydomain.com</id><batch:operation type="query"/></entry><entry><batch:id>1</batch:id><batch:operation type="insert"/><gAcl:role value="reader"/><gAcl:scope type="user" value="myusername@gmail.com"/></entry>"

string Url = "https://docs.google.com/feeds/default/private/full/document:1DsELtiNwq-ogOrp8cAONdMpGR4gBF79PjijTae-vVNg/acl/batch";

byte[] byteArray = Encoding.ASCII.GetBytes(csBatchReqBody);
MemoryStream inputStream = new MemoryStream(byteArray);
AtomEntry reply = request.Service.Insert(new Uri(Url), inputStream, "application/atom+xml", "");

MemoryStream stream = new MemoryStream();
reply.SaveToXml(stream);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:26:43+00:00Added an answer on June 1, 2026 at 7:26 pm

    The API actually returns a 400 if you try to share a file outside the domain and the admins have set the “Users cannot share documents outside this organization” flag.

    Your code sends a batch request (even if for a single element), you’d have to check the batch response to notice the error.

    Instead, use the following code to share a document to a single user, it assumes that entry is the DocumentEntry you want to share:

    AclEntry acl = new AclEntry();
    acl.Scope = new AclScope("username@gmail.com", "user");
    acl.Role = new AclRole("reader");
    acl = service.Insert(new Uri(entry.AccessControlList), acl);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Mike Bluestein's article, http://mikebluestein.wordpress.com/2009/09/27/using-monotouch-with-the-net-library-for-the-google-data-api/ , to build an application that communicates
I'm using the Google Apps Provisioning API to synchronize user data with our internal
i am using google transalate api in my application,i have done in text conversion
I am using google data api which gives date in datetime format. I want
Using Google Apps for your Domain, is it possible to set up a catch-all
I am developing a gis application using Google maps API. Currently I am using
I have a requirement to geocode data using Google's geocoding service. Google's geocoding services
I am working with Azure Table storage using the .NET API (TableServiceContext, WCF Data
I've written a script that authenticates against Google's OAuth API for Latitude, using Net::OAuth
Heya, I'm using google api to access calendar data, and when I visit the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.