I am not sure what I am doing wrong here. The code below shows I am requesting to create a subfolder under a specific parent ID... yet the folder gets created in the root of the drive instead. Any help immensely appreciated!
def _makeFolder(service, folderName, parentId): _fileMetadata = { 'name' : folderName, 'mimeType' : CONST_MIME_FOLDER, 'parents' : parentId } _newFolderId = service.files().create(body=_fileMetadata, fields='id').execute() return(_newFolderId.get('id'))
score:1
You should add list to the parents field:
'parents' : [parentId]
Credit To: stackoverflow.com
Related Query
- google-drive api: creation of subfolder under root instead of the parent folder ID provided
- Is there any way to list only files that are on root folder or any level under it on Google Drive API with one request?
- Python Google Drive API - Get the ID of the My Drive folder
- Is there a way to rename the root of my drive in google collab
- Google API is not creating any document in the drive when I'm trying to create a blank document using python
- Python Script Creating Binary File Instead of Folder in Google Drive
- I am trying to figure out how to use the google drive api along with python to update file permissions as well as ownership
- Google Drive API Cannot See Files in Shared Folder
- AWS Lambda : OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k - While using Google Custom Search API
- List of files in a google drive folder with python
- Google Drive API v3 Change File Permissions and Get Publicly Shareable Link (Python)
- Create an event with conference using python and Google Calendar API creates the event but not the conference
- How to iterate over and download each image in an image collection from the Google Earth Engine python api
- Moving Folder from Google Colab to Google Drive
- How to call a specific sheet within a spreadsheet via the Google Sheets API v4 in Python
- Use the google transliterate api in python
- How do I initialize the parent class using a class method instead of calling the constructor?
- Google Drive API Python Service Account Example
- How to download a google drive folder using link in linux
- Writing figure to Google Cloud Storage instead of local drive
- Google Drive API Delete Python
- Filter same tag images and save another folder at google drive using google colaboratory
- Python logger in the hierarchy under root and over my project loggers?
- Is there anyway you can check what API calls is the Azure CLI doing under the hood?
- 404 error when accessing a shared drive via Google Drive API
- How can i download the files inside a folder on google cloud platform using python?
- Google Drive File Stream files creation date
- google Drive api v3 file upload errors
- Google Drive API read access not granted
- Upload File From Colab to Google Drive Folder
- googleapiclient.errors.HttpError with google drive v3 api upload error
- How to read a file inside the Dropbox folder using Python Dropbox API v2?
- Access Google Drive API in Python whithout google-api-python-client (installed app)
- Python- How to upload files to one folder using Google Drive API?
- Create a folder google drive in specific path
- Python - Can not download file from Google Drive using Google Drive API
- How can I include the parent folder structure on a library distribution in Python 3.6 using setuptools?
- Retrieve Google results without using the Custom Search API
- How to import the google api client into python so that it runs with as a cronjob?
- Cannot Interact with Shared Drives & Files | Python Google Drive API v3
- how to search the files inside the folders on Google Drive using Python
- How to save downloaded data from Google Drive in file - Python Drive API
- Changing name of the file to parent folder name
- How to create and show a folder in google drive using python script?
- Download Zoom Recordings to Local Machine and use Resumable Upload Method to upload the video to Google Drive
- automatic creation of folder from the file name
- The Python script for updating rules in the Cloud Armor in Google Cloud Platform by REST API
- Upload large file not working - Google Drive Python API
- Retreiving the child projects and updating the parent for the selected projects in Rally using API
- How to set folder path when downloading from google drive
More Query from same tag
- Multiprocessing not working while plotting
- python regex to remove extra characters from papers' doi
- How to set python3.8 as the python path for the RobotFramework in Eclipse preference?
- Flask url_for not passing parameters
- Algorithm : how to split list data into fixed size sub-lists without having separate numbers
- How do I select text in span tag located inside a div tag using BeautifulSoup3?
- How to prevent a blank space while removing \r\n using .rstrip()
- Check if at least one value in a list is not a certain value
- How can I add a filled rectangle outside the boundary of the plot in place of the legend?
- How to check if string is valid python code (runtime error)
- Test the Strength of a Password in Python
- How to hash a variable in Python?
- LCM calculation code in python outputs wrong value for very hugh inputs
- How can I show the guessed letters of a word guesser in order? Python
- python numba fingerprint error
- ProcessPoolExecutor gets stuck, ThreadPool Executor does not
- How to fix the heatmap plotted in python which seems way off from the scatterplot
- python3 request body with variable
- sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: items
- Why doesn't downloading text file work correctly?
- wexpect equivalent for logging
- Function calls with different api input parameters returning the same output everytime, Flask api
- How to use data from threads?
- Python 3 - Assert a boolean.
- why is 2 printed as a prime when if statement says it should not be
- Python 3: write string list to csv file
- Trying to install cProfile with pip and I'm getting an error
- what is the best way to add a column to a large data set on a csv file using python?
- How do I get a fill to overlap a line using matplotlib?
- How to request a JSON response from C3.ai COVID-19 API's?
- Python start multiprocessing without print/logging statements from processes
- How to get selected columns from SelectKBest() if ColumnTransformer transformer has not get_feature_names attribute?
- Training multiple Sequential models in a row slows down
- regex for catching abbreviations
- No module named pyVim