Drive API
Base path: https://developerapi.motaware.com/drive/v1
Scopes: drive.read for the GET routes, drive.write for everything else (it also allows reads).
The person's Motaware plan must include Drive, otherwise the answer is 403 entitlement.app_unavailable.
On a lapsed plan reads and downloads keep working and changes get 403.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /folders | Top-level folders |
| POST | /folders | Create a folder: { "name", "parentId"? } |
| GET | /folders/{id} | A folder with its subfolders, files and breadcrumb |
| PATCH | /folders/{id} | Rename, move or star: { "name"?, "parentId"?, "moveToRoot"?, "isStarred"? } |
| DELETE | /folders/{id} | Move a folder to the trash |
| POST | /folders/{id}/restore | Restore a folder from the trash |
| GET | /files | Files in a folder (folderId; none = top level), paged |
| GET | /files/recent?count=30 | Recently used files |
| GET | /files/starred | Starred files and folders |
| POST | /files/upload | Upload a file (multipart, up to 1 GB) |
| GET | /files/{id} | One file with details |
| PATCH | /files/{id} | Rename, move, describe or star: { "name"?, "folderId"?, "moveToRoot"?, "description"?, "isStarred"? } |
| DELETE | /files/{id} | Move a file to the trash |
| POST | /files/{id}/restore | Restore a file from the trash |
| GET | /files/{id}/download | A short-lived download link |
| GET | /search?q=&type= | Search names; type one of images, videos, audio, pdfs, documents, archives, folders |
| GET | /trash | Items in the trash |
| GET | /storage | Storage used and quota, by file type |
Folders and files
There's no root folder object: the top level is folderId / parentId null. To move to the top level, send {"moveToRoot": true}.
DELETE moves items to the trash; restore them with /restore.
Folder fields: id, name, parentId, ownerName, fileCount, subFolderCount, permission,
isStarred, createdAt, updatedAt, deletedAt.
File fields: id, name, mimeType, sizeBytes, ownerName, folderId, folderName,
description, isStarred, status, permission, canDownload, createdAt, updatedAt,
lastAccessedAt, deletedAt; the detail adds versionCount, commentCount, shareCount, folderPath, tags.
GET /files takes pageNumber, pageSize (default 20), sortBy and sortDescending. Folder contents, search, trash, recent and starred return everything.
Uploading
Send multipart/form-data with the file in file and optionally folderId, relativePath (creates the folders in it)
and conflict: keepboth (default) or replace (adds a new version of a file with the same name). One request, up to 1 GB.
Every upload is virus-scanned before it's stored, which can take a while for large files. Possible refusals:
413 over the plan's storage quota, 422 the file is infected, 503 the scanner is unavailable (try again later).
Downloading
GET /files/{id}/download returns { url, inline, previewKind, expiresAt }. url is an absolute
https://drive.motaware.com/… link that works without credentials for about 15 minutes and supports Range requests.
Fetch it right away and don't store or share it.
Examples
curl -X POST https://developerapi.motaware.com/drive/v1/files/upload \
-H "Authorization: Bearer $MOTAWARE_API_KEY" \
-F "file=@report.pdf" -F "folderId={folderId}"
curl https://developerapi.motaware.com/drive/v1/files/{id}/download \
-H "Authorization: Bearer $MOTAWARE_API_KEY"
Not available yet
Sharing and public links, comments, versions, tags, copying, zip downloads, permanent deletion and emptying the trash.