Upload one multipart workspace file directly to Google Drive
curl --request POST \
--url http://api.den.local/v1/direct-uploads/google-workspace/drive-filesimport requests
url = "http://api.den.local/v1/direct-uploads/google-workspace/drive-files"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('http://api.den.local/v1/direct-uploads/google-workspace/drive-files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://api.den.local/v1/direct-uploads/google-workspace/drive-files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api.den.local/v1/direct-uploads/google-workspace/drive-files"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://api.den.local/v1/direct-uploads/google-workspace/drive-files")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.den.local/v1/direct-uploads/google-workspace/drive-files")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"ok": true,
"file": {
"id": "<string>",
"name": "<string>",
"mimeType": "<string>",
"modifiedTime": "<string>",
"webViewLink": "<string>",
"size": "<string>"
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "unauthorized"
}{
"error": "needs_connection",
"message": "<string>"
}{
"error": "google_api_error",
"message": "<string>"
}Direct uploads
Upload one multipart workspace file directly to Google Drive
Authenticated host transport for openwork-cloud-uploads. The route immediately forwards the file to Google and does not persist it or expose its bytes to the model.
POST
/
v1
/
direct-uploads
/
google-workspace
/
drive-files
Upload one multipart workspace file directly to Google Drive
curl --request POST \
--url http://api.den.local/v1/direct-uploads/google-workspace/drive-filesimport requests
url = "http://api.den.local/v1/direct-uploads/google-workspace/drive-files"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('http://api.den.local/v1/direct-uploads/google-workspace/drive-files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://api.den.local/v1/direct-uploads/google-workspace/drive-files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api.den.local/v1/direct-uploads/google-workspace/drive-files"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://api.den.local/v1/direct-uploads/google-workspace/drive-files")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.den.local/v1/direct-uploads/google-workspace/drive-files")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"ok": true,
"file": {
"id": "<string>",
"name": "<string>",
"mimeType": "<string>",
"modifiedTime": "<string>",
"webViewLink": "<string>",
"size": "<string>"
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "unauthorized"
}{
"error": "needs_connection",
"message": "<string>"
}{
"error": "google_api_error",
"message": "<string>"
}Was this page helpful?
⌘I