Prepare a Google Drive session for host file transport
Changed onPrepare a Google Drive resumable upload session for an explicitly requested file upload. This does not upload bytes or prove completion. Clients with file transport can PUT local bytes directly to the returned secret uploadUrl, outside model context. With fileId the upload replaces that file's content as a new Drive version; with convertTo a new Office file becomes a native Google file. Google sessions can remain valid for up to one week; they are not short-lived signed URLs. Do not automatically create another session after an uncertain result. Final PUT returns file metadata, including headRevisionId and md5Checksum for later replaces. Uses the selected connection.
Request
- Base URLhttps://api.openworklabs.com
- Auth
- API key in header x-api-key
- or HTTP bearer
Request body
File basename; no file bytes or local paths. Ignored when replacing a file.
Exact file size in bytes, up to Google's 5 TiB limit.
Replace this existing file's content instead of creating a file. It keeps its ID, link, sharing and comments; the previous version stays in Drive's version history for 30 days.
Required with fileId: the revision your copy was downloaded from. Refused with drive_conflict when Drive changed since; download the newer version and reapply the edits, or save a new file.
New files only: save the uploaded Office file as this native Google Docs, Sheets or Slides type.
Response
Secret upload session for host transport.
Secret bearer upload-session URL. Never print, share, persist, or log it. Only upload the authorized file; no Google access token is needed.
Present when the upload replaces an existing file's content.
Changes
- breaking
the response property
currentRevisionbecame nullable for the status - breaking
the response property
modifiedTimebecame nullable for the status - breaking
the response property
replaces/previousRevisionbecame nullable for the status
4 more changes in this revision
- breaking