Meeting OS 人員和組織資料共享 REST API
在每個請求的 HTTP 頭中添加 X-API-Key 參數:
curl -H "X-API-Key: your_api_key_here" \ https://your-domain/api/data/people
提示: 你的 API Key 已在系統環境變數中設置。請妥善保管,勿在公開場合分享。
返回系統中所有人員的完整資料,包括姓名、職稱、部門、員工編號等信息。
無
返回系統中所有部門和處的組織結構資料,包括層級關係、名稱、成員數等信息。
type: "division" — 處(最高層級)type: "department" — 部(下級層級,parentId 指向處)一次性返回所有人員和組織資料,適合需要完整資料快照的場景。
返回上次數據同步的時間戳和下次同步的預計時間。
數據每小時自動同步一次(UTC 時區的每小時第 0 分鐘)。
API Key 缺失或無效
伺服器內部錯誤,請稍後重試或聯繫管理員
import requests
API_KEY = "your_api_key_here"
BASE_URL = "https://your-domain/api/data"
headers = {"X-API-Key": API_KEY}
# 獲取所有人員
response = requests.get(f"{BASE_URL}/people", headers=headers)
people = response.json()["data"]
# 獲取所有部門
response = requests.get(f"{BASE_URL}/departments", headers=headers)
departments = response.json()["data"]
print(f"共有 {len(people)} 名人員和 {len(departments)} 個部門")const API_KEY = "your_api_key_here";
const BASE_URL = "https://your-domain/api/data";
const headers = { "X-API-Key": API_KEY };
// 獲取所有人員
const peopleResponse = await fetch(`${BASE_URL}/people`, { headers });
const { data: people } = await peopleResponse.json();
// 獲取所有部門
const deptResponse = await fetch(`${BASE_URL}/departments`, { headers });
const { data: departments } = await deptResponse.json();
console.log(`共有 ${people.length} 名人員和 ${departments.length} 個部門`);如有任何問題或建議,請聯繫系統管理員。