curl --request PUT \
--url https://app.teable.ai/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"type":"singleSelect","name":"string","unique":true,"notNull":true,"dbFieldName":"string","isLookup":true,"isConditionalLookup":true,"description":"this is a summary","lookupOptions":{"foreignTableId":"string","lookupFieldId":"string","linkFieldId":"string","filter":{}},"options":{"expression":"countall({values})","timeZone":"string","formatting":null,"showAs":{"type":"url"}},"aiConfig":{"modelKey":"string","isAutoFill":true,"attachPrompt":"string","type":"extraction","sourceFieldId":"string"}}'const url = 'https://app.teable.ai/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan';
const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"type":"singleSelect","name":"string","unique":true,"notNull":true,"dbFieldName":"string","isLookup":true,"isConditionalLookup":true,"description":"this is a summary","lookupOptions":{"foreignTableId":"string","lookupFieldId":"string","linkFieldId":"string","filter":{}},"options":{"expression":"countall({values})","timeZone":"string","formatting":null,"showAs":{"type":"url"}},"aiConfig":{"modelKey":"string","isAutoFill":true,"attachPrompt":"string","type":"extraction","sourceFieldId":"string"}}'
};
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: 'PUT',
hostname: 'app.teable.ai',
port: null,
path: '/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan',
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({
type: 'singleSelect',
name: 'string',
unique: true,
notNull: true,
dbFieldName: 'string',
isLookup: true,
isConditionalLookup: true,
description: 'this is a summary',
lookupOptions: {
foreignTableId: 'string',
lookupFieldId: 'string',
linkFieldId: 'string',
filter: {}
},
options: {
expression: 'countall({values})',
timeZone: 'string',
formatting: null,
showAs: {type: 'url'}
},
aiConfig: {
modelKey: 'string',
isAutoFill: true,
attachPrompt: 'string',
type: 'extraction',
sourceFieldId: 'string'
}
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"type\":\"singleSelect\",\"name\":\"string\",\"unique\":true,\"notNull\":true,\"dbFieldName\":\"string\",\"isLookup\":true,\"isConditionalLookup\":true,\"description\":\"this is a summary\",\"lookupOptions\":{\"foreignTableId\":\"string\",\"lookupFieldId\":\"string\",\"linkFieldId\":\"string\",\"filter\":{}},\"options\":{\"expression\":\"countall({values})\",\"timeZone\":\"string\",\"formatting\":null,\"showAs\":{\"type\":\"url\"}},\"aiConfig\":{\"modelKey\":\"string\",\"isAutoFill\":true,\"attachPrompt\":\"string\",\"type\":\"extraction\",\"sourceFieldId\":\"string\"}}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("PUT", "/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan", 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/table/{tableId}/field/{fieldId}/plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'singleSelect',
'name' => '<string>',
'unique' => true,
'notNull' => true,
'dbFieldName' => '<string>',
'isLookup' => true,
'isConditionalLookup' => true,
'description' => 'this is a summary',
'lookupOptions' => [
'foreignTableId' => '<string>',
'lookupFieldId' => '<string>',
'linkFieldId' => '<string>',
'filter' => [
]
],
'options' => [
'timeZone' => '<string>',
'formatting' => '<unknown>',
'showAs' => [
]
],
'aiConfig' => [
'modelKey' => '<string>',
'type' => 'extraction',
'sourceFieldId' => '<string>',
'isAutoFill' => true,
'attachPrompt' => '<string>'
]
]),
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/table/{tableId}/field/{fieldId}/plan"
payload := strings.NewReader("{\n \"type\": \"singleSelect\",\n \"name\": \"<string>\",\n \"unique\": true,\n \"notNull\": true,\n \"dbFieldName\": \"<string>\",\n \"isLookup\": true,\n \"isConditionalLookup\": true,\n \"description\": \"this is a summary\",\n \"lookupOptions\": {\n \"foreignTableId\": \"<string>\",\n \"lookupFieldId\": \"<string>\",\n \"linkFieldId\": \"<string>\",\n \"filter\": {}\n },\n \"options\": {\n \"timeZone\": \"<string>\",\n \"formatting\": \"<unknown>\",\n \"showAs\": {}\n },\n \"aiConfig\": {\n \"modelKey\": \"<string>\",\n \"type\": \"extraction\",\n \"sourceFieldId\": \"<string>\",\n \"isAutoFill\": true,\n \"attachPrompt\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.teable.ai/api/table/{tableId}/field/{fieldId}/plan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"singleSelect\",\n \"name\": \"<string>\",\n \"unique\": true,\n \"notNull\": true,\n \"dbFieldName\": \"<string>\",\n \"isLookup\": true,\n \"isConditionalLookup\": true,\n \"description\": \"this is a summary\",\n \"lookupOptions\": {\n \"foreignTableId\": \"<string>\",\n \"lookupFieldId\": \"<string>\",\n \"linkFieldId\": \"<string>\",\n \"filter\": {}\n },\n \"options\": {\n \"timeZone\": \"<string>\",\n \"formatting\": \"<unknown>\",\n \"showAs\": {}\n },\n \"aiConfig\": {\n \"modelKey\": \"<string>\",\n \"type\": \"extraction\",\n \"sourceFieldId\": \"<string>\",\n \"isAutoFill\": true,\n \"attachPrompt\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/field/{fieldId}/plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"singleSelect\",\n \"name\": \"<string>\",\n \"unique\": true,\n \"notNull\": true,\n \"dbFieldName\": \"<string>\",\n \"isLookup\": true,\n \"isConditionalLookup\": true,\n \"description\": \"this is a summary\",\n \"lookupOptions\": {\n \"foreignTableId\": \"<string>\",\n \"lookupFieldId\": \"<string>\",\n \"linkFieldId\": \"<string>\",\n \"filter\": {}\n },\n \"options\": {\n \"timeZone\": \"<string>\",\n \"formatting\": \"<unknown>\",\n \"showAs\": {}\n },\n \"aiConfig\": {\n \"modelKey\": \"<string>\",\n \"type\": \"extraction\",\n \"sourceFieldId\": \"<string>\",\n \"isAutoFill\": true,\n \"attachPrompt\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"estimateTime": 123,
"graph": {
"nodes": [
{
"id": "<string>",
"label": "<string>",
"comboId": "<string>"
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"label": "<string>"
}
],
"combos": [
{
"id": "<string>",
"label": "<string>"
}
]
},
"updateCellCount": 123,
"linkFieldCount": 123,
"skip": true
}Put table field plan
Generate calculation plan for converting the field
curl --request PUT \
--url https://app.teable.ai/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"type":"singleSelect","name":"string","unique":true,"notNull":true,"dbFieldName":"string","isLookup":true,"isConditionalLookup":true,"description":"this is a summary","lookupOptions":{"foreignTableId":"string","lookupFieldId":"string","linkFieldId":"string","filter":{}},"options":{"expression":"countall({values})","timeZone":"string","formatting":null,"showAs":{"type":"url"}},"aiConfig":{"modelKey":"string","isAutoFill":true,"attachPrompt":"string","type":"extraction","sourceFieldId":"string"}}'const url = 'https://app.teable.ai/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan';
const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"type":"singleSelect","name":"string","unique":true,"notNull":true,"dbFieldName":"string","isLookup":true,"isConditionalLookup":true,"description":"this is a summary","lookupOptions":{"foreignTableId":"string","lookupFieldId":"string","linkFieldId":"string","filter":{}},"options":{"expression":"countall({values})","timeZone":"string","formatting":null,"showAs":{"type":"url"}},"aiConfig":{"modelKey":"string","isAutoFill":true,"attachPrompt":"string","type":"extraction","sourceFieldId":"string"}}'
};
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: 'PUT',
hostname: 'app.teable.ai',
port: null,
path: '/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan',
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({
type: 'singleSelect',
name: 'string',
unique: true,
notNull: true,
dbFieldName: 'string',
isLookup: true,
isConditionalLookup: true,
description: 'this is a summary',
lookupOptions: {
foreignTableId: 'string',
lookupFieldId: 'string',
linkFieldId: 'string',
filter: {}
},
options: {
expression: 'countall({values})',
timeZone: 'string',
formatting: null,
showAs: {type: 'url'}
},
aiConfig: {
modelKey: 'string',
isAutoFill: true,
attachPrompt: 'string',
type: 'extraction',
sourceFieldId: 'string'
}
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"type\":\"singleSelect\",\"name\":\"string\",\"unique\":true,\"notNull\":true,\"dbFieldName\":\"string\",\"isLookup\":true,\"isConditionalLookup\":true,\"description\":\"this is a summary\",\"lookupOptions\":{\"foreignTableId\":\"string\",\"lookupFieldId\":\"string\",\"linkFieldId\":\"string\",\"filter\":{}},\"options\":{\"expression\":\"countall({values})\",\"timeZone\":\"string\",\"formatting\":null,\"showAs\":{\"type\":\"url\"}},\"aiConfig\":{\"modelKey\":\"string\",\"isAutoFill\":true,\"attachPrompt\":\"string\",\"type\":\"extraction\",\"sourceFieldId\":\"string\"}}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("PUT", "/api/table/%7BtableId%7D/field/%7BfieldId%7D/plan", 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/table/{tableId}/field/{fieldId}/plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'singleSelect',
'name' => '<string>',
'unique' => true,
'notNull' => true,
'dbFieldName' => '<string>',
'isLookup' => true,
'isConditionalLookup' => true,
'description' => 'this is a summary',
'lookupOptions' => [
'foreignTableId' => '<string>',
'lookupFieldId' => '<string>',
'linkFieldId' => '<string>',
'filter' => [
]
],
'options' => [
'timeZone' => '<string>',
'formatting' => '<unknown>',
'showAs' => [
]
],
'aiConfig' => [
'modelKey' => '<string>',
'type' => 'extraction',
'sourceFieldId' => '<string>',
'isAutoFill' => true,
'attachPrompt' => '<string>'
]
]),
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/table/{tableId}/field/{fieldId}/plan"
payload := strings.NewReader("{\n \"type\": \"singleSelect\",\n \"name\": \"<string>\",\n \"unique\": true,\n \"notNull\": true,\n \"dbFieldName\": \"<string>\",\n \"isLookup\": true,\n \"isConditionalLookup\": true,\n \"description\": \"this is a summary\",\n \"lookupOptions\": {\n \"foreignTableId\": \"<string>\",\n \"lookupFieldId\": \"<string>\",\n \"linkFieldId\": \"<string>\",\n \"filter\": {}\n },\n \"options\": {\n \"timeZone\": \"<string>\",\n \"formatting\": \"<unknown>\",\n \"showAs\": {}\n },\n \"aiConfig\": {\n \"modelKey\": \"<string>\",\n \"type\": \"extraction\",\n \"sourceFieldId\": \"<string>\",\n \"isAutoFill\": true,\n \"attachPrompt\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.teable.ai/api/table/{tableId}/field/{fieldId}/plan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"singleSelect\",\n \"name\": \"<string>\",\n \"unique\": true,\n \"notNull\": true,\n \"dbFieldName\": \"<string>\",\n \"isLookup\": true,\n \"isConditionalLookup\": true,\n \"description\": \"this is a summary\",\n \"lookupOptions\": {\n \"foreignTableId\": \"<string>\",\n \"lookupFieldId\": \"<string>\",\n \"linkFieldId\": \"<string>\",\n \"filter\": {}\n },\n \"options\": {\n \"timeZone\": \"<string>\",\n \"formatting\": \"<unknown>\",\n \"showAs\": {}\n },\n \"aiConfig\": {\n \"modelKey\": \"<string>\",\n \"type\": \"extraction\",\n \"sourceFieldId\": \"<string>\",\n \"isAutoFill\": true,\n \"attachPrompt\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/field/{fieldId}/plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"singleSelect\",\n \"name\": \"<string>\",\n \"unique\": true,\n \"notNull\": true,\n \"dbFieldName\": \"<string>\",\n \"isLookup\": true,\n \"isConditionalLookup\": true,\n \"description\": \"this is a summary\",\n \"lookupOptions\": {\n \"foreignTableId\": \"<string>\",\n \"lookupFieldId\": \"<string>\",\n \"linkFieldId\": \"<string>\",\n \"filter\": {}\n },\n \"options\": {\n \"timeZone\": \"<string>\",\n \"formatting\": \"<unknown>\",\n \"showAs\": {}\n },\n \"aiConfig\": {\n \"modelKey\": \"<string>\",\n \"type\": \"extraction\",\n \"sourceFieldId\": \"<string>\",\n \"isAutoFill\": true,\n \"attachPrompt\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"estimateTime": 123,
"graph": {
"nodes": [
{
"id": "<string>",
"label": "<string>",
"comboId": "<string>"
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"label": "<string>"
}
],
"combos": [
{
"id": "<string>",
"label": "<string>"
}
]
},
"updateCellCount": 123,
"linkFieldCount": 123,
"skip": true
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
The field types supported by teable.
singleLineText, longText, user, attachment, checkbox, multipleSelect, singleSelect, date, number, rating, formula, rollup, conditionalRollup, link, createdTime, lastModifiedTime, createdBy, lastModifiedBy, autoNumber, button "singleSelect"
1Whether this field is not unique.
Whether this field is not null.
Field(column) name in backend database. Limitation: 1-63 characters, can only contain letters, numbers and underscore, case sensitive, cannot be duplicated with existing db field name in the table.
1^\w{0,63}$Whether this field is lookup field. witch means cellValue and [fieldType] is looked up from the linked table.
Whether this lookup field applies a conditional filter when resolving linked records.
The description of the field.
"this is a summary"
The lookup options for field, you need to configure it when isLookup attribute is true or field type is rollup.
- Option 1
- Option 2
Show child attributes
Show child attributes
The options of the field. The configuration of the field's options depend on the it's specific type.
Show child attributes
Show child attributes
The AI configuration of the field.
Show child attributes
Show child attributes
此页面对您有帮助吗?

