curl --request POST \
--url https://app.teable.ai/api/table/%7BtableId%7D/record \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"fieldKeyType":"id","typecast":true,"order":{"viewId":"string","anchorId":"string","position":"before"},"records":[{"fields":{"single line text":"text value"}}]}'const url = 'https://app.teable.ai/api/table/%7BtableId%7D/record';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"fieldKeyType":"id","typecast":true,"order":{"viewId":"string","anchorId":"string","position":"before"},"records":[{"fields":{"single line text":"text value"}}]}'
};
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/table/%7BtableId%7D/record',
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({
fieldKeyType: 'id',
typecast: true,
order: {viewId: 'string', anchorId: 'string', position: 'before'},
records: [{fields: {'single line text': 'text value'}}]
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"fieldKeyType\":\"id\",\"typecast\":true,\"order\":{\"viewId\":\"string\",\"anchorId\":\"string\",\"position\":\"before\"},\"records\":[{\"fields\":{\"single line text\":\"text value\"}}]}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("POST", "/api/table/%7BtableId%7D/record", 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}/record",
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([
'records' => [
[
'fields' => [
'single line text' => 'text value'
]
]
],
'fieldKeyType' => 'name',
'typecast' => 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/table/{tableId}/record"
payload := strings.NewReader("{\n \"records\": [\n {\n \"fields\": {\n \"single line text\": \"text value\"\n }\n }\n ],\n \"fieldKeyType\": \"name\",\n \"typecast\": 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/table/{tableId}/record")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"records\": [\n {\n \"fields\": {\n \"single line text\": \"text value\"\n }\n }\n ],\n \"fieldKeyType\": \"name\",\n \"typecast\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/record")
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 \"records\": [\n {\n \"fields\": {\n \"single line text\": \"text value\"\n }\n }\n ],\n \"fieldKeyType\": \"name\",\n \"typecast\": true\n}"
response = http.request(request)
puts response.read_body{
"records": [
{
"id": "recXXXXXXX",
"fields": {
"single line text": "text value"
}
}
]
}Create records
Create one or multiple records with support for field value typecast and custom record ordering.
curl --request POST \
--url https://app.teable.ai/api/table/%7BtableId%7D/record \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"fieldKeyType":"id","typecast":true,"order":{"viewId":"string","anchorId":"string","position":"before"},"records":[{"fields":{"single line text":"text value"}}]}'const url = 'https://app.teable.ai/api/table/%7BtableId%7D/record';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"fieldKeyType":"id","typecast":true,"order":{"viewId":"string","anchorId":"string","position":"before"},"records":[{"fields":{"single line text":"text value"}}]}'
};
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/table/%7BtableId%7D/record',
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({
fieldKeyType: 'id',
typecast: true,
order: {viewId: 'string', anchorId: 'string', position: 'before'},
records: [{fields: {'single line text': 'text value'}}]
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"fieldKeyType\":\"id\",\"typecast\":true,\"order\":{\"viewId\":\"string\",\"anchorId\":\"string\",\"position\":\"before\"},\"records\":[{\"fields\":{\"single line text\":\"text value\"}}]}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("POST", "/api/table/%7BtableId%7D/record", 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}/record",
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([
'records' => [
[
'fields' => [
'single line text' => 'text value'
]
]
],
'fieldKeyType' => 'name',
'typecast' => 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/table/{tableId}/record"
payload := strings.NewReader("{\n \"records\": [\n {\n \"fields\": {\n \"single line text\": \"text value\"\n }\n }\n ],\n \"fieldKeyType\": \"name\",\n \"typecast\": 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/table/{tableId}/record")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"records\": [\n {\n \"fields\": {\n \"single line text\": \"text value\"\n }\n }\n ],\n \"fieldKeyType\": \"name\",\n \"typecast\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/record")
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 \"records\": [\n {\n \"fields\": {\n \"single line text\": \"text value\"\n }\n }\n ],\n \"fieldKeyType\": \"name\",\n \"typecast\": true\n}"
response = http.request(request)
puts response.read_body{
"records": [
{
"id": "recXXXXXXX",
"fields": {
"single line text": "text value"
}
}
]
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
请求体
Multiple Create records
Array of record objects
Show child attributes
Show child attributes
[
{
"fields": { "single line text": "text value" }
}
]
Define the key type of record.fields[key], You can click "systemInfo" in the field edit box to get fieldId or enter the table design screen with all the field details
id, name, dbFieldName Automatic data conversion from cellValues if the typecast parameter is passed in. Automatic conversion is disabled by default to ensure data integrity, but it may be helpful for integrating with 3rd party data sources.
Where this record to insert to (Optional)
Show child attributes
Show child attributes
响应
Returns data about the records.
Array of record objects
Show child attributes
Show child attributes
[
{
"id": "recXXXXXXX",
"fields": { "single line text": "text value" }
}
]
此页面对您有帮助吗?

