I working on a google drive project but I am not able to send search parameters with Axios to google API from frontend react
can any explain to me how to write queries like in google drive api url
Axios request look like that
axios.get('https://www.googleapis.com/drive/v3/files?access_token='+accessToken+'&q=mimeType%3D%22application%2Fvnd.google-apps.folder%22').then(res=>{
console.log(res)
setFolders(res.data.files)
}).then(err=>{
console.log(err)
})
Thanks in advance :)
Axios is not your problem the API does not support what you are trying to do for the most part.
Search all files and folders by date
You cant really. Download them all and search locally
Find a file by size
You cant. Download them all and search locally
Find all empty folders
Its not easy and will be a lot of requests but. You could use q to only get folders and then make separate requests using parents and then see if there are any files returned.
Find a file by type such as ppt, image, etc
Us the q parameter and search by mime type you will just need to google the correct mime type for the file you are looking for.
mimeType='application/vnd.ms-powerpoint'
You should have a look at the Search terms refrence documentation it will show you wnat you can search on.