Hi,
We’ve created several scripts that take data from one row in SeaTable, send it to our API server and return a PDF document that we want to add to a specific record from the initial row.
The script is working perfectly but we are stuck for the last bit (putting the PDF file in the record (File Type Column).
We are using the REST API; We can get data, and modify tables/rows of type text, etc. But we are stuck at trying to “attach” documents.
Our goal is to update/attach a PDF file to an existing row, from the table “CCC”
Following documentation, it’s easy getting the “upload link”:
{
"upload_link": "https://cloud.seatable.io/seafhttp/upload-api/deeacb2d-fcac-471f-8640-662ca52acdf7",
"parent_path": "/asset/529d86b6-0c31-422a-bf72-7ebc2c669928",
"img_relative_path": "images/2022-08",
"file_relative_path": "files/2022-08"
}
Then with the information received, uploading the document is not an issue, api returns :
[{
"name": "test.pdf",
"id": "0d1e3593a845af0975c4cc5b1ec180cab0b7393c",
"size": 14734
}]
At this point we have the PDF updated, and ready to attach it to a “Documents” column into the table Company
Information needed to construct the next call
{
'name' => ‘test.pdf’,
'size' => $file_size,
'type' => 14734,
'url' => [https://cloud.seatable.io/workspace/3/asset/529d86b6-0c31-422a-bf72-7ebc2c669928/files/2022-08/test.pd](https://cloud.seatable.io/workspace/3/asset/529d86b6-0c31-422a-bf72-7ebc2c669928/files/2022-08/test.pdf)
}
We cannot find a full example on docs/forums for how to attach this new uploaded filed to the table “CCC"
Updating rows refers to “append a row” for files updates/attachments, but example there is specific for “adding rows”
We are looking for a full example of how to update/attach a file to an existing row. Does anyone can help?
Thanks a lot