Library
Read Drive source connections and sync progress
Requires workspace_library_manage and manage_settings under the current role. Connections are owned by the connecting user; provider and current-role authority are rechecked around provider I/O. Lists organization connections, live shared roots, up to fifty actionable file issues, provider configuration and daily image-analysis capacity. analysis_progress is omitted outside the rollout.
GET
/
admin
/
workspace-library
/
drive
Read Drive source connections and sync progress
curl --request GET \
--url https://api.gratona.com/v1/admin/workspace-library/drive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gratona.com/v1/admin/workspace-library/drive"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gratona.com/v1/admin/workspace-library/drive', 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 => "https://api.gratona.com/v1/admin/workspace-library/drive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "https://api.gratona.com/v1/admin/workspace-library/drive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gratona.com/v1/admin/workspace-library/drive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-library/drive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"analysis_available": true,
"analysis_daily_limit": 123,
"provider_configured": true,
"configured": true,
"connections": [
{
"id": 123,
"name": "<string>",
"status": "<string>",
"owned": true,
"failure_code": "<string>"
}
],
"analysis_budget": {
"limit": 123,
"remaining": 123,
"resets_at": "2023-11-07T05:31:56Z"
},
"roots": [
{
"id": "<string>",
"connection_id": 123,
"label": "<string>",
"status": "<string>",
"last_synced_at": "2023-11-07T05:31:56Z",
"failure_code": "<string>",
"analysis_enabled": true,
"analysis_failure_code": "<string>",
"source_kind": "<string>",
"progress": {
"phase": "<string>",
"delayed": true,
"requested_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"can_retry": true,
"files": {
"discovered": 123,
"imported": 123,
"pending": 123,
"skipped": 123,
"failed": 123
}
},
"analysis_progress": {
"ready": 123,
"queued": 123,
"analyzing": 123,
"failed": 123,
"waiting": 123,
"removed": 123,
"paused": 123
}
}
],
"files": [
{
"id": "<string>",
"initial_title": "<string>",
"status": "<string>",
"failure_code": "<string>"
}
]
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}⌘I
Read Drive source connections and sync progress
curl --request GET \
--url https://api.gratona.com/v1/admin/workspace-library/drive \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gratona.com/v1/admin/workspace-library/drive"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gratona.com/v1/admin/workspace-library/drive', 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 => "https://api.gratona.com/v1/admin/workspace-library/drive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "https://api.gratona.com/v1/admin/workspace-library/drive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gratona.com/v1/admin/workspace-library/drive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-library/drive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"analysis_available": true,
"analysis_daily_limit": 123,
"provider_configured": true,
"configured": true,
"connections": [
{
"id": 123,
"name": "<string>",
"status": "<string>",
"owned": true,
"failure_code": "<string>"
}
],
"analysis_budget": {
"limit": 123,
"remaining": 123,
"resets_at": "2023-11-07T05:31:56Z"
},
"roots": [
{
"id": "<string>",
"connection_id": 123,
"label": "<string>",
"status": "<string>",
"last_synced_at": "2023-11-07T05:31:56Z",
"failure_code": "<string>",
"analysis_enabled": true,
"analysis_failure_code": "<string>",
"source_kind": "<string>",
"progress": {
"phase": "<string>",
"delayed": true,
"requested_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"can_retry": true,
"files": {
"discovered": 123,
"imported": 123,
"pending": 123,
"skipped": 123,
"failed": 123
}
},
"analysis_progress": {
"ready": 123,
"queued": 123,
"analyzing": 123,
"failed": 123,
"waiting": 123,
"removed": 123,
"paused": 123
}
}
],
"files": [
{
"id": "<string>",
"initial_title": "<string>",
"status": "<string>",
"failure_code": "<string>"
}
]
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}