curl --request PATCH \
--url https://app.teable.ai/api/table/%7BtableId%7D/selection/clear \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"viewId":"viwXXXXXXX","ignoreViewQuery":"string","filterByTql":"{field} = '\''Completed'\'' AND {field} > 5","filter":{},"search":["searchValue","fieldIdOrName",false],"filterLinkCellCandidate":["fldXXXXXXX","recXXXXXXX"],"filterLinkCellSelected":["fldXXXXXXX","recXXXXXXX"],"selectedRecordIds":["string"],"orderBy":[],"groupBy":[{"fieldId":"string","order":"asc"}],"collapsedGroupIds":["string"],"queryId":"qry_xxxxxxxx","projection":["string"],"ranges":[[0,0],[1,1]],"type":"columns"}'const url = 'https://app.teable.ai/api/table/%7BtableId%7D/selection/clear';
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"viewId":"viwXXXXXXX","ignoreViewQuery":"string","filterByTql":"{field} = \'Completed\' AND {field} > 5","filter":{},"search":["searchValue","fieldIdOrName",false],"filterLinkCellCandidate":["fldXXXXXXX","recXXXXXXX"],"filterLinkCellSelected":["fldXXXXXXX","recXXXXXXX"],"selectedRecordIds":["string"],"orderBy":[],"groupBy":[{"fieldId":"string","order":"asc"}],"collapsedGroupIds":["string"],"queryId":"qry_xxxxxxxx","projection":["string"],"ranges":[[0,0],[1,1]],"type":"columns"}'
};
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: 'PATCH',
hostname: 'app.teable.ai',
port: null,
path: '/api/table/%7BtableId%7D/selection/clear',
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({
viewId: 'viwXXXXXXX',
ignoreViewQuery: 'string',
filterByTql: '{field} = \'Completed\' AND {field} > 5',
filter: {},
search: ['searchValue', 'fieldIdOrName', false],
filterLinkCellCandidate: ['fldXXXXXXX', 'recXXXXXXX'],
filterLinkCellSelected: ['fldXXXXXXX', 'recXXXXXXX'],
selectedRecordIds: ['string'],
orderBy: [],
groupBy: [{fieldId: 'string', order: 'asc'}],
collapsedGroupIds: ['string'],
queryId: 'qry_xxxxxxxx',
projection: ['string'],
ranges: [[0, 0], [1, 1]],
type: 'columns'
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"viewId\":\"viwXXXXXXX\",\"ignoreViewQuery\":\"string\",\"filterByTql\":\"{field} = 'Completed' AND {field} > 5\",\"filter\":{},\"search\":[\"searchValue\",\"fieldIdOrName\",false],\"filterLinkCellCandidate\":[\"fldXXXXXXX\",\"recXXXXXXX\"],\"filterLinkCellSelected\":[\"fldXXXXXXX\",\"recXXXXXXX\"],\"selectedRecordIds\":[\"string\"],\"orderBy\":[],\"groupBy\":[{\"fieldId\":\"string\",\"order\":\"asc\"}],\"collapsedGroupIds\":[\"string\"],\"queryId\":\"qry_xxxxxxxx\",\"projection\":[\"string\"],\"ranges\":[[0,0],[1,1]],\"type\":\"columns\"}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("PATCH", "/api/table/%7BtableId%7D/selection/clear", 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}/selection/clear",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ranges' => [
[
0,
0
],
[
1,
1
]
],
'viewId' => 'viwXXXXXXX',
'ignoreViewQuery' => '<string>',
'filterByTql' => '{field} = \'Completed\' AND {field} > 5',
'filter' => [
],
'search' => [
'searchValue',
'fieldIdOrName',
false
],
'filterLinkCellCandidate' => [
'fldXXXXXXX',
'recXXXXXXX'
],
'filterLinkCellSelected' => [
'fldXXXXXXX',
'recXXXXXXX'
],
'selectedRecordIds' => [
'<string>'
],
'orderBy' => '<array>',
'groupBy' => [
[
'fieldId' => '<string>'
]
],
'collapsedGroupIds' => [
'<string>'
],
'queryId' => 'qry_xxxxxxxx',
'projection' => [
'<string>'
],
'type' => 'columns'
]),
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}/selection/clear"
payload := strings.NewReader("{\n \"ranges\": [\n [\n 0,\n 0\n ],\n [\n 1,\n 1\n ]\n ],\n \"viewId\": \"viwXXXXXXX\",\n \"ignoreViewQuery\": \"<string>\",\n \"filterByTql\": \"{field} = 'Completed' AND {field} > 5\",\n \"filter\": {},\n \"search\": [\n \"searchValue\",\n \"fieldIdOrName\",\n false\n ],\n \"filterLinkCellCandidate\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"filterLinkCellSelected\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"selectedRecordIds\": [\n \"<string>\"\n ],\n \"orderBy\": \"<array>\",\n \"groupBy\": [\n {\n \"fieldId\": \"<string>\"\n }\n ],\n \"collapsedGroupIds\": [\n \"<string>\"\n ],\n \"queryId\": \"qry_xxxxxxxx\",\n \"projection\": [\n \"<string>\"\n ],\n \"type\": \"columns\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.teable.ai/api/table/{tableId}/selection/clear")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ranges\": [\n [\n 0,\n 0\n ],\n [\n 1,\n 1\n ]\n ],\n \"viewId\": \"viwXXXXXXX\",\n \"ignoreViewQuery\": \"<string>\",\n \"filterByTql\": \"{field} = 'Completed' AND {field} > 5\",\n \"filter\": {},\n \"search\": [\n \"searchValue\",\n \"fieldIdOrName\",\n false\n ],\n \"filterLinkCellCandidate\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"filterLinkCellSelected\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"selectedRecordIds\": [\n \"<string>\"\n ],\n \"orderBy\": \"<array>\",\n \"groupBy\": [\n {\n \"fieldId\": \"<string>\"\n }\n ],\n \"collapsedGroupIds\": [\n \"<string>\"\n ],\n \"queryId\": \"qry_xxxxxxxx\",\n \"projection\": [\n \"<string>\"\n ],\n \"type\": \"columns\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/selection/clear")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ranges\": [\n [\n 0,\n 0\n ],\n [\n 1,\n 1\n ]\n ],\n \"viewId\": \"viwXXXXXXX\",\n \"ignoreViewQuery\": \"<string>\",\n \"filterByTql\": \"{field} = 'Completed' AND {field} > 5\",\n \"filter\": {},\n \"search\": [\n \"searchValue\",\n \"fieldIdOrName\",\n false\n ],\n \"filterLinkCellCandidate\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"filterLinkCellSelected\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"selectedRecordIds\": [\n \"<string>\"\n ],\n \"orderBy\": \"<array>\",\n \"groupBy\": [\n {\n \"fieldId\": \"<string>\"\n }\n ],\n \"collapsedGroupIds\": [\n \"<string>\"\n ],\n \"queryId\": \"qry_xxxxxxxx\",\n \"projection\": [\n \"<string>\"\n ],\n \"type\": \"columns\"\n}"
response = http.request(request)
puts response.read_bodyClear selected range content
Remove all content from the selected table range
curl --request PATCH \
--url https://app.teable.ai/api/table/%7BtableId%7D/selection/clear \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"viewId":"viwXXXXXXX","ignoreViewQuery":"string","filterByTql":"{field} = '\''Completed'\'' AND {field} > 5","filter":{},"search":["searchValue","fieldIdOrName",false],"filterLinkCellCandidate":["fldXXXXXXX","recXXXXXXX"],"filterLinkCellSelected":["fldXXXXXXX","recXXXXXXX"],"selectedRecordIds":["string"],"orderBy":[],"groupBy":[{"fieldId":"string","order":"asc"}],"collapsedGroupIds":["string"],"queryId":"qry_xxxxxxxx","projection":["string"],"ranges":[[0,0],[1,1]],"type":"columns"}'const url = 'https://app.teable.ai/api/table/%7BtableId%7D/selection/clear';
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"viewId":"viwXXXXXXX","ignoreViewQuery":"string","filterByTql":"{field} = \'Completed\' AND {field} > 5","filter":{},"search":["searchValue","fieldIdOrName",false],"filterLinkCellCandidate":["fldXXXXXXX","recXXXXXXX"],"filterLinkCellSelected":["fldXXXXXXX","recXXXXXXX"],"selectedRecordIds":["string"],"orderBy":[],"groupBy":[{"fieldId":"string","order":"asc"}],"collapsedGroupIds":["string"],"queryId":"qry_xxxxxxxx","projection":["string"],"ranges":[[0,0],[1,1]],"type":"columns"}'
};
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: 'PATCH',
hostname: 'app.teable.ai',
port: null,
path: '/api/table/%7BtableId%7D/selection/clear',
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({
viewId: 'viwXXXXXXX',
ignoreViewQuery: 'string',
filterByTql: '{field} = \'Completed\' AND {field} > 5',
filter: {},
search: ['searchValue', 'fieldIdOrName', false],
filterLinkCellCandidate: ['fldXXXXXXX', 'recXXXXXXX'],
filterLinkCellSelected: ['fldXXXXXXX', 'recXXXXXXX'],
selectedRecordIds: ['string'],
orderBy: [],
groupBy: [{fieldId: 'string', order: 'asc'}],
collapsedGroupIds: ['string'],
queryId: 'qry_xxxxxxxx',
projection: ['string'],
ranges: [[0, 0], [1, 1]],
type: 'columns'
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"viewId\":\"viwXXXXXXX\",\"ignoreViewQuery\":\"string\",\"filterByTql\":\"{field} = 'Completed' AND {field} > 5\",\"filter\":{},\"search\":[\"searchValue\",\"fieldIdOrName\",false],\"filterLinkCellCandidate\":[\"fldXXXXXXX\",\"recXXXXXXX\"],\"filterLinkCellSelected\":[\"fldXXXXXXX\",\"recXXXXXXX\"],\"selectedRecordIds\":[\"string\"],\"orderBy\":[],\"groupBy\":[{\"fieldId\":\"string\",\"order\":\"asc\"}],\"collapsedGroupIds\":[\"string\"],\"queryId\":\"qry_xxxxxxxx\",\"projection\":[\"string\"],\"ranges\":[[0,0],[1,1]],\"type\":\"columns\"}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("PATCH", "/api/table/%7BtableId%7D/selection/clear", 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}/selection/clear",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ranges' => [
[
0,
0
],
[
1,
1
]
],
'viewId' => 'viwXXXXXXX',
'ignoreViewQuery' => '<string>',
'filterByTql' => '{field} = \'Completed\' AND {field} > 5',
'filter' => [
],
'search' => [
'searchValue',
'fieldIdOrName',
false
],
'filterLinkCellCandidate' => [
'fldXXXXXXX',
'recXXXXXXX'
],
'filterLinkCellSelected' => [
'fldXXXXXXX',
'recXXXXXXX'
],
'selectedRecordIds' => [
'<string>'
],
'orderBy' => '<array>',
'groupBy' => [
[
'fieldId' => '<string>'
]
],
'collapsedGroupIds' => [
'<string>'
],
'queryId' => 'qry_xxxxxxxx',
'projection' => [
'<string>'
],
'type' => 'columns'
]),
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}/selection/clear"
payload := strings.NewReader("{\n \"ranges\": [\n [\n 0,\n 0\n ],\n [\n 1,\n 1\n ]\n ],\n \"viewId\": \"viwXXXXXXX\",\n \"ignoreViewQuery\": \"<string>\",\n \"filterByTql\": \"{field} = 'Completed' AND {field} > 5\",\n \"filter\": {},\n \"search\": [\n \"searchValue\",\n \"fieldIdOrName\",\n false\n ],\n \"filterLinkCellCandidate\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"filterLinkCellSelected\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"selectedRecordIds\": [\n \"<string>\"\n ],\n \"orderBy\": \"<array>\",\n \"groupBy\": [\n {\n \"fieldId\": \"<string>\"\n }\n ],\n \"collapsedGroupIds\": [\n \"<string>\"\n ],\n \"queryId\": \"qry_xxxxxxxx\",\n \"projection\": [\n \"<string>\"\n ],\n \"type\": \"columns\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.teable.ai/api/table/{tableId}/selection/clear")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ranges\": [\n [\n 0,\n 0\n ],\n [\n 1,\n 1\n ]\n ],\n \"viewId\": \"viwXXXXXXX\",\n \"ignoreViewQuery\": \"<string>\",\n \"filterByTql\": \"{field} = 'Completed' AND {field} > 5\",\n \"filter\": {},\n \"search\": [\n \"searchValue\",\n \"fieldIdOrName\",\n false\n ],\n \"filterLinkCellCandidate\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"filterLinkCellSelected\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"selectedRecordIds\": [\n \"<string>\"\n ],\n \"orderBy\": \"<array>\",\n \"groupBy\": [\n {\n \"fieldId\": \"<string>\"\n }\n ],\n \"collapsedGroupIds\": [\n \"<string>\"\n ],\n \"queryId\": \"qry_xxxxxxxx\",\n \"projection\": [\n \"<string>\"\n ],\n \"type\": \"columns\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/selection/clear")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ranges\": [\n [\n 0,\n 0\n ],\n [\n 1,\n 1\n ]\n ],\n \"viewId\": \"viwXXXXXXX\",\n \"ignoreViewQuery\": \"<string>\",\n \"filterByTql\": \"{field} = 'Completed' AND {field} > 5\",\n \"filter\": {},\n \"search\": [\n \"searchValue\",\n \"fieldIdOrName\",\n false\n ],\n \"filterLinkCellCandidate\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"filterLinkCellSelected\": [\n \"fldXXXXXXX\",\n \"recXXXXXXX\"\n ],\n \"selectedRecordIds\": [\n \"<string>\"\n ],\n \"orderBy\": \"<array>\",\n \"groupBy\": [\n {\n \"fieldId\": \"<string>\"\n }\n ],\n \"collapsedGroupIds\": [\n \"<string>\"\n ],\n \"queryId\": \"qry_xxxxxxxx\",\n \"projection\": [\n \"<string>\"\n ],\n \"type\": \"columns\"\n}"
response = http.request(request)
puts response.read_body授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
请求体
The parameter "ranges" is used to represent the coordinates of a selected range in a table.
12 elements[[0, 0], [1, 1]]
Set the view you want to fetch, default is first view. result will filter and sort by view options.
"viwXXXXXXX"
When a viewId is specified, configure this to true will ignore the view's filter, sort, etc
"{field} = 'Completed' AND {field} > 5"
A filter object for complex query conditions based on fields, operators, and values. Use our visual query builder at https://app.teable.ai/developer/tool/query-builder to build filters.
Search for records that match the specified field and value
1 elementFilter out the records that can be selected by a given link cell from the relational table. For example, if the specified field is one to many or one to one relationship, recordId for which the field has already been selected will not appear.
2 elements["fldXXXXXXX", "recXXXXXXX"]
Filter out selected records based on this link cell from the relational table. Note that viewId, filter, and orderBy will not take effect in this case because selected records has it own order. Ignoring recordId gets all the selected records for the field
2 elements["fldXXXXXXX", "recXXXXXXX"]
Filter selected records by record ids
An array of sort objects that specifies how the records should be ordered.
Show child attributes
Show child attributes
When provided, other query parameters will be merged with the saved ones.
"qry_xxxxxxxx"
If you want to get only some fields, pass in this parameter, otherwise all visible fields will be obtained
Types of non-contiguous selections
rows, columns "columns"
响应
Successful clean up
此页面对您有帮助吗?

