时间表 API

目的

此 API 用于获取时间表,以及用于创建、修改和删除时间表。

获取时间表 API

此 API 用于获取时间表列表。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/gettimesheet?authtoken=<authtoken>&user=<user>&approvalStatus=<approvalStatus>

请求参数:

authtoken 指定身份验证令牌
user 指定员工记录编号或邮箱地址或员工 ID
approvalStatus 指定审批状态:全部、草稿、等待审批、已批准或已拒绝

示例 URL:

people.zoho.com.cn/people/api/timetracker/gettimesheet?authtoken=48552851f39b2455991e8eeab1a67d80&user=1&approvalStatus=pending

XML 响应:

<response uri="/api/timetracker/gettimesheet">
<status>0</status>
<message>Data fetched successfully</message>
<result>
<timesheet>
<erecno>293141000000061007</erecno>
<status>Pending</status>
<timesheetName>Timesheet</timesheetName>
<approvedBillableHours>0</approvedBillableHours>
<toDate>2015-05-14</toDate>
<employeeName>Guru F Guru L</employeeName>
<currency>USD</currency>
<ratePerHour>5.0</ratePerHour>
<approvedNonBillableHours>0</approvedNonBillableHours>
<approvedTotalAmount>0.0</approvedTotalAmount>
<fromDate>2015-05-14</fromDate>
<nonbillableHours>720</nonbillableHours>
<description>API input11</description>
<approvedTotalHours>0</approvedTotalHours>
<approvedRatePerHour>0.0</approvedRatePerHour>
<owner>293141000000061007</owner>
<totalAmount>210.0</totalAmount>
<totalHours>3240</totalHours>
<billableHours>2520</billableHours>
</timesheet>
<timesheet>
<erecno>293141000000061007</erecno>
<status>Pending</status>
<timesheetName>Timesheet_1</timesheetName>
<approvedBillableHours>0</approvedBillableHours>
<toDate>2015-05-14</toDate>
<employeeName>Guru F Guru L</employeeName>
<currency>USD</currency>
<ratePerHour>5.0</ratePerHour>
<approvedNonBillableHours>0</approvedNonBillableHours>
<approvedTotalAmount>0.0</approvedTotalAmount>
<fromDate>2015-05-14</fromDate>
<nonbillableHours>0</nonbillableHours>
<description>Time sheet description</description>
<approvedTotalHours>0</approvedTotalHours>
<approvedRatePerHour>0.0</approvedRatePerHour>
<owner>293141000000061007</owner>
<totalAmount>0.0</totalAmount>
<totalHours>0</totalHours>
<billableHours>0</billableHours>
</timesheet>
<timesheet>
<erecno>293141000000061007</erecno>
<status>Pending</status>
<timesheetName>Timesheet_1</timesheetName>
<approvedBillableHours>0</approvedBillableHours>
<toDate>2015-05-14</toDate>
<employeeName>Guru F Guru L</employeeName>
<currency>USD</currency>
<ratePerHour>5.0</ratePerHour>
<approvedNonBillableHours>0</approvedNonBillableHours>
<approvedTotalAmount>0.0</approvedTotalAmount>
<fromDate>2015-05-14</fromDate>
<nonbillableHours>0</nonbillableHours>
<description>Time sheet description</description>
<approvedTotalHours>0</approvedTotalHours>
<approvedRatePerHour>0.0</approvedRatePerHour>
<owner>293141000000061007</owner>
<totalAmount>0.0</totalAmount>
<totalHours>0</totalHours>
<billableHours>0</billableHours>
</timesheet>
<timesheet>
<erecno>293141000000061007</erecno>
<status>Pending</status>
<timesheetName>Timesheet_1</timesheetName>
<approvedBillableHours>0</approvedBillableHours>
<toDate>2015-05-14</toDate>
<employeeName>Guru F Guru L</employeeName>
<currency>USD</currency>
<ratePerHour>5.0</ratePerHour>
<approvedNonBillableHours>0</approvedNonBillableHours>
<approvedTotalAmount>0.0</approvedTotalAmount>
<fromDate>2015-05-14</fromDate>
<nonbillableHours>0</nonbillableHours>
<description>Time sheet description</description>
<approvedTotalHours>0</approvedTotalHours>
<approvedRatePerHour>0.0</approvedRatePerHour>
<owner>293141000000061007</owner>
<totalAmount>0.0</totalAmount>
<totalHours>0</totalHours>
<billableHours>0</billableHours>
</timesheet>
</result>
</response>

JSON 响应:

{ "response": { "message": "Data fetched successfully", "result": [ { "erecno": "293141000000061007", "status": "Pending", "timesheetName": "Timesheet", "approvedBillableHours": 0, "toDate": "2015-05-14", "employeeName": "Guru F Guru L", "currency": "USD", "ratePerHour": 5, "approvedNonBillableHours": 0, "approvedTotalAmount": 0, "fromDate": "2015-05-14", "nonbillableHours": 720, "description": "API input11", "approvedTotalHours": 0, "approvedRatePerHour": 0, "owner": "293141000000061007", "totalAmount": 210, "totalHours": 3240, "billableHours": 2520 }, { "erecno": "293141000000061007", "status": "Pending", "timesheetName": "Timesheet_1", "approvedBillableHours": 0, "toDate": "2015-05-14", "employeeName": "Guru F Guru L", "currency": "USD", "ratePerHour": 5, "approvedNonBillableHours": 0, "approvedTotalAmount": 0, "fromDate": "2015-05-14", "nonbillableHours": 0, "description": "Time sheet description", "approvedTotalHours": 0, "approvedRatePerHour": 0, "owner": "293141000000061007", "totalAmount": 0, "totalHours": 0, "billableHours": 0 }, { "erecno": "293141000000061007", "status": "Pending", "timesheetName": "Timesheet_1", "approvedBillableHours": 0, "toDate": "2015-05-14", "employeeName": "Guru F Guru L", "currency": "USD", "ratePerHour": 5, "approvedNonBillableHours": 0, "approvedTotalAmount": 0, "fromDate": "2015-05-14", "nonbillableHours": 0, "description": "Time sheet description", "approvedTotalHours": 0, "approvedRatePerHour": 0, "owner": "293141000000061007", "totalAmount": 0, "totalHours": 0, "billableHours": 0 }, { "erecno": "293141000000061007", "status": "Pending", "timesheetName": "Timesheet_1", "approvedBillableHours": 0, "toDate": "2015-05-14", "employeeName": "Guru F Guru L", "currency": "USD", "ratePerHour": 5, "approvedNonBillableHours": 0, "approvedTotalAmount": 0, "fromDate": "2015-05-14", "nonbillableHours": 0, "description": "Time sheet description", "approvedTotalHours": 0, "approvedRatePerHour": 0, "owner": "293141000000061007", "totalAmount": 0, "totalHours": 0, "billableHours": 0 } ], "status": 0, "uri": "/api/timetracker/gettimesheet" } }

创建时间表 API

此 API 用于创建时间表。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/createtimesheet?authtoken=<authtoken>&user=<user>&timesheetName=<timesheetName>&description=<description>&sendforApproval=<sendforApproval>&fromDate=<fromDate>&toDate=<toDate>&jobId=<jobId>&billingStatus=<billingStatus>

请求参数:

authtoken 指定身份验证令牌
user 指定员工记录编号或邮箱地址或员工 ID
timesheetName 指定时间表名称
description 指定描述
sendforApproval 指定 true 或 false
fromDate 指定起始日期
toDate 指定截止日期
jobId 指定工作 ID
billingStatus 指定计费状态

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/createtimesheet?authtoken=48552851f39b2455991e8eeab1a67d80&user=293141000000061007&timesheetName=Timesheet_1&description=Time sheet description&sendforApproval=true&fromDate=2015-05-14&toDate=2015-05-14&jobId=all&billingStatus=nonbillable

XML 响应:

<response uri="/api/timetracker/createtimesheet">
<status>0</status>
<message>Timesheet created successfully</message>
<result>
<timesheetId>293141000000146001</timesheetId>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timesheet created successfully", "result": [ { "timesheetId": "293141000000146007" } ], "status": 0, "uri": "/api/timetracker/createtimesheet" } }

修改时间表 API

此 API 用于修改时间表。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/modifytimesheet?authtoken=<authtoken>&timesheetId=<timesheetId>&timesheetName=<timesheetName>&description=<description>&sendforApproval=<sendforApproval>

请求参数:

authtoken 指定身份验证令牌
timesheetId 指定时间表 ID
timesheetName 指定时间表名称
description 指定描述
sendforApproval 指定 true 或 false

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/modifytimesheet?authtoken=48552851f39b2455991e8eeab1a67d80&timesheetId=293141000000061007&timesheetName=Timesheet_1&description=Time sheet description&sendforApproval=true

XML 响应:

<response uri="/api/timetracker/modifytimesheet">
<status>0</status>
<message>Timesheet modified successfully</message>
<result>
<timesheetId>293141000000146001</timesheetId>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timesheet modified successfully", "result": [ { "timesheetId": "293141000000146007" } ], "status": 0, "uri": "/api/timetracker/modifytimesheet" } }