curl --request POST \
--url https://app.teable.ai/api/base/import-google-sheet/analyze \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"integrationId":"string","accessToken":"string","spreadsheetId":"string","includeSampleRows":true}'const url = 'https://app.teable.ai/api/base/import-google-sheet/analyze';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"integrationId":"string","accessToken":"string","spreadsheetId":"string","includeSampleRows":true}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}const http = require('https');
const options = {
method: 'POST',
hostname: 'app.teable.ai',
port: null,
path: '/api/base/import-google-sheet/analyze',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
integrationId: 'string',
accessToken: 'string',
spreadsheetId: 'string',
includeSampleRows: true
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"integrationId\":\"string\",\"accessToken\":\"string\",\"spreadsheetId\":\"string\",\"includeSampleRows\":true}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("POST", "/api/base/import-google-sheet/analyze", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teable.ai/api/base/import-google-sheet/analyze",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'spreadsheetId' => '<string>',
'integrationId' => '<string>',
'accessToken' => '<string>',
'includeSampleRows' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.teable.ai/api/base/import-google-sheet/analyze"
payload := strings.NewReader("{\n \"spreadsheetId\": \"<string>\",\n \"integrationId\": \"<string>\",\n \"accessToken\": \"<string>\",\n \"includeSampleRows\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.teable.ai/api/base/import-google-sheet/analyze")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spreadsheetId\": \"<string>\",\n \"integrationId\": \"<string>\",\n \"accessToken\": \"<string>\",\n \"includeSampleRows\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/base/import-google-sheet/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"spreadsheetId\": \"<string>\",\n \"integrationId\": \"<string>\",\n \"accessToken\": \"<string>\",\n \"includeSampleRows\": true\n}"
response = http.request(request)
puts response.read_body{
"spreadsheet": {
"id": "<string>",
"title": "<string>",
"sheets": [
{
"sheetId": 123,
"title": "<string>",
"rowCount": 123,
"columnCount": 123,
"sampleRows": [
[
"<string>"
]
]
}
]
}
}Analyze Google Sheets import source
List the tabs (worksheets) of a picked Google spreadsheet before import
curl --request POST \
--url https://app.teable.ai/api/base/import-google-sheet/analyze \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"integrationId":"string","accessToken":"string","spreadsheetId":"string","includeSampleRows":true}'const url = 'https://app.teable.ai/api/base/import-google-sheet/analyze';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"integrationId":"string","accessToken":"string","spreadsheetId":"string","includeSampleRows":true}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}const http = require('https');
const options = {
method: 'POST',
hostname: 'app.teable.ai',
port: null,
path: '/api/base/import-google-sheet/analyze',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
integrationId: 'string',
accessToken: 'string',
spreadsheetId: 'string',
includeSampleRows: true
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"integrationId\":\"string\",\"accessToken\":\"string\",\"spreadsheetId\":\"string\",\"includeSampleRows\":true}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("POST", "/api/base/import-google-sheet/analyze", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teable.ai/api/base/import-google-sheet/analyze",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'spreadsheetId' => '<string>',
'integrationId' => '<string>',
'accessToken' => '<string>',
'includeSampleRows' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.teable.ai/api/base/import-google-sheet/analyze"
payload := strings.NewReader("{\n \"spreadsheetId\": \"<string>\",\n \"integrationId\": \"<string>\",\n \"accessToken\": \"<string>\",\n \"includeSampleRows\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.teable.ai/api/base/import-google-sheet/analyze")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spreadsheetId\": \"<string>\",\n \"integrationId\": \"<string>\",\n \"accessToken\": \"<string>\",\n \"includeSampleRows\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/base/import-google-sheet/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"spreadsheetId\": \"<string>\",\n \"integrationId\": \"<string>\",\n \"accessToken\": \"<string>\",\n \"includeSampleRows\": true\n}"
response = http.request(request)
puts response.read_body{
"spreadsheet": {
"id": "<string>",
"title": "<string>",
"sheets": [
{
"sheetId": 123,
"title": "<string>",
"rowCount": 123,
"columnCount": 123,
"sampleRows": [
[
"<string>"
]
]
}
]
}
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Google Drive file id of the spreadsheet, as returned by the Google Picker. The OAuth grant only covers files the user picked (drive.file scope).
1Id of a connected Google Sheets user integration; its access token is resolved (and refreshed) server-side and never leaves the server for API calls.
Raw Google OAuth access token with the drive.file scope (never persisted by the server). Ignored when integrationId is provided.
1Also return each tab's first few rows as cell texts (one extra Sheets API request). Off by default: callers that only list tabs should not pay for it.
Antwort
Returns the spreadsheet title and its tabs with grid sizes.
Show child attributes
Show child attributes
War diese Seite hilfreich?

