cURL
curl --request POST \
--url https://app.teable.ai/api/table/%7BtableId%7D/record/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: multipart/form-data' \
--form file=string \
--form fileUrl=stringconst url = 'https://app.teable.ai/api/table/%7BtableId%7D/record/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment';
const form = new FormData();
form.append('file', 'string');
form.append('fileUrl', 'string');
const options = {method: 'POST', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}};
options.body = form;
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/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN'
}
};
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('-----011000010111000001101001\r\nContent-Disposition: form-data; name="file"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name="fileUrl"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n');
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n"
headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }
conn.request("POST", "/api/table/%7BtableId%7D/record/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment", 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/{recordId}/{fieldId}/uploadAttachment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$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/{recordId}/{fieldId}/uploadAttachment"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
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/{recordId}/{fieldId}/uploadAttachment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/record/{recordId}/{fieldId}/uploadAttachment")
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"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"fields": {},
"name": "<string>",
"autoNumber": 123,
"createdTime": "<string>",
"lastModifiedTime": "<string>",
"createdBy": "<string>",
"lastModifiedBy": "<string>",
"permissions": {},
"undeletable": true
}record
Upload attachment
Upload an attachment from a file or URL and append it to the cell
POST
/
table
/
{tableId}
/
record
/
{recordId}
/
{fieldId}
/
uploadAttachment
cURL
curl --request POST \
--url https://app.teable.ai/api/table/%7BtableId%7D/record/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: multipart/form-data' \
--form file=string \
--form fileUrl=stringconst url = 'https://app.teable.ai/api/table/%7BtableId%7D/record/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment';
const form = new FormData();
form.append('file', 'string');
form.append('fileUrl', 'string');
const options = {method: 'POST', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}};
options.body = form;
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/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN'
}
};
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('-----011000010111000001101001\r\nContent-Disposition: form-data; name="file"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name="fileUrl"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n');
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n"
headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }
conn.request("POST", "/api/table/%7BtableId%7D/record/%7BrecordId%7D/%7BfieldId%7D/uploadAttachment", 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/{recordId}/{fieldId}/uploadAttachment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$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/{recordId}/{fieldId}/uploadAttachment"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
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/{recordId}/{fieldId}/uploadAttachment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/table/{tableId}/record/{recordId}/{fieldId}/uploadAttachment")
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"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"fileUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"fields": {},
"name": "<string>",
"autoNumber": 123,
"createdTime": "<string>",
"lastModifiedTime": "<string>",
"createdBy": "<string>",
"lastModifiedBy": "<string>",
"permissions": {},
"undeletable": true
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
响应
201 - application/json
Returns record data after update.
The record id.
Objects with a fields key mapping fieldId or field name to value for that field.
Show child attributes
Show child attributes
primary field value
Auto number, a unique identifier for each record
Created time, date ISO string (new Date().toISOString).
Last modified time, date ISO string (new Date().toISOString).
Created by, user name
Last modified by, user name
Permissions for the record
Show child attributes
Show child attributes
Whether the record is undeletable
最后修改于 2026年3月5日
此页面对您有帮助吗?
⌘I

