I’ve been trying to make a new folder in Google Drive using Postman. I’m using Google’s Postman Collection and the ‘Create folder’ request. It’s a POST request to the Drive API. But it’s not working as expected.
But none of these methods create a folder. The API just uploads the text as a file instead.
The official docs only show examples in Python, Java, and Node. So I’m wondering if it’s even possible to do this with Postman or direct HTTP requests?
Has anyone managed to create a Google Drive folder this way? Any tips or tricks would be really helpful. Thanks!
I’ve actually tackled this issue before, and yes, it’s definitely possible to create a folder in Google Drive using Postman or direct HTTP requests. The key is in the request body format.
Instead of using form data or form-urlencoded, you need to send a raw JSON body. However, your JSON structure is slightly off. Here’s what worked for me:
I’ve successfully created folders in Google Drive using HTTP requests, so it’s definitely doable. The key is to use the correct endpoint and payload structure. Make sure you’re sending a POST request to ‘https://www.googleapis.com/drive/v3/files’ with a JSON body like this:
Don’t forget to set the ‘Content-Type’ header to ‘application/json’ and include your OAuth 2.0 token in the ‘Authorization’ header. If you’re still having issues, check your API permissions in the Google Cloud Console. Sometimes, it’s a matter of enabling the right scopes for your application.