# 刷卡資料介接

## 打卡資料寫入

> 用於接收由門禁、打卡鐘等外部系統傳來的打卡資料

```json
{"openapi":"3.1.1","info":{"title":"企業大師","version":"2.0.1"},"servers":[{"url":"https://https://apis.104api.com.tw/prohrm/1.0"}],"security":[{"oauth2_auth":["prohrm"]}],"components":{"securitySchemes":{"oauth2_auth":{"type":"oauth2","flows":{"application":{"tokenUrl":"https://apis.104api.com.tw/oauth2/token","scopes":{"prohrm":"提供操作 104 企業大師-人資管理 API 權限"}}}}}},"paths":{"/hrmapi/external/transferCard":{"post":{"tags":["刷卡資料介接"],"description":"用於接收由門禁、打卡鐘等外部系統傳來的打卡資料","summary":"打卡資料寫入","parameters":[{"in":"header","name":"authorization","description":"access token","required":true,"type":"string"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"integer"},"ignore":{"type":"integer"},"ignoreDetail":{"type":"array","items":{"type":"object","properties":{"idx":{"type":"integer"},"errorMsg":{"type":"string"}}}},"fail":{"type":"integer"},"failDetail":{"type":"array","items":{"type":"object","properties":{"idx":{"type":"integer"},"errorMsg":{"type":"string"}}}}}}}}},"400":{"description":"商務邏輯相關錯誤(code對應訊息，同sample順序)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"}}}}}},"401":{"description":"權限不足相關錯誤(code對應訊息，同sample順序)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"}}}}}}},"operationId":"post_|hrmapi|external|transferCard","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"empNo":{"type":"string","description":"員編"},"cardTime":{"type":"integer","format":"int64","description":"打卡時間timestamp"}}}}}},"required":true}}}}}
```

## 第三方卡鐘資料傳輸

> 用於接收由門禁、打卡鐘等外部系統傳來的打卡資料

```json
{"openapi":"3.1.1","info":{"title":"企業大師","version":"2.0.1"},"servers":[{"url":"https://https://apis.104api.com.tw/prohrm/1.0"}],"security":[{"oauth2_auth":["prohrm"]}],"components":{"securitySchemes":{"oauth2_auth":{"type":"oauth2","flows":{"application":{"tokenUrl":"https://apis.104api.com.tw/oauth2/token","scopes":{"prohrm":"提供操作 104 企業大師-人資管理 API 權限"}}}}}},"paths":{"/hrmapi/external/transferTpCard":{"post":{"tags":["刷卡資料介接"],"description":"用於接收由門禁、打卡鐘等外部系統傳來的打卡資料","summary":"第三方卡鐘資料傳輸","parameters":[{"in":"header","name":"authorization","description":"access token","required":true,"type":"string"}],"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"uno":{"type":"string","description":"統編"},"code":{"type":"integer","description":"結果代碼"},"msg":{"type":"string","description":"資料相關錯誤(code對應訊息，同sample順序)"},"success":{"type":"integer"},"ignore":{"type":"integer"},"ignoreDetail":{"type":"array","items":{"type":"object","properties":{"idx":{"type":"integer"},"errorMsg":{"type":"string"}}}},"fail":{"type":"integer"},"failDetail":{"type":"array","items":{"type":"object","properties":{"idx":{"type":"integer"},"errorMsg":{"type":"string"}}}}}}}}}},"400":{"description":"商務邏輯相關錯誤(code對應訊息，同sample順序)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"}}}}}},"401":{"description":"權限不足相關錯誤(code對應訊息，同sample順序)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"}}}}}}},"operationId":"post_|hrmapi|external|transferTpCard","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"uno":{"type":"string","description":"統編"},"cardData":{"type":"array","items":{"type":"object","properties":{"empNo":{"type":"string","description":"員編"},"cardTime":{"type":"integer","format":"int64","description":"打卡時間timestamp"}}}}}}}}},"required":true}}}}}
```
