I am trying to get the ID of a file that I have created because I want to move it to a different folder. This is my current code attempting to get the ID:
@app.route('/gdocs/movetofolder', methods=['GET', 'POST'])
def move_doc():
drive_id = google_drive.build_drive_api_v3()
file_id = drive_id.files().get(fileId='My Test Doc').execute()
print(type(file_id))
print(file_id[id])
return file_id
where
def build_drive_api_v3():
credentials = build_credentials()
return googleapiclient.discovery.build('drive', 'v3', credentials=credentials).files()
The credential getting is not the problem as I have another function that uses the credentials to upload files. Running the flask server and navigating to the correct URL gives me an AttributeError: 'Resource' object has no attribute 'files'. Any help? The code is repurposed from here ( the highest answer). Any help?