Example of creating a folder using the Google Drive REST API in javascript.
let createFolderOptions = {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
mimeType: "application/vnd.google-apps.folder",
name: "My new google drive folder!",
}),
};
const response = await fetch("https://www.googleapis.com/drive/v3/files", createFolderOptions);
const json = await response.json();
For other Google Drive API Examples: https://www.mikesallese.me/tags/google-drive-api-examples