0

I want to transfer one user's files to another user's drive using admin SDK. I read the documentation for data transfer API. To access this API with proper scopes, I need to use the python client for google. I took a look at the available samples but couldn't find anything for the data transfer API specifically.

service = build('admin', 'directory_v1', credentials=creds)
transferService = service.transfers()

AttributeError: 'Resource' object has no attribute 'transfers'

and service = build('transfers', 'v1', credentials=creds) doesn't work either as apparently 'transfers' is not the name of any API. Can someone please help me getting started with the data transfer API?

Thank you

musical_ant
  • 143
  • 2
  • 7

1 Answers1

1

The service directory_v1 indeed doesn't have a transfers() method.

According to the Guides section from the API mentioned, the correct python service would be datatransfer_v1.

Modifying the sample code provided:

service = build('admin', 'datatransfer_v1', credentials=creds)
transferService = service.transfers()

You may want to refer to Google APIs client for python documentation for this service here.

Gustavo
  • 639
  • 2
  • 4