2

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.

Community
  • 1
  • 1
hackstar15
  • 1,259
  • 1
  • 10
  • 14
  • 1
    If it looks like a bug, you can file an issue here: https://code.google.com/a/google.com/p/apps-api-issues/issues/list?q=API%3DDrive – Cheryl Simon Mar 05 '15 at 18:09
  • Are you able to change the permissions of anything else (doc, spreadsheet, presentation, etc.) stored in your Drive account? – Rod McChesney Mar 09 '15 at 17:15

1 Answers1

0

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.

SanyTiger
  • 666
  • 1
  • 8
  • 23
  • I'm not getting an exception. That's the body of the response that's being returned by google. Or am I misunderstanding your response...? – hackstar15 Mar 05 '15 at 05:02
  • My response generates the code causing the 500 internal error. Use the catch code only within your code to determine the exact 500 internal error and update your post so that I can help you further. – SanyTiger Mar 05 '15 at 05:04
  • The server error is: #. Is this what you wanted to see? I can't "catch" anything because no exception is thrown. The 500 error is not from my server, but in the response that google returns – hackstar15 Mar 05 '15 at 05:08
  • Use Fiddler, from the link above, for determining the cause of the error – SanyTiger Mar 05 '15 at 05:09