Can Postman or HTTP requests be used to generate a new directory in Google Drive?

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.

I’ve tried different approaches:

  1. Using form data (default)
  2. Switching to form-urlencoded
  3. Sending a raw JSON body

Here’s what the JSON looks like:

{
  "folderName": "NewFolder",
  "folderType": "application/vnd.google-apps.folder"
}

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:

{
  "name": "NewFolder",
  "mimeType": "application/vnd.google-apps.folder"
}

Make sure your request is a POST to ‘https://www.googleapis.com/drive/v3/files’ and set the Content-Type header to ‘application/json’.

Also, don’t forget to include your OAuth 2.0 token in the Authorization header.

If you’re still having trouble, double-check your API permissions. You might need to enable the Drive API in your Google Cloud Console.

Hope this helps you out! Let me know if you need any more details.

yo, i’ve done this before. it’s totally possible with postman. use a POST request to ‘https://www.googleapis.com/drive/v3/files’ and send this JSON:

{
“name”: “WhateverFolderName”,
“mimeType”: “application/vnd.google-apps.folder”
}

don’t forget ur auth token. if it still doesn’t work, check ur API permissions in google cloud console. good luck!

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:

{
“name”: “YourFolderName”,
“mimeType”: “application/vnd.google-apps.folder”
}

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.