openclaw - 💡(How to fix) Fix [Feature Request] feishu_bitable: native attachment upload and record deletion support [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#43729Fetched 2026-04-08 00:17:23
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Fix Action

Workaround

Currently, we have to write custom scripts to call /open-apis/drive/v1/medias/upload_all (with parent_type=bitable_file) to get the token, and then update the record. For deletion, we have to call the API directly.

RAW_BUFFERClick to expand / collapse

Problem

Currently, the feishu_bitable toolset supports basic CRUD operations but lacks:

  1. Attachment Uploads: feishu_bitable_update_record requires a file_token for attachment fields, but there's no tool to upload a file to Bitable to get this token (the existing feishu_doc.upload_file only works for docs, not bitable attachments).
  2. Record Deletion: There is no tool to delete single or multiple records (delete_record).

Workaround

Currently, we have to write custom scripts to call /open-apis/drive/v1/medias/upload_all (with parent_type=bitable_file) to get the token, and then update the record. For deletion, we have to call the API directly.

Proposed Solution

  1. Add a feishu_bitable_upload_attachment tool (or allow passing local file paths directly to feishu_bitable_update_record which handles the upload under the hood).
  2. Add feishu_bitable_delete_record and feishu_bitable_batch_delete_records tools.

Use Case

Automating data entry flows that include files (like uploading PDF licenses, receipts, or images to specific Bitable rows) and cleaning up temporary records.

extent analysis

Fix Plan

To address the issue, we will implement two new tools: feishu_bitable_upload_attachment and feishu_bitable_delete_record.

Step 1: Implement feishu_bitable_upload_attachment Tool

  • Create a new function that takes a local file path and uploads the file to Bitable using the /open-apis/drive/v1/medias/upload_all API.
  • Return the file_token from the API response.

Example code:

import requests

def feishu_bitable_upload_attachment(file_path, access_token):
    url = "https://open.feishu.cn/open-apis/drive/v1/medias/upload_all"
    headers = {"Authorization": f"Bearer {access_token}"}
    params = {"parent_type": "bitable_file"}
    files = {"file": open(file_path, "rb")}
    response = requests.post(url, headers=headers, params=params, files=files)
    return response.json()["data"]["media_token"]

Step 2: Implement feishu_bitable_delete_record and feishu_bitable_batch_delete_records Tools

  • Create a new function that takes a record ID and deletes the record using the Bitable API.
  • Create another function that takes a list of record IDs and deletes the records in batch.

Example code:

import requests

def feishu_bitable_delete_record(record_id, access_token):
    url = f"https://open.feishu.cn/open-apis/bitable/v1/records/{record_id}"
    headers = {"Authorization": f"Bearer {access_token}"}
    response = requests.delete(url, headers=headers)
    return response.status_code == 200

def feishu_bitable_batch_delete_records(record_ids, access_token):
    url = "https://open.feishu.cn/open-apis/bitable/v1/records/batch_delete"
    headers = {"Authorization": f"Bearer {access_token}"}
    data = {"record_ids": record_ids}
    response = requests.post(url, headers=headers, json=data)
    return response.status_code == 200

Verification

To verify the fix, use the new tools to upload an attachment and delete a record. Check the API responses and the Bitable UI to ensure the operations were successful.

Extra Tips

  • Make sure to handle errors and exceptions properly in the new tools.
  • Consider adding logging and monitoring to track the usage and performance of the new tools.
  • Update the documentation and user guides to reflect the new tools and their usage.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING