休假 API
目的
添加休假 API 用于添加休假记录;获取休假详情 API 用于列示您的 Zoho People 帐户中可用的休假类型及其详情;获取假日 API 用于使用员工的员工 ID、邮箱地址和记录 ID 参数来提取任意员工的特定假日。
添加休假 API
用途:
您可使用以下 API 来添加休假记录。
注:
- 请参阅 API 参考页以查看表单及其相应字段值列表。必须以管理员身份登录才可查看该页面。
请求 URL:
https://people.zoho.com.cn/people/api/leave/records?authtoken=<token>&xmlData=<xmlData>
请求参数
authtoken | 指定身份验证令牌 |
xmlData | 示例输入:<Request><Record><field name="Labelname">value</field><field name="LabelName1">value1</field><field name="Labelname2">value2</field></Record></Request> |
示例 URL
https://people.zoho.com.cn/people/api/leave/records?authtoken=7d985878998943g4j09h43dd0b167dda34b &xmlData=<Request><Record><field name='Employee_ID'>3000000020481</field><field name='To'>30-Jan-2013</field><field name='From'>30-Jan-2013</field><field name='Leavetype'>3000000046003</field></Record></Request>
XML 响应:
<Response Status="1">
<message>Successfully Added</message>
</Response>
JSON 响应:
[{"message":"Successfully Added","Response":1}]
获取休假类型 API
用途:
您可使用以下API 获取特定员工的休假类型。
请求 URL:
https://people.zoho.com.cn/people/api/leave/getLeaveTypeDetails?authtoken=<token>&userId=<userId>
请求参数
authtoken | 指定身份验证令牌 |
userId | 员工 Id/员工 MailId/员工的记录 Id |
示例 URL
https://people.zoho.com.cn/people/api/leave/getLeaveTypeDetails?authtoken=9c69640f94ebb37f50ca148734b2c5e4&userId=1
https://people.zoho.com.cn/people/api/leave/getLeaveTypeDetails?authtoken=9c69640f94ebb37f50ca148734b2c5e4&userId=charless@zohocorp.com
https://people.zoho.com.cn/people/api/leave/getLeaveTypeDetails?authtoken=9c69640f94ebb37f50ca148734b2c5e4&userId=3000000020481
XML 响应:
<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/leave/getLeaveTypeDetails">
<status>0</status>
<message>Data fetched successfully</message>
<result>
<LeaveType>
<Name>DayBased</Name>
<PermittedCount>90.0</PermittedCount>
<AvailedCount>0.0</AvailedCount>
<Id>3000000030001</Id>
<Unit>Days</Unit>
<BalanceCount>90.0</BalanceCount>
</LeaveType>
<LeaveType>
<Name>Emp based</Name>
<PermittedCount>60.0</PermittedCount>
<AvailedCount>0.0</AvailedCount>
<Id>3000000099013</Id>
<Unit>Days</Unit>
<BalanceCount>60.0</BalanceCount>
</LeaveType>
<LeaveType>
<Name>HalfDayBased</Name>
<PermittedCount>70.0</PermittedCount>
<AvailedCount>0.0</AvailedCount>
<Id>3000000046003</Id>
<Unit>Days</Unit>
<BalanceCount>70.0</BalanceCount>
</LeaveType>
<LeaveType>
<Name>Hour based</Name>
<PermittedCount>20.0</PermittedCount>
<AvailedCount>0.0</AvailedCount>
<Id>3000000046007</Id>
<Unit>Hours</Unit>
<BalanceCount>20.0</BalanceCount>
</LeaveType>
</result>
</response>
JSON 响应:
{ "response":
"message": "Data fetched successfully",
"result": [
{ "Name": "DayBased",
"PermittedCount": 90,
"AvailedCount": 0,
"Id": 3000000030001,
"Unit": "Days",
"BalanceCount": 90
}, { "Name": "Emp based",
"PermittedCount": 60,
"AvailedCount": 0,
"Id": 3000000099013,
"Unit": "Days",
"BalanceCount": 60
}, { "Name": "HalfDayBased",
"PermittedCount": 70,
"AvailedCount": 0,
"Id": 3000000046003,
"Unit": "Days",
"BalanceCount": 70
}, { "Name": "Hour based",
"PermittedCount": 20,
"AvailedCount": 0,
"Id": 3000000046007,
"Unit": "Hours",
"BalanceCount": 20
} ], "status": 0,
"uri": "/api/leave/getLeaveTypeDetails"
} }
获取假日 API
用途:
此 API 用于使用员工的员工 Id、邮箱地址和记录 ID 参数来提取任意员工的特定假日。
请求 URL:
https://people.zoho.com.cn/people/api/leave/getHolidays?authtoken=<token>&userId=<userId>
请求参数
authtoken | 指定身份验证令牌 |
userId | 员工 Id/员工 MailId/员工的记录 Id |
示例 URL
https://people.zoho.com.cn/people/api/leave/getHolidays?authtoken=9c69640f94ebb37f50ca148734b2c5e4&userId=2
https://people.zoho.com.cn/people/api/leave/getHolidays?authtoken=9c69640f94ebb37f50ca148734b2c5e4&userId=karenjohn@zykler.com
https://people.zoho.com.cn/people/api/leave/getHolidays?authtoken=9c69640f94ebb37f50ca148734b2c5e4&userId=3000000011693
XML 响应:
<?xml version="1.0" encoding="UTF-8"?>
<response uri="/api/leave/getHolidays">
<status>0</status>
<message>Data fetched successfully</message>
<result>
<Holiday>
<Name>Test</Name>
<Remarks></Remarks>
<Id>3000000065001</Id>
</Holiday>
<Holiday>
<Name>Tokyo</Name>
<LocationId>3000000237009;3000000237010;3000000237011</LocationId>
<LocationName>Tokyo;Chennai;New York</LocationName>
<Remarks></Remarks>
<Id>3000000237021</Id>
</Holiday>
</result>
</response>
JSON 响应:
{ "response": {
"message": "Data fetched successfully",
"result": [
{ "Name": "Test",
"LocationId": "",LocationName": "",
"Remarks": "",
"Id": 3000000065001 }, { "Name": "Tokyo",
"LocationId": "3000000237009;3000000237010;3000000237011", "LocationName": "Tokyo;Chennai;New York"
"Remarks": "",
"Id": 3000000237021 } ], "status": 0, "uri": "/api/leave/getHolidays" } }
错误代码
请参阅错误代码。