6 个版本 (破坏性更新)
0.7.0 | 2023年3月1日 |
---|---|
0.6.0 | 2023年1月5日 |
0.5.0 | 2022年11月2日 |
0.4.1 | 2022年8月18日 |
0.3.1 | 2022年7月14日 |
#594 in #api-client
1.5MB
10K SLoC
Rust 开放API客户端
freee 人事劳资的API规格。
入门指南
对于刚开始使用 freee API 的人,请参考freee API 入门指南。
规格
API 端点
https://api.freee.co.jp/hr
关于认证
使用 OAuth2.0。有关详细信息,请参阅参考中的认证部分。
数据格式
请求和响应都支持 JSON 格式,但具体请参考每个 API 的说明栏(application/json 等)。
向后兼容性变更
为了改善 API,freee 有时会在不通知的情况下进行以下变更。应用程序实现者应在以下考虑下进行开发。
- 添加新的 API 资源端点
- 为现有 API 添加非必需的新请求参数
- 为现有 API 响应添加新的属性
- 更改现有 API 响应中属性的顺序
- 作为键的 id 或 code 长度的更改(变长)
通用响应头
所有 API 的响应都包含以下 HTTP 头。
-
X-Request-Id
- 每个请求生成的 ID
通用错误响应
在 API 请求中出现错误时,将返回相应的状态码和消息。
状态码 | 原因 |
---|---|
400 | 请求参数不正确 |
401 | 访问令牌无效 |
403 | 没有访问权限 |
404 | 资源不存在 |
429 | 超过请求次数限制 |
503 | 系统内部发生意外错误 |
消息正文中的 messages
包含描述错误内容的字符串。
{
"status_code" : 400,
"errors" : [
{
"type" : "bad_request",
"messages" : [
"リクエストの形式が不正です。"
]
}
]
}
API 使用限制
API 请求的上限为每小时 5000 次。API 使用状态将在响应头中附加。
X-Ratelimit-Limit:5000
X-Ratelimit-Remaining:4998
X-Ratelimit-Reset:2018-01-01T12:00:00.000000Z
每个头部的含义如下。
头部名称 | 说明 |
---|---|
X-RateLimit-Limit | 使用次数上限 |
X-RateLimit-Remaining | 剩余使用次数 |
X-RateLimit-Reset | 使用次数重置的时间 |
此外,如果 freee 检测到一定时间内的过度访问,则可能对 API 访问进行控制。
在这种情况下,http 状态码为 403。限制过后约 10 分钟可以再次使用。
更多信息,请访问 https://accounts.secure.freee.co.jp/contacts?from=payroll
概述
此 API 客户端是由 OpenAPI Generator 项目生成的。通过使用来自远程服务器的 openapi-spec,您可以轻松生成 API 客户端。
- API 版本:2022-02-01
- 包版本:2022-02-01
- 构建包:
org.openapitools.codegen.languages.RustClientCodegen
安装
将包放在名为 openapi
的目录下,并在 Cargo.toml
中添加以下内容,在 [dependencies]
openapi = { path = "./openapi" }
API 端点文档
所有 URI 都相对于 https://api.freee.co.jp/hr
类 | 方法 | HTTP 请求 | 描述 |
---|---|---|---|
DefaultApi | action_approval_requests_monthly_attendance | POST /api/v1/approval_requests/monthly_attendances/{id}/actions | 月次勤怠締め申請の承認操作 |
DefaultApi | action_approval_requests_overtime_work | POST /api/v1/approval_requests/overtime_works/{id}/actions | 残業申請の承認操作 |
DefaultApi | action_approval_requests_paid_holiday | POST /api/v1/approval_requests/paid_holidays/{id}/actions | 有給申請の承認操作 |
DefaultApi | bulk_update_employee_dependent_rules | PUT /api/v1/employees/{employee_id}/dependent_rules/bulk_update | 従業員の扶養親族の更新 |
DefaultApi | create_approval_requests_monthly_attendance | POST /api/v1/approval_requests/monthly_attendances | 月次勤怠締め申請の作成 |
DefaultApi | create_approval_requests_overtime_work | POST /api/v1/approval_requests/overtime_works | 创建加班申请 |
DefaultApi | create_approval_requests_paid_holiday | POST /api/v1/approval_requests/paid_holidays | 创建带薪休假申请 |
DefaultApi | create_employee | POST /api/v1/employees | 创建员工 |
DefaultApi | create_employee_time_clock | POST /api/v1/employees/{employee_id}/time_clocks | 登记打卡记录 |
DefaultApi | create_group | POST /api/v1/groups | 创建部门 |
DefaultApi | create_position | POST /api/v1/positions | 创建职位 |
DefaultApi | destroy_approval_requests_monthly_attendance | DELETE /api/v1/approval_requests/monthly_attendances/{id} | 删除月度出勤结算申请 |
DefaultApi | destroy_approval_requests_overtime_work | DELETE /api/v1/approval_requests/overtime_works/{id} | 删除加班申请 |
DefaultApi | destroy_approval_requests_paid_holiday | DELETE /api/v1/approval_requests/paid_holidays/{id} | 删除带薪休假申请 |
DefaultApi | destroy_employee | DELETE /api/v1/employees/{id} | 删除员工 |
DefaultApi | destroy_employee_work_record | DELETE /api/v1/employees/{employee_id}/work_records/{date} | 删除出勤记录 |
DefaultApi | destroy_group | DELETE /api/v1/groups/{id} | 删除部门 |
DefaultApi | destroy_position | DELETE /api/v1/positions/{id} | 删除职位 |
DefaultApi | get_approval_flow_route | GET /api/v1/approval_flow_routes/{id} | 获取申请流程路由 |
DefaultApi | get_approval_flow_routes | GET /api/v1/approval_flow_routes | 获取申请流程路由列表 |
DefaultApi | get_approval_requests_monthly_attendance | GET /api/v1/approval_requests/monthly_attendances/{id} | 获取月度出勤结算申请 |
DefaultApi | get_approval_requests_monthly_attendances | GET /api/v1/approval_requests/monthly_attendances | 获取月度出勤结算申请列表 |
DefaultApi | get_approval_requests_overtime_work | GET /api/v1/approval_requests/overtime_works/{id} | 获取加班申请 |
DefaultApi | get_approval_requests_overtime_works | GET /api/v1/approval_requests/overtime_works | 获取加班申请列表 |
DefaultApi | get_approval_requests_paid_holiday | GET /api/v1/approval_requests/paid_holidays/{id} | 获取带薪休假申请 |
DefaultApi | get_approval_requests_paid_holidays | GET /api/v1/approval_requests/paid_holidays | 获取带薪休假申请列表 |
DefaultApi | get_bonuses_employee_payroll_statement | GET /api/v1/bonuses/employee_payroll_statements/{employee_id} | 获取奖金明细 |
DefaultApi | get_bonuses_employee_payroll_statements | GET /api/v1/bonuses/employee_payroll_statements | 获取奖金明细列表 |
DefaultApi | get_company_employees | GET /api/v1/companies/{company_id}/employees | 获取全期间员工列表 |
DefaultApi | get_employee | GET /api/v1/employees/{id} | 获取员工信息 |
DefaultApi | get_employee_bank_account_rule | GET /api/v1/employees/{employee_id}/bank_account_rule | 获取员工的银行账户信息 |
DefaultApi | get_employee_basic_pay_rule | GET /api/v1/employees/{employee_id}/basic_pay_rule | 获取员工的基本工资信息 |
DefaultApi | get_employee_dependent_rules | GET /api/v1/employees/{employee_id}/dependent_rules | 获取员工的抚养亲属信息 |
DefaultApi | get_employee_group_memberships | GET /api/v1/employee_group_memberships | 获取所属列表 |
DefaultApi | get_employee_health_insurance_rule | GET /api/v1/employees/{employee_id}/health_insurance_rule | 获取员工的健康保险信息 |
DefaultApi | get_employee_profile_rule | GET /api/v1/employees/{employee_id}/profile_rule | 获取员工的姓名、地址等信息 |
DefaultApi | get_employee_time_clock | GET /api/v1/employees/{employee_id}/time_clocks/{id} | 获取打卡记录 |
DefaultApi | get_employee_time_clocks | GET /api/v1/employees/{employee_id}/time_clocks | 获取打卡记录列表 |
DefaultApi | get_employee_time_clocks_available_types | GET /api/v1/employees/{employee_id}/time_clocks/available_types | 获取打卡可能类型 |
DefaultApi | get_employee_welfare_pension_insurance_rule | GET /api/v1/employees/{employee_id}/welfare_pension_insurance_rule | 获取员工的福利养老金保险信息 |
DefaultApi | get_employee_work_record | GET /api/v1/employees/{employee_id}/work_records/{date} | 获取出勤记录 |
DefaultApi | get_employee_work_record_summary | GET /api/v1/employees/{employee_id}/work_record_summaries/{year}/{month} | 获取出勤信息月度摘要 |
DefaultApi | get_employees | GET /api/v1/employees | 获取员工列表 |
DefaultApi | get_groups | GET /api/v1/groups | 获取部门列表 |
DefaultApi | get_positions | GET /api/v1/positions | 获取职位列表 |
DefaultApi | get_salaries_employee_payroll_statement | GET /api/v1/salaries/employee_payroll_statements/{employee_id} | 获取工资明细 |
DefaultApi | get_salaries_employee_payroll_statements | GET /api/v1/salaries/employee_payroll_statements | 获取工资明细列表 |
DefaultApi | get_users_me | GET /api/v1/users/me | 获取登录用户信息 |
DefaultApi | update_approval_requests_monthly_attendance | PUT /api/v1/approval_requests/monthly_attendances/{id} | 更新月度出勤结算申请 |
DefaultApi | update_approval_requests_overtime_work | PUT /api/v1/approval_requests/overtime_works/{id} | 更新加班申请 |
DefaultApi | 更新带薪休假申请 | PUT /api/v1/approval_requests/paid_holidays/{id} | 更新有给申请 |
DefaultApi | 更新员工 | PUT /api/v1/employees/{id} | 更新员工信息 |
DefaultApi | 更新员工银行账户规则 | PUT /api/v1/employees/{employee_id}/bank_account_rule | 更新员工的银行账户 |
DefaultApi | 更新员工基本工资规则 | PUT /api/v1/employees/{employee_id}/basic_pay_rule | 更新员工基本工资 |
DefaultApi | 更新员工健康保险规则 | PUT /api/v1/employees/{employee_id}/health_insurance_rule | 更新员工健康保险 |
DefaultApi | 更新员工个人信息规则 | PUT /api/v1/employees/{employee_id}/profile_rule | 更新员工姓名、地址等信息 |
DefaultApi | 更新员工福利养老金保险规则 | PUT /api/v1/employees/{employee_id}/welfare_pension_insurance_rule | 更新员工福利养老金保险 |
DefaultApi | 更新员工工作记录 | PUT /api/v1/employees/{employee_id}/work_records/{date} | 更新出勤记录 |
DefaultApi | 更新员工出勤月度摘要 | PUT /api/v1/employees/{employee_id}/work_record_summaries/{year}/{month} | 更新员工出勤信息月度汇总 |
DefaultApi | 更新部门 | PUT /api/v1/groups/{id} | 更新部门信息 |
DefaultApi | 更新职位 | PUT /api/v1/positions/{id} | 更新职位信息 |
模型文档
- 访问拒绝错误
- ApiV1ApprovalActionRequest
- ApiV1ApprovalFlowLogsParams
- ApiV1ApprovalFlowRouteIndexResponseParams
- ApiV1ApprovalFlowRouteResponse
- ApiV1ApprovalFlowRouteResponseParams
- ApiV1ApprovalFlowRoutesIndexResponse
- ApiV1BonusesEmployeePayrollStatementSerializer
- ApiV1BonusesEmployeePayrollStatementsControllerPeriodShowResponse
- ApiV1BonusesEmployeePayrollStatementsIndexSerializer
- ApiV1CompaniesEmployeeSerializer
- ApiV1EmployeeCreateRequestSerializer
- ApiV1EmployeeGroupMembershipSerializer
- ApiV1EmployeeGroupMembershipsIndexSerializer
- ApiV1EmployeeIndexSerializer
- ApiV1EmployeePayrollStatementsEmployeeAttendanceItemSerializer
- ApiV1EmployeePayrollStatementsEmployeeOvertimePayItemSerializer
- ApiV1EmployeePayrollStatementsEmployeePayrollStatementItemSerializer
- ApiV1EmployeeProfileCustomFieldSerializer
- ApiV1EmployeeSerializer
- ApiV1EmployeeUpdateRequestSerializer
- ApiV1EmployeesBankAccountRuleSerializer
- ApiV1EmployeesBankAccountRuleUpdateRequestSerializer
- ApiV1EmployeesBankAccountRulesControllerPeriodShowResponse
- ApiV1EmployeesBankAccountRulesControllerPeriodUpdateBody
- ApiV1EmployeesBankAccountRulesControllerPeriodUpdateResponse
- ApiV1EmployeesBasicPayRuleSerializer
- ApiV1EmployeesBasicPayRuleUpdateRequestSerializer
- ApiV1EmployeesBasicPayRulesControllerPeriodShowResponse
- ApiV1EmployeesBasicPayRulesControllerPeriodUpdateBody
- ApiV1EmployeesBasicPayRulesControllerPeriodUpdateResponse
- ApiV1EmployeesControllerPeriodCreateBody
- ApiV1EmployeesControllerPeriodCreateResponse
- ApiV1EmployeesControllerPeriodIndexResponse
- ApiV1EmployeesControllerPeriodShowResponse
- ApiV1EmployeesControllerPeriodUpdateBody
- ApiV1EmployeesControllerPeriodUpdateResponse
- ApiV1EmployeesDependentRuleSerializer
- ApiV1EmployeesDependentRuleUpdateRequestSerializer
- ApiV1EmployeesDependentRulesControllerPeriodBulkUpdateBody
- ApiV1EmployeesDependentRulesControllerPeriodBulkUpdateResponse
- ApiV1EmployeesDependentRulesControllerPeriodIndexResponse
- ApiV1EmployeesEmployeeMultiHourlyWageWorkRecordSummarySerializer
- ApiV1EmployeesHealthInsuranceRuleSerializer
- ApiV1EmployeesHealthInsuranceRuleUpdateRequestSerializer
- ApiV1EmployeesHealthInsuranceRulesControllerPeriodShowResponse
- ApiV1EmployeesHealthInsuranceRulesControllerPeriodUpdateBody
- ApiV1EmployeesHealthInsuranceRulesControllerPeriodUpdateResponse
- ApiV1EmployeesProfileRuleSerializer
- ApiV1EmployeesProfileRuleUpdateRequestSerializer
- ApiV1EmployeesProfileRulesControllerPeriodShowResponse
- ApiV1EmployeesProfileRulesControllerPeriodUpdateBody
- ApiV1EmployeesProfileRulesControllerPeriodUpdateResponse
- ApiV1EmployeesTimeClockSerializer
- ApiV1EmployeesTimeClocksControllerPeriodAvailableTypesResponse
- ApiV1EmployeesTimeClocksControllerPeriodCreateBody
- ApiV1EmployeesTimeClocksControllerPeriodCreateResponse
- ApiV1EmployeesTimeClocksControllerPeriodShowResponse
- ApiV1EmployeesWelfarePensionInsuranceRuleSerializer
- ApiV1EmployeesWelfarePensionInsuranceRuleUpdateRequestSerializer
- ApiV1EmployeesWelfarePensionInsuranceRulesControllerPeriodShowResponse
- ApiV1EmployeesWelfarePensionInsuranceRulesControllerPeriodUpdateBody
- ApiV1EmployeesWelfarePensionInsuranceRulesControllerPeriodUpdateResponse
- ApiV1EmployeesWorkRecordSerializer
- ApiV1EmployeesWorkRecordSummaryControllerPeriodUpdateBody
- ApiV1EmployeesWorkRecordSummarySerializer
- ApiV1EmployeesWorkRecordTimeRangeResponseSerializer
- ApiV1EmployeesWorkRecordTimeRangeSerializer
- ApiV1EmployeesWorkRecordsControllerPeriodUpdateBody
- ApiV1FlowRouteStepSrializerInner
- ApiV1GroupCreateRequest
- ApiV1GroupCreateRequestParams
- ApiV1GroupMembershipSerializer
- ApiV1GroupResponse
- ApiV1GroupResponseParams
- ApiV1GroupUpdateRequest
- ApiV1GroupUpdateRequestParams
- ApiV1GroupsIndexResponse
- ApiV1HolidaysAndHoursSerializer
- ApiV1MonthlyAttendanceCreateRequest
- ApiV1MonthlyAttendanceIndexResponse
- ApiV1MonthlyAttendanceIndexResponseParams
- ApiV1MonthlyAttendanceResponse
- ApiV1MonthlyAttendanceResponseParams
- ApiV1MonthlyAttendanceUpdateRequest
- ApiV1OvertimeWorkIndexResponse
- ApiV1OvertimeWorkIndexResponseParams
- ApiV1OvertimeWorkRequest
- ApiV1OvertimeWorkResponse
- ApiV1OvertimeWorkResponseParams
- ApiV1PaidHolidayIndexResponse
- ApiV1PaidHolidayIndexResponseParams
- ApiV1PaidHolidayRequest
- ApiV1PaidHolidayResponse
- ApiV1PaidHolidayResponseParams
- ApiV1PositionIndexResponse
- ApiV1PositionRequest
- ApiV1PositionRequestParams
- ApiV1PositionResponse
- ApiV1PositionResponseParams
- ApiV1ProfileCustomFieldGroupSerializer
- ApiV1SalariesEmployeePayrollStatementSerializer
- ApiV1SalariesEmployeePayrollStatementsControllerPeriodIndexResponse
- ApiV1SalariesEmployeePayrollStatementsControllerPeriodShowResponse
- ApiV1UsersCompanySerializer
- ApiV1UsersMeSerializer
- 错误
- 错误ErrorsInner
- 禁止访问错误
- 禁止访问错误ErrorsInner
- 内部服务器错误
- 内部服务器错误ErrorsInner
- 未找到错误
- 未找到错误ErrorsInner
- 未授权错误
要获取crate生成的文档,请使用
cargo doc --open
作者
依赖项
~4–17MB
~245K SLoC