### App Open Event Callback Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-2003514.md This is an example of the callback payload received when a tenant first enables an application. It includes details about the event, the application, the tenant, and the user who installed it. Note that the 'installer' or 'installer_employee' fields may be present depending on how the app was installed. ```json { "ts": "1502199207.7171419", "uuid": "bc447199585340d1f3728d26b1c0297a", "token": "41a9425ea7df4536a7623e38fa321bae", "type": "event_callback", "event": { "app_id": "cli_xxx", "tenant_key":"xxx", "type":"app_open", "applicants": [ { "open_id":"xxx" } ], "installer": { "open_id":"xxx" }, "installer_employee": { "open_id":"xxx" } } } ``` -------------------------------- ### Get Daily Meeting Report Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-439536.md Example payload for fetching daily meeting reports. Includes time range, limit, and sorting parameters. ```json { "start_time":"1608888867", "end_time":"1608888966", "limit":10, "order_by":1, "data": { "meeting_report": { "total_meeting_count": "100", "total_meeting_duration": "300000", "total_participant_count": "20000", "daily_report": [ { "date": "1609113600", "meeting_count": "100", "meeting_duration": "147680", "participant_count": "2000" } ] } } "data": { "top_user_report": [ { "id": "ou_3ec3f6a28a0d08c45d895276e8e5e19b", "name": "name", "user_type": 1, "meeting_count": "100", "meeting_duration": "3000" } ] } } ``` -------------------------------- ### Resource Data Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-394819.md This is an example of the data structure for a user attribute resource, illustrating the fields and their expected values. ```json { "enum_id": "exGeIjow7zIqWMy+ONkFxA==", "enum_value": "2", "content": "专家", "enum_type": 2, "enum_status": 1, "i18n_content": [ { "locale": "zh_cn", "value": "专家" } ] } ``` -------------------------------- ### Create Single Select Field Response Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-436742.md Example response body after successfully creating a single select field. ```APIDOC ## Create Single Select Field Response ### Success Response (200) ```json { "code": 0, "data": { "field": { "field_id": "fld2RxOyB8", "field_name": "单选", "property": { "options": [ { "color": 0, "id": "optpeuQVqp", "name": "a" }, { "color": 1, "id": "opt5g3xLFT", "name": "b" }, { "color": 5, "id": "optDIEs1h0", "name": "c" }, { "color": 6, "id": "optZZceUac", "name": "d" } ] }, "type": 3 } }, "msg": "Success" } ``` ``` -------------------------------- ### Insert Row Request Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-413734.md This example demonstrates how to insert a new row at the beginning of a table. It specifies the table ID and the row index (0 for the top). ```json { "Revision": 167, "Requests": [ "{\"requestType\":\"InsertTableRowRequestType\",\"insertTableRowRequest\":{\"tableId\":\"rslqdc8170vgu2vsjj2544fwz54ybb3hz7-csc9cbethbmi129ukq31cko24r28wziaa6\", \"rowIndex\": 0}}" ] } ``` -------------------------------- ### User Attendance Success Callback Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1974098.md This is an example of the JSON payload received when a user's attendance record is created. It includes event details and the specific attendance information. ```json { "schema": "2.0", "header": { "event_id": "41fae5c12837ead344eced982fbde395", "token": "wz5vVgAqJ0cghdfdjdVuxeyTt8hvYHBg", "create_time": "1615381917707", "event_type": "attendance.user_flow.created_v1", "tenant_key": "2fce678eb60d1651", "app_id": "cli_a0c203e66cf8100c" }, "event": { "bssid": "b0:b8:67:62:18:73", "check_time": "1615381916", "comment": "", "employee_id": "2b68933a", "employee_no": "", "is_field": false, "is_wifi": false, "latitude": 30.29245030908851, "location_name": "浙江省杭州市余杭区五常街道木桥头西溪八方城", "longitude": 120.04004357074373, "photo_urls": null, "record_id": "6938012269578125316", "ssid": "ByteDance Inc", "type": 0 } } ``` -------------------------------- ### File Deletion Callback Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1949970.md This is an example of the callback payload received when a file is permanently deleted. It includes event details, header information, and the specific event payload. ```json { "schema": "2.0", // 事件格式的版本。无此字段的即为1.0 "header": { "event_id": "88ba7a69073dcc5b0dea70be77xxxxxx", // 事件的唯一标识 "token": "xxxxxx", // 即Verification Token "create_time": "1612246959000", // 事件发送的时间 "event_type": "drive.file.deleted_v1", // 事件类型 "tenant_key": "xxxxxx", // 企业标识 "app_id": "cli_xxxxxx", // 应用ID "resource_id": "doccnxxxxxx", // 资源id,即订阅的文件token "user_list": [{ // 订阅的用户列表 "union_id": "on_xxxxxx" }] }, "event": { "file_token": "doccnxxxxxx", // 文件token "file_type": "doc", // 文件类型,目前有doc、sheet "operator_id": { // 操作者id "open_id": "ou_xxxxxx", "union_id": "on_xxxxxx", "user_id": "xxxxxx" } } } ``` -------------------------------- ### Insert Column Request Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-413734.md This example shows how to insert a new column to the left of the second column in a table. It requires the table ID and the column index (1 for the second column). ```json { "Revision": 178, "Requests": [ "{\"requestType\":\"InsertTableColumnRequestType\",\"insertTableColumnRequest\":{\"tableId\":\"rslqdc8170vgu2vsjj2544fwz54ybb3hz7-csc9cbethbmi129ukq31cko24r28wziaa6\", \"columnIndex\": 1}}" ] } ``` -------------------------------- ### Employee Created Event Payload Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-392294.md This is an example of the event payload received when a new employee is created. It includes detailed information about the employee and their associated data. ```json { "schema": "2.0", "header": { "event_id": "5e3702a84e847582be8db7fb73283c02", "event_type": "contact.user.created_v3", "create_time": "1608725989000", "token": "rvaYgkND1GOiu5MM0E1rncYC6PLtF7JV", "app_id": "cli_9f5343c580712544", "tenant_key": "2ca1d211f64f6438" }, "event": { "object": { "open_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62", "union_id": "on_576833b917gda3d939b9a3c2d53e72c8", "user_id": "e33ggbyz", "name": "张三", "en_name": "San Zhang", "nickname": "Sunny Zhang", "email": "zhangsan@gmail.com", "enterprise_email": "demo@mail.com", "job_title": "软件工程师", "mobile": "12345678910", "gender": 1, "avatar": { "avatar_72": "https://foo.icon.com/xxxx", "avatar_240": "https://foo.icon.com/xxxx", "avatar_640": "https://foo.icon.com/xxxx", "avatar_origin": "https://foo.icon.com/xxxx" }, "status": { "is_frozen": false, "is_resigned": false, "is_activated": true, "is_exited": false, "is_unjoin": false }, "department_ids": [ "od-4e6ac4d14bcd5071a37a39de902c7141" ], "leader_user_id": "ou_3ghm8a2u0eftg0ff377125s5dd275z09", "city": "杭州", "country": "中国", "work_station": "杭州", "join_time": 1615381702, "employee_no": "e33ggbyz", "employee_type": 1, "orders": [ { "department_id": "od-4e6ac4d14bcd5071a37a39de902c7141", "user_order": 100, "department_order": 100 } ], "custom_attrs": [ { "type": "TEXT", "id": "DemoId", "value": { "text": "DemoText", "url": "http://www.fs.cn", "pc_url": "http://www.fs.cn", "option_id": "edcvfrtg", "option_value": "option", "name": "name", "picture_url": "https://xxxxxxxxxxxxxxxxxx", "generic_user": { "id": "9b2fabg5", "type": 1 } } } ] } } } ``` -------------------------------- ### Create Document Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md Creates a new document. It is recommended to read the 'Document Overview' and 'Getting Started with Document API' guides before using this interface to ensure data integrity. ```APIDOC ## POST /docs/v2/documents/create ### Description Creates a new document. It is recommended to read the 'Document Overview' and 'Getting Started with Document API' guides before using this interface to ensure data integrity. ### Method POST ### Endpoint /docs/v2/documents/create ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **folder_token** (string) - Required - The token of the folder where the document will be created. - **title** (string) - Required - The title of the document. - **content** (string) - Optional - The content of the document in markdown format. ``` -------------------------------- ### 创建用户 Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md Create a user in the contact directory. This is analogous to an employee onboarding. ```APIDOC ## POST /open-apis/contact/v3/users ### Description Create a user in the contact directory. This is analogous to an employee onboarding. Only data with permission will be returned after user creation. Please refer to application permissions for the correspondence between data permissions and fields. ### Method POST ### Endpoint /open-apis/contact/v3/users ### Parameters #### Request Body - **name** (string) - Required - The name of the user. - **email** (string) - Optional - The email address of the user. - **mobile** (string) - Optional - The mobile phone number of the user. ``` -------------------------------- ### Edit Document Content Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md Edits the content of a document. It is recommended to read the 'Document Overview' and 'Getting Started with Document API' guides before using this interface to ensure data integrity. ```APIDOC ## PUT /docs/v2/document/content/edit ### Description Edits the content of a document. It is recommended to read the 'Document Overview' and 'Getting Started with Document API' guides before using this interface to ensure data integrity. ### Method PUT ### Endpoint /docs/v2/document/content/edit ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **document_id** (string) - Required - The ID of the document. - **content** (string) - Required - The new content of the document in markdown format. ``` -------------------------------- ### Golang SDK Example for Helpdesk API Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-444610.md This Golang code snippet illustrates how to interact with the Feishu Helpdesk API, including fetching tenant access tokens and constructing authenticated HTTP requests with the service desk token. ```APIDOC ## Golang SDK Example ### Description This Golang example shows how to retrieve ticket details using the Feishu Helpdesk API. It includes helper functions for HTTP requests, obtaining tenant access tokens, and setting up the necessary headers for authentication. ### Method GET ### Endpoint `https://open.feishu.cn/open-apis/helpdesk/v1/tickets/{ticket_id}` ### Parameters #### Request Body (for `getTenantToken` POST request) - **app_id** (string) - Required - Your application ID. - **app_secret** (string) - Required - Your application secret. #### Header Parameters (for Helpdesk API calls) - **Authorization** (string) - Required - `Bearer {tenant_access_token}`. - **X-Lark-Helpdesk-Authorization** (string) - Required - Base64 encoded `helpdesk_id:helpdesk_token`. ### Request Example ```go import ( "bytes" b64 "encoding/base64" "encoding/json" "fmt" "io/ioutil" "net/http" "testing" ) //开放平台机器人应用凭证,用于开通访问服务台权限 var appInfo = ` { "app_id":"应用ID", "app_secret":"应用密钥" } ` func httpRequest(req *http.Request) []byte { req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { panic(err) } return body } func postJson(url string, myjson string) []byte { req, err := http.NewRequest("POST", url, bytes.NewBuffer([]byte(myjson))) if err != nil { panic(err) } return httpRequest(req) } type tokenInfo struct { App_access_token string `json:"app_access_token"` Tenant_access_token string `json:"tenant_access_token"` } //获取开放平台tenant token func getTenantToken() string { url := "https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal/" body := postJson(url, appInfo) tokenInfo := tokenInfo{} json.Unmarshal(body, &tokenInfo) fmt.Println(tokenInfo) return tokenInfo.Tenant_access_token } func TestOpenApi(t *testing.T) { //服务台id跟token,用于指定访问哪个服务台 helpdeskAuthInfo := "服务台ID:服务台Token" //服务台token base64编码 helpdeskAuthToken := b64.StdEncoding.EncodeToString([]byte(helpdeskAuthInfo)) url := "https://open.feishu.cn/open-apis/helpdesk/v1/tickets/工单ID" req, _ := http.NewRequest("GET", url, nil) req.Header.Set("X-Lark-Helpdesk-Authorization", helpdeskAuthToken) tenantToken := getTenantToken() //open api的token,请去开放平台申请好访问服务台资源权限 req.Header.Set("Authorization", "Bearer "+tenantToken) body := httpRequest(req) fmt.Println(string(body)) } ``` ``` -------------------------------- ### Get Enterprise Installed Applications Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md Retrieves a list of applications installed within an enterprise. Only callable by self-built applications. ```APIDOC ## GET /enterprise/applications ### Description Retrieves a list of applications installed in the enterprise. This endpoint is intended for self-built applications. ### Method GET ### Endpoint /enterprise/applications ``` -------------------------------- ### Application Uninstall Callback Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-2003524.md This JSON object demonstrates the structure of the callback received when an application is uninstalled. It includes essential fields like timestamp, UUID, token for verification, event type, and specific event details such as the app ID and tenant key. ```json { "ts": "1502199207.7171419", "uuid": "bc447199585340d1f3728d26b1c0297a", "token": "41a9425ea7df4536a7623e38fa321bae", "type": "event_callback", "event": { "app_id": "cli_xxx", "tenant_key": "xxx", "type": "app_uninstalled" } } ``` -------------------------------- ### Python SDK Example for Helpdesk API Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-444610.md This Python code snippet demonstrates how to make authenticated requests to the Feishu Helpdesk API, including obtaining tenant access tokens and using the service desk token for authorization. ```APIDOC ## Python SDK Example ### Description This Python example demonstrates how to query ticket details using the Feishu Helpdesk API. It includes functions for making GET and POST requests, obtaining tenant access tokens, and setting the necessary authorization headers. ### Method GET, POST ### Endpoint `https://open.feishu.cn/open-apis/helpdesk/v1/tickets/{ticket_id}` ### Parameters #### Request Body (for `get_tenant_header` POST request) - **app_id** (string) - Required - Your application ID. - **app_secret** (string) - Required - Your application secret. #### Header Parameters (for Helpdesk API calls) - **Authorization** (string) - Required - `Bearer {tenant_access_token}`. - **X-Lark-Helpdesk-Authorization** (string) - Required - Base64 encoded `helpdesk_id:helpdesk_token`. ### Request Example ```python import requests import time def get(url: str, **kwargs): r = requests.get( url, cookies=kwargs.get("cookies", {}), params=kwargs.get("params", {}), headers=dict(kwargs.get("headers", {}), **{"Connection": "close"}), json=kwargs.get("json", {}), ) return r def post(url: str, **kwargs): r = requests.post( url, cookies=kwargs.get("cookies", {}), params=kwargs.get("params", {}), headers=dict(kwargs.get("headers", {}), **{"Connection": "close"}), json=kwargs.get("json", {}), ) return r def get_tenant_header(): url = "https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal/" # 开放平台机器人应用凭证,用于开通访问服务台权限 body = { "app_id": "应用ID", "app_secret": "应用密钥" } # 把 服务台ID:服务台Token 转换为base64,填写到 X-Lark-Helpdesk-Authorization,用于指定访问哪个服务台 # 在线base64编码 https://base64.us https://tool.oschina.net/encrypt?type=3 return { "Authorization": "Bearer %s" % post(url, json=body).json()["tenant_access_token"], "X-Lark-Helpdesk-Authorization": "Njk4OTgwNTM1ODU1ODQ3ODM1NTpodC1lYjk1Y2ZlYi03ZGM1LTY1ZGUtMTUzOS1iMzZmOTk3MmM3ZjA=", } tenant_header = get_tenant_header() def get_ticket(id): url = "https://open.feishu.cn/open-apis/helpdesk/v1/tickets/%s" % id res = get(url, headers=tenant_header) try: info = res.json()["data"]["ticket"] return info except: print(id, res) return get_ticket(id) # Retry mechanism info = get_ticket("工单ID") print(info) ``` ``` -------------------------------- ### Time Off Event Data Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-439141.md This is an example of the data structure for a time off event. It includes user ID, time zone, start and end times, and custom title and description. ```json { "timeoff_event_id": "timeoff:XXXXXX-XXXX-0917-1623-aa493d591a39-XXXXXX", "user_id": "ou_XXXXXXXXXX", "timezone": "Asia/Shanghai", "start_time": "2021-01-01", "end_time": "2021-01-01", "title": "请假中(全天) / 1-Day Time Off", "description": "若删除此日程,飞书中相应的“请假”标签将自动消失,而请假系统中的休假申请不会被撤销。" } ``` -------------------------------- ### POST/open-apis/personal_settings/v1/system_statuses Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1939273.md Creates a system status at the tenant level. ```APIDOC ## POST /open-apis/personal_settings/v1/system_statuses ### Description Creates a system status at the tenant level. ### Method POST ### Endpoint /open-apis/personal_settings/v1/system_statuses ``` -------------------------------- ### Chat ID Format Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-398408.md Illustrates the typical format of a chat_id, which starts with 'oc_' followed by a unique string. ```text chat_id`的格式是由`oc_`开头的字符串,例如:`oc_a0553eda9014c201e6969b478895c230 ``` -------------------------------- ### Recording Ready Event Payload Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-439530.md This is an example of the event payload received when a meeting recording is ready. It includes details about the meeting, the recording URL, and its duration. Ensure you have the 'Get Meeting Info' permission to receive this event. ```json { "schema": "2.0", "header": { "event_id": "5e3702a84e847582be8db7fb73283c02", "event_type": "vc.meeting.recording_ready_v1", "create_time": "1608725989000", "token": "rvaYgkND1GOiu5MM0E1rncYC6PLtF7JV", "app_id": "cli_9f5343c580712544", "tenant_key": "2ca1d211f64f6438" }, "event": { "meeting": { "id": "6911188411934433028", "topic": "my meeting", "meeting_no": "235812466", "owner": { "id": { "union_id": "on_8ed6aa67826108097d9ee143816345", "user_id": "e33ggbyz", "open_id": "ou_84aad35d084aa403a838cf73ee18467" } } }, "url": "https://meetings.feishu.cn/minutes/obcn37dxcftoc3656rgyejm7", "duration": "30000" } } ``` -------------------------------- ### 接口限制 Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-447861.md 概述了企业百科开放 API 接口的 QPS 限制,包括创建更新接口和读取数据接口的速率限制。 ```APIDOC ## 接口限制 开放 API 接口的 QPS 限制。 - 创建更新相关接口 100次/分钟 - 读取数据相关接口 50次/秒 或 1000次/分钟 ``` -------------------------------- ### Start Recording Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-439151.md Starts the recording for a meeting. ```APIDOC ## PATCH /open-apis/vc/v1/meetings/:meeting_id/recording/start ### Description Starts the recording for a meeting. ### Method PATCH ### Endpoint /open-apis/vc/v1/meetings/:meeting_id/recording/start ### Parameters #### Path Parameters - **meeting_id** (string) - Required - The ID of the meeting to start recording. ### Access Token user_access_token ``` -------------------------------- ### GET/open-apis/personal_settings/v1/system_statuses Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1939273.md Retrieves all system statuses for a tenant. ```APIDOC ## GET /open-apis/personal_settings/v1/system_statuses ### Description Retrieves all system statuses for a tenant. ### Method GET ### Endpoint /open-apis/personal_settings/v1/system_statuses ``` -------------------------------- ### Comment Data Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1997387.md An example of the JSON structure for a comment. ```APIDOC ## Data Example ```json { "content": "{\"text\":\"agree\",\"files\":[{\"url\":\"xxx\",\"fileSize\":155149,\"title\":\"9a9fedc5cfb01a4a20c715098.png\",\"type\":\"image\",\"extra\":\"\"}]}", "at_info_list": [ { "user_id": "579fd9c4", "name": "zhangsan", "offset": "1" } ], "parent_comment_id": "7081516627711524883", "comment_id": "7081516627711524883", "disable_bot": false, "extra": "{\"a\":\"a\"}" } ``` ``` -------------------------------- ### Create Approval Instance API Request Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1974108.md This example shows the request body for creating a new approval instance. It includes the Approval Code, user IDs, and form data, demonstrating how to specify custom control IDs and node IDs. ```JSON { "approval_code": "YOUR_APPROVAL_CODE", "user_id": "APPLICANT_USER_ID", "department_id": "APPLICANT_DEPARTMENT_ID", "node_approver_user_id_list": [ "APPROVER_USER_ID_OR_NODE_ID" ], "form": { "YOUR_CONTROL_ID": "CONTROL_VALUE" } } ``` -------------------------------- ### Video Conferencing > Recording > Start Recording Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md Starts recording a meeting. ```APIDOC ## POST /video/recording/start ### Description Starts recording a meeting. ### Method POST ### Endpoint /video/recording/start ### Parameters #### Request Body - **meeting_id** (string) - Required - The ID of the meeting to record. ### Request Example { "meeting_id": "meeting_abcde" } ### Response #### Success Response (200) (No response schema specified in source) #### Response Example (No response example specified in source) ``` -------------------------------- ### Start Recording Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1939254.md Starts the recording of a video meeting. Requires 'vc:record' permission. ```APIDOC ## POST /vc-v1/meeting-recording/start ### Description Starts the recording of a video meeting. ### Method POST ### Endpoint /vc-v1/meeting-recording/start ### Request Body - **meeting_id** (string) - Required - The ID of the meeting to record. ### Request Example { "meeting_id": "meeting_777" } ### Response #### Success Response (200) - **message** (string) - Confirmation message. ### Response Example { "message": "Recording started successfully." } ``` -------------------------------- ### Get Knowledge Base Categories Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get knowledge base categories. ```APIDOC ## GET /service/desk/knowledge_base/categories ### Description Retrieves knowledge base categories. ### Method GET ### Endpoint /service/desk/knowledge_base/categories ``` -------------------------------- ### Meeting Room Data Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1972892.md Provides a sample JSON structure for a meeting room object, illustrating the expected fields and their data types. ```json { "room_id": "omm_4de32cf10a4358788ff4e09e37ebbf9b", "name": "测试会议室", "capacity": 10, "description": "测试会议室描述", "custom_room_id": "1234", "room_level_id": "omb_4ad1a2c7a2fbc5fc9570f38456931293", "path": [ "omb_4ad1a2c7a2fbc5fc9570f38456931293" ], "room_status": { "status": true, "schedule_status": true, "disable_start_time": "1652356050", "disable_end_time": "1652442450", "disable_reason": "测试占用", "contact_ids": [ "ou_3ec3f6a28a0d08c45d895276e8e5e19b" ], "disable_notice": true, "resume_notice": true } } ``` -------------------------------- ### Example Fields Mapping for Display Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-2004143.md This JSON snippet illustrates an example of `fields_mapping` within the `display` object for creating data schemas. It shows how data fields can be mapped to template fields like `tag1`, `tag2`, `summary`, and `footer`. Special handling is noted for `_create_time` and `_update_time` when mapping to the `footer` field. ```json { "display": { "card_key": "search_common_card", "fields_mapping": [ { "data_field": "${priority}", "display_field": "tag1" }, { "data_field": "${status}", "display_field": "tag2" }, { "data_field": "${type}", "display_field": "tag3" }, { "data_field": "this is ${summary} and content is ${content}", "display_field": "summary" }, { "data_field": "${_create_time}", "display_field": "footer" } ] } } ``` -------------------------------- ### Get Knowledge Base Image Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get knowledge base images. ```APIDOC ## GET /service/desk/knowledge_base/image/{image_id} ### Description Retrieves an image from the knowledge base. ### Method GET ### Endpoint /service/desk/knowledge_base/image/{image_id} ``` -------------------------------- ### Table Creation Options Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-412918.md Two methods exist for creating tables: one with content (rowSize, columnSize, tableRows, tableStyle, mergedCells) and another for creating an empty table by specifying only rowSize and columnSize. ```json { "tableId": string, "rowSize": int, "columnSize": int, "tableRows": [{object(TableRow)}], "tableStyle": {object(TableStyle)}, "mergedCells": [{object(MergedCell)}], "location": {object(Location)} } ``` -------------------------------- ### Example Text Message Content Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1945309.md This is an example of the content field for a text message, showing its JSON structure. ```json { "content": "{\"text\":\"文本消息\"}" } ``` -------------------------------- ### Get All Knowledge Base Categories Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get all service desk knowledge base categories. ```APIDOC ## GET /service/desk/knowledge_base/all_categories ### Description Retrieves all service desk knowledge base categories. ### Method GET ### Endpoint /service/desk/knowledge_base/all_categories ``` -------------------------------- ### Get All Knowledge Base Details Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get service desk knowledge base details. ```APIDOC ## GET /service/desk/knowledge_bases ### Description Retrieves all service desk knowledge base details. ### Method GET ### Endpoint /service/desk/knowledge_bases ``` -------------------------------- ### User Group Data Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-394794.md This is an example of the data structure for a user group, showing its ID, name, description, and member counts. It is useful for understanding the expected output when querying user group information. ```json { "id": "g193821", "name": "IT 外包组", "description": "IT 外包组,需要对该组人群进行细颗粒度权限管控。", "member_user_count": 2, "member_department_count": 0 } ``` -------------------------------- ### Get Knowledge Base Details Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get service desk knowledge base details. ```APIDOC ## GET /service/desk/knowledge_base/{kb_id} ### Description Retrieves the details of a service desk knowledge base. ### Method GET ### Endpoint /service/desk/knowledge_base/{kb_id} ``` -------------------------------- ### 企业百科 > 词条 [创建免审词条] Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md Entries created through this interface do not require administrator approval and can be directly written into the knowledge base. Use with caution. Tenant administrators should also approve with caution. ```APIDOC ## 企业百科 > 词条 [创建免审词条] ### Description Entries created through this interface do not require administrator approval and can be directly written into the knowledge base. Use with caution. Tenant administrators should also approve with caution. ### Method POST ### Endpoint /enterprise_wiki/entries/no_approval ### Parameters #### Request Body - **title** (string) - Required - The title of the encyclopedia entry. - **content** (string) - Required - The content of the encyclopedia entry. - **alias** (array) - Optional - A list of aliases for the entry. ### Request Example ```json { "title": "Important Policy", "content": "This policy outlines important guidelines.", "alias": ["IP"] } ``` ### Response #### Success Response (200) - **entry_id** (string) - The ID of the created entry. ``` -------------------------------- ### Get Specific Ticket Custom Field Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get ticket custom field details. ```APIDOC ## GET /service/desk/ticket/custom_field/{field_id} ### Description Retrieves the details of a specific ticket custom field. ### Method GET ### Endpoint /service/desk/ticket/custom_field/{field_id} ``` -------------------------------- ### POST/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1939273.md Batch enables user system status availability. ```APIDOC ## POST /open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open ### Description Batch enables user system status availability. ### Method POST ### Endpoint /open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open ``` -------------------------------- ### Get Ticket Message Details Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get service desk ticket message details. ```APIDOC ## GET /service/desk/ticket/message/{message_id} ### Description Retrieves the details of a service desk ticket message. ### Method GET ### Endpoint /service/desk/ticket/message/{message_id} ``` -------------------------------- ### Create Document Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1950645.md Supports specifying a cloud space directory using the `folder_token` parameter. ```APIDOC ## POST /open-apis/docx/v1/documents ### Description Creates a new document. Supports specifying a cloud space directory using the `folder_token` parameter. ### Method POST ### Endpoint https://open.feishu.cn/open-apis/docx/v1/documents ### Parameters #### Query Parameters - **folder_token** (string) - Optional - The token of the cloud space directory where the document will be created. ### Request Example ```bash curl --location --request POST 'https://open.feishu.cn/open-apis/docx/v1/documents?folder_token=fldcnbCHL8OAtkcYHnPzZi1yupN' \ --header 'Authorization: Bearer u-xxx' # Replace with your actual access token before calling ``` ``` -------------------------------- ### Query Ticket Details using Helpdesk API (Python) Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-444610.md This Python script shows how to fetch details of a specific helpdesk ticket. It includes functions for making GET and POST requests, obtaining tenant access tokens, and setting the necessary authorization headers. ```python import requests import time def get(url: str, **kwargs): r = requests.get( url, cookies=kwargs.get("cookies", {}), params=kwargs.get("params", {}), headers=dict(kwargs.get("headers", {}), **{"Connection": "close"}), json=kwargs.get("json", {}), ) return r def post(url: str, **kwargs): r = requests.post( url, cookies=kwargs.get("cookies", {}), params=kwargs.get("params", {}), headers=dict(kwargs.get("headers", {}), **{"Connection": "close"}), json=kwargs.get("json", {}), ) return r def get_tenant_header(): url = "https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal/" # 开放平台机器人应用凭证,用于开通访问服务台权限 body = { "app_id": "应用ID", "app_secret": "应用密钥" } # 把 服务台ID:服务台Token 转换为base64,填写到 X-Lark-Helpdesk-Authorization,用于指定访问哪个服务台 # 在线base64编码 https://base64.us https://tool.oschina.net/encrypt?type=3 return { "Authorization": "Bearer %s" % post(url, json=body).json()["tenant_access_token"], "X-Lark-Helpdesk-Authorization": "Njk4OTgwNTM1ODU1ODQ3ODM1NTpodC1lYjk1Y2ZlYi03ZGM1LTY1ZGUtMTUzOS1iMzZmOTk3MmM3ZjA=", } tenant_header = get_tenant_header() def get_ticket(id): url = "https://open.feishu.cn/open-apis/helpdesk/v1/tickets/%s" % id res = get(url, headers=tenant_header) try: info = res.json()["data"]["ticket"] return info except: print(id, res) return get_ticket(id) info = get_ticket("工单ID") print(info) ``` -------------------------------- ### Get Service Desk Custom Fields Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get service desk custom field details. ```APIDOC ## GET /service/desk/custom_fields ### Description Retrieves the details of service desk custom fields. ### Method GET ### Endpoint /service/desk/custom_fields ``` -------------------------------- ### 获取 Offer 申请表详细信息 Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-447216.md 该接口用于获取 Offer 申请表详细信息。 ```APIDOC ## GET /hire/v1/offer_schema/get ### Description 获取 Offer 申请表详细信息。 ### Method GET ### Endpoint /hire/v1/offer_schema/get ``` -------------------------------- ### Get Referral Information Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md Retrieves referral information based on the application ID. This is part of Recruitment > Get Candidate > Referral. ```APIDOC ## Get Referral Information ### Description Retrieves referral information based on the application ID. ### Method GET ### Endpoint /recruitment/referrals/{application_id} ### Parameters #### Path Parameters - **application_id** (string) - Required - The ID of the application. ### Response #### Success Response (200) - **application_id** (string) - The ID of the application. - **referrer_user_id** (string) - The User ID of the referrer. - **candidate_user_id** (string) - The User ID of the candidate. - **referred_at** (string) - The timestamp when the referral was made. #### Response Example ```json { "application_id": "app123", "referrer_user_id": "user101", "candidate_user_id": "user102", "referred_at": "2023-10-27T12:00:00Z" } ``` ``` -------------------------------- ### 获取 Offer 信息 Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-447216.md 该接口用于获取 Offer 信息。 ```APIDOC ## GET /hire/v1/application/offer ### Description 获取 Offer 信息。 ### Method GET ### Endpoint /hire/v1/application/offer ``` -------------------------------- ### Get Customer Service Skill List Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/readme.md This interface is used to get all customer service skills. Only supports self-built applications. ```APIDOC ## GET /service/desk/customer_service/skill_rules ### Description Retrieves the list of all customer service skills. Only supports self-built applications. ### Method GET ### Endpoint /service/desk/customer_service/skill_rules ``` -------------------------------- ### Screen Sharing Start Event Details Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-439531.md Information about the screen sharing start event, including its type, associated permissions, and how it is pushed. ```APIDOC ## Event Details ### Event Type vc.meeting.share_started_v1 ### Supported Application Types Self-built app store applications ### Permissions Required Get meeting information ### Field Permissions Required This interface returns sensitive fields. These fields are only returned if the corresponding permissions are enabled. If you do not need to obtain these fields, it is not recommended to apply for user IDs. ### Push Method [Webhook](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM) ``` -------------------------------- ### User and Group Event Body Example Source: https://github.com/jasonqwj/feishu_api_docs/blob/main/doc/doc-1942224.md This snippet shows a typical event body structure containing user and user group information. It includes details like user IDs, names, contact information, status, and custom attributes. ```json { "leaderID": "ou_7dab8a3d3cdcc9da365777c7ad535d62" } ] } ], "users": [ { "union_id": "on_94a1ee5551019f18cd73d9f111898cf2", "user_id": "3e3cf96b", "open_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62", "name": "张三", "en_name": "San Zhang", "nickname": "Alex Zhang", "email": "zhangsan@gmail.com", "mobile": "13011111111 (其他例子,中国大陆手机号: 13011111111 或 +8613011111111, 非中国大陆手机号: +41446681800)", "gender": 1, "avatar": { "avatar_72": "https://foo.icon.com/xxxx", "avatar_240": "https://foo.icon.com/xxxx", "avatar_640": "https://foo.icon.com/xxxx", "avatar_origin": "https://foo.icon.com/xxxx" }, "status": { "is_frozen": false, "is_resigned": false, "is_activated": true, "is_exited": false, "is_unjoin": false }, "leader_user_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62", "city": "杭州", "country": "CN", "work_station": "北楼-H34", "join_time": 2147483647, "employee_no": "1", "employee_type": 1, "custom_attrs": [ { "type": "TEXT", "id": "DemoId", "value": { "text": "DemoText", "url": "http://www.fs.cn", "pc_url": "http://www.fs.cn", "option_id": "edcvfrtg", "option_value": "option", "name": "name", "picture_url": "https://xxxxxxxxxxxxxxxxxx", "generic_user": { "id": "9b2fabg5", "type": 1 } } } ], "enterprise_email": "demo@mail.com", "job_title": "xxxxx", "is_frozen": false, "geo": "cn" } ], "user_groups": [ { "user_group_id": "test", "name": "userGroupName", "type": 1, "member_count": 10, "status": 1 } ] } ```