What is permissionId in Google API?

825 views
Skip to first unread message

Kuan Butts

unread,
May 6, 2015, 12:00:00 PM5/6/15
to google-api-jav...@googlegroups.com

I am trying to replicate the JavaScript client library example shown onhttps://developers.google.com/drive/v2/reference/permissions/update#examples. There is a reference to permissionId. How do I get this, I've looked everywhere, and my assumption is I am missing something dead obvious.

Thanks in advance.


Alexander Ivanov

unread,
May 6, 2015, 1:02:43 PM5/6/15
to google-api-jav...@googlegroups.com
Hi Kuan Butts

I think the permissionId is an user identificator. For an example the user who runs api has 'permissionId' as 'me'. It means 'owner'.

You can get 'permissionId' for any user by getIdForEmail() https://developers.google.com/drive/v2/reference/permissions/getIdForEmail

Cheers!

Alexander Ivanov

unread,
May 6, 2015, 1:09:06 PM5/6/15
to google-api-jav...@googlegroups.com
The permissionId for an user:


Kuan Butts

unread,
May 6, 2015, 1:34:30 PM5/6/15
to google-api-jav...@googlegroups.com
Thanks much for the rapid response. My goal is to create a Fusion Table and update the share setting to "Anyone who has the link can view." Am I barking up the wrong tree by pursuing permissions? I did not see a way to modify the share settings through the Fusion Tables API specifically. Thanks again.

Alexander Ivanov

unread,
May 7, 2015, 10:56:49 AM5/7/15
to google-api-jav...@googlegroups.com
Kuan Butts,


Please, write a bug to googletables-feedback(a)google.com. I did it!

Kuan Butts

unread,
May 7, 2015, 11:14:42 AM5/7/15
to google-api-jav...@googlegroups.com
HI Alex,

Yeah I had a modified question related to this up on SO documenting my struggle with this API call: http://stackoverflow.com/questions/30085922/set-permissions-on-file-to-anyone-with-a-link-with-google-javascript-client-api

This seems to indicate that the problem has existed for upwards of 6 months and there has been no solution developed... That's not good news!

Kuan Butts

unread,
May 7, 2015, 11:24:47 AM5/7/15
to google-api-jav...@googlegroups.com
Looks like I found the same SO as you!

Kuan Butts

unread,
May 8, 2015, 1:49:52 PM5/8/15
to google-api-jav...@googlegroups.com
Looks like this problem also occurs with delete permissions on Google API

gapi.client.drive.permissions.delete({'fileId':'XXXXXX','permissionId':'XXXXX'}).execute(function(resp){console.log(resp)})

On Thu, May 7, 2015 at 11:24 AM, Kuan Butts <kuan...@gmail.com> wrote:
Looks like I found the same SO as you!

--
You received this message because you are subscribed to a topic in the Google Groups "Google API JavaScript Client" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-api-javascript-client/sx4nRRo7cE8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-api-javascrip...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
KUAN BUTTS

Alexander Ivanov

unread,
May 13, 2015, 5:53:55 AM5/13/15
to google-api-jav...@googlegroups.com
Kuan Butts,

Hi,

I've received an email from googletables-feedback. They're looking into the problem now.

Let's be waiting...

Kuan Butts

unread,
May 13, 2015, 7:43:05 AM5/13/15
to google-api-jav...@googlegroups.com

Thanks.. I as well.

--

Alexander Ivanov

unread,
May 15, 2015, 2:31:13 AM5/15/15
to google-api-jav...@googlegroups.com
I think It's very fast for Google.

Seems the trouble solved.

    var setAccess = function setAccessF() {
        gapi
.client.request({
            path
: '/drive/v2/files/1gwmueWpy3M-GcgNOtP2JSFiUWkC1_gtVr83KRVOJ/permissions',
            method
: 'post',
            body
: {
               
'value' : 'anyone',
               
'type' : 'anyone',
               
'role' : 'reader'
           
}
       
}).then(opt_onFulfilled, opt_onRejected);
   
}


   
function opt_onRejected(e) {
        console
.log(e)
   
}
   
function opt_onFulfilled(e) {
        console
.log(e)
   
}

Cheers!

Kuan Butts

unread,
May 15, 2015, 8:22:13 AM5/15/15
to google-api-jav...@googlegroups.com

Awesome I will check it out today!

--
Reply all
Reply to author
Forward
0 new messages