Google 계정의 '도메인 관리자'이며 다음을 원합니다. 내 도메인의 모든 사용자와 '각 사용자'에 대해 사용자가 모든 사람의 파일을 읽음.. 나는 각 사용자를 얻을 수 있지만, 지금은 각 사용자 문서를 얻는 방법을 이해하지 못합니다.Google 드라이브 API를 사용하는 모든 사용자의 모든 파일을 가져 오는 방법
#!/usr/bin/python
import gdata.docs
import gdata.docs.service
from gdata.apps import client
userNameAtGmailCom = '[email protected]'
password = 'mypassword'
personToShareWith = "[email protected]"
domain = 'someplace.com'
def login(userNameAtGmailCom, password, personToShareWith, domain):
client = gdata.apps.client.AppsClient(domain=domain)
client.ssl = True
client.ClientLogin(email=userNameAtGmailCom, password=password, source='apps')
all_users = client.RetrieveAllUsers()
for user in all_users.entry:
user_name = user.login.user_name
print user_name
password = user.login.password
print password
clientDocs = gdata.docs.service.DocsService()
#password always returns 'none'
#therefore I've commented out the 'bad authentication'
#that would happen if the lines below ran
#clientDocs.ClientLogin(user_name, password)
#documents_feed = clientDocs.GetDocumentListFeed()
#for document_entry in documents_feed.entry:
#print document_entry.title.text
#scope = gdata.docs.Scope(value=personToShareWith, type='user')
#role = gdata.docs.Role(value='reader')
#acl_entry = gdata.docs.DocumentListAclEntry(scope=scope, role=role)
#created_acl_entry = client.Post(acl_entry, document_entry.GetAclLink().href, converter=gdata.docs.DocumentListAclEntryFromString)
login(userNameAtGmailCom, password, personToShareWith, domain)
을 https://developers.google.com/gdata/docs/auth/clientlogin – jjamesjohnson