Description
使用默认配置,curl可查,官方默认生成的 request如下:
# 构造请求对象
request: SearchAppTableRecordRequest = SearchAppTableRecordRequest.builder() \
.app_token("xxxx") \
.table_id("xxxx") \
.user_id_type("open_id") \
.page_size(20) \
.build()
这个请求方法是会报错的 ,报错:
[Lark] [2025-03-01 08:35:07,658] [DEBUG] POST https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal 200, headers: {"User-Agent": "oapi-sdk-python/v1.4.10"}, params: [], body: {"app_id": "cli_a73571c4bdf1d013", "app_secret": "QPlsr77IpEm3jVMaBk2M8cuekmGHLn7y"}
[Lark] [2025-03-01 08:35:08,050] [DEBUG] POST https://open.feishu.cn/open-apis/bitable/v1/apps/Xf77bqPDVa2O4QsHUVLcbKrvn94/tables/tblPSj6KCG6gvSM5/records/search 400, headers: {"User-Agent": "oapi-sdk-python/v1.4.10", "Authorization": "Bearer t-g104318lLGTBEBTPIXEZNNNYTG3BXJPRBRYWR4DO"}, params: [["page_size", "20"]], body: None
[Lark] [2025-03-01 08:35:08,050] [ERROR] client.bitable.v1.app_table_record.search failed, code: 9499, msg: Invalid request parameters. Please check and modify accordingly., log_id: 20250301083507830819CBB35124477343, resp:
{
"code": 9499,
"msg": "Invalid request parameters. Please check and modify accordingly.",
"error": {
"log_id": "20250301083507830819CBB35124477343",
"troubleshooter": "排查建议查看(Troubleshooting suggestions): https://open.feishu.cn/search?from=openapi&log_id=20250301083507830819CBB35124477343&code=9499&method_id=7301628054955556866"
}
}
经过研究,默认curl代码请求发送了空请求体{},但是官方SDK没有发。所以需要加上 " .request_body(SearchAppTableRecordRequestBody.builder().build()) \ " ,就正常了
这个API是我第一个尝试调用的,坑了我两天。