2
votes

I'm resurfacing this post because it hasn't been settled.

I am trying to change permission of my FusionTable via Google Drive API, and I'm getting 500 error from Google. Here's the situation.

My request:

    uri = URI('https://www.googleapis.com/drive/v2/files/{{my fusion table id}}/permissions')
    http = Net::HTTP::new(uri.host, uri.port)
    req = Net::HTTP::Post.new(uri.path)
    req["Authorization"] = {{proper oauth}}
    req["Content-Type"] = "application/json"

    bodyObj = {}
    bodyObj["role"] = "writer"
    bodyObj["type"] = "anyone"

    req.body = bodyObj.to_json

    response = http.request(req).response
    puts response.body

And the Response body is:

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "internalError",
                "message": "Internal Error"
            }
        ],
    "code": 500,
    "message": "Internal Error"
    }
}

This seems to be problem that others have faced as well. Does anyone know what the correct solution is or is this simply something that Google needs to fix?

Thank you.

1
If it looks like a bug, you can file an issue here: code.google.com/a/google.com/p/apps-api-issues/issues/… - Cheryl Simon
Are you able to change the permissions of anything else (doc, spreadsheet, presentation, etc.) stored in your Drive account? - Rod McChesney

1 Answers

0
votes

Use the following statement to determine the exact error.

    try

    {

    // Your Code

    }

    catch (WebException wex)
    {       

    string pageContent = new StreamReader(wex.Response.GetResponseStream()).ReadToEnd().ToString();    

    return pageContent;

    }

If it's not an try-catch sequence, use only this code within your code

    string pageContent = new StreamReader(wex.Response.GetResponseStream()).ReadToEnd().ToString();

Otherwise I suggest using Fiddler, you can download FiddlerForWindows from here.