计时器 API

目的

此 API 用于启动新计时器、恢复/暂停现有的计时器、获取当前运行的计时器、为计时器添加注释、为计时器删除注释和为计时器获取注释。

启动计时器 API

此 API 用于启动新计时器。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/timer?authtoken=<authtoken>&user=<user>&workDate= <workDate>&jobId=<jobId>&timer=<timer>&workItem= <workItem>&dateFormat=<dateFormat>&billingStatus=<billingStatus>&description= <description>

请求参数:

authtoken 指定身份验证令牌
user 指定全部 ID 或员工记录编号或邮箱地址或员工 ID
workDate 指定工作日期
workItem 指定工作项
jobId 指定工作 ID
timer 指定为启动
billingStatus 指定计费状态为可计费或不可计费
description 指定描述
dateFormat 指定日期格式

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/timer?authtoken=28ac426a249678c8867a0d93bb373912&user=charless.stones%2Bsguru1%40zohocorp.com&jobName=Testigapi&workDate=2015-01-05&timer=start&billingStatus=Billable

XML 响应:

<response uri="/api/timetracker/timer">
<status>0</status>
<message>Timelog entry added Successfully</message>
<result>
<timeLogId>281496000000484021</timeLogId>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timelog entry added Successfully", "result": [ { "timeLogId": "281496000000484027" } ], "status": 0, "uri": "/api/timetracker/timer" } }

暂停/恢复计时器 API

此 API 用于恢复/暂停现有的计时器。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/timer?authtoken=<authtoken>&timeLogId=<timeLogId>&timer=<timer>

请求参数:

authtoken 指定身份验证令牌
timeLogId 指定时间记录 Id
timer 指定启动或停止

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/timer?authtoken=28ac426a249678c8867a0d93bb373912&timeLogId=281496000000264017&timer=start

XML 响应:

<response uri="/api/timetracker/timer">
<status>0</status>
<message>Timer Paused successfully</message>
<result>null</result>
</response>

JSON 响应:

{ "response": { "message": "Timer Paused successfully", "status": 0, "uri": "/api/timetracker/timer" } }

获取当前运行的计时器 API

此 API 用于获取当前运行的计时器。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/getcurrentlyrunningtimer?authtoken=<authtoken>&dateFormat=<dateFormat>

请求参数:

authtoken 指定身份验证令牌
dateFormat 指定日期格式

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/getcurrentlyrunningtimer?authtoken=28ac426a249678c8867a0d93bb373912&dateFormat=yyyy-MM-dd

XML 响应:

<response uri="/api/timetracker/getcurrentlyrunningtimer">
<status>0</status>
<message>Running Timer information fetched successfully</message>
<result>
<timer>
<timerId>281496000000484031</timerId>
<workDate>2015-05-18</workDate>
<jobId>281496000000479001</jobId>
<diff>313</diff>
<hours>0</hours>
<employeename>guru F</employeename>
<fromTime>41855</fromTime>
<totaltime>0</totaltime>
<date>42168</date>
<billingStatus>billable</billingStatus>
<jobName>Testigapi</jobName>
<timelogId>281496000000484027</timelogId>
</timer>
</result>
</response>

JSON 响应:

{ "response": { "message": "Running Timer information fetched successfully", "result": { "timerId": "281496000000484031", "workDate": "2015-05-18", "jobId": "281496000000479001", "diff": 414, "hours": 0, "employeename": "guru F", "fromTime": 41855, "totaltime": 0, "date": 42269, "billingStatus": "billable", "jobName": "Testigapi", "timelogId": "281496000000484027" }, "status": 0, "uri": "/api/timetracker/getcurrentlyrunningtimer" } }

获取计时器注释 API

此 API 用于获取计时器 API 的注释。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/getcomments?authtoken=<authtoken>&timeLogId=<timeLogId>

请求参数:

authtoken 指定身份验证令牌
timeLogId 指定时间记录 Id

示例 URL:

https://people.zoho.com.cn/people/api/timetracker/getcomments?authtoken=1408d03bff741277ec9465eca625d390&timeLogId=177402000000936001

XML 响应:

<response uri="/api/timetracker/getcomments">
<status>0</status>
<message>Timer Comments fetched successfully</message>
<result>
<Comment>
<createdTime>12:06:14</createdTime>
<comment>Completed testing the security issues.</comment>
<commentId>177402000000936007</commentId>
</Comment>
<Comment>
<createdTime>12:06:55</createdTime>
<comment>Notified the issues to the Reporting Manager</comment>
<commentId>177402000000936009</commentId>
</Comment>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timer Comments fetched successfully", "result": [ { "createdTime": "12:06:14", "comment": "Completed testing the security issues.", "commentId": "177402000000936007" }, { "createdTime": "12:06:55", "comment": "Notified the issues to the Reporting Manager", "commentId": "177402000000936009" } ], "status": 0, "uri": "/api/timetracker/getcomments" } }

添加计时器注释 API

此 API 用于为计时器 API 添加注释。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/addcomment?authtoken=<authtoken>&timeLogId=<timeLogId>&comment=<comment>

请求参数:

authtoken 指定身份验证令牌
timeLogId 指定时间记录 Id
comment 指定注释

示例 URL:

people/api/timetracker/addcomment?authtoken=745bd43eff7a164a02bad52f0011fd35&timeLogId=293141000000147001&comment=charless

XML 响应:

<response uri="/api/timetracker/addcomment">
<status>0</status>
<message>Timer Comment Added successfully</message>
<result>
<commentId>293141000000144061<commentId>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timer Comment Added successfully", "result": [ { "commentId": "293141000000144059" } ], "status": 0, "uri": "/api/timetracker/addcomment" } }

删除计时器注释 API

此 API 用于删除计时器 API 的注释。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/deletecomment?authtoken=<authtoken>&commentId=<commentId>

请求参数:

authtoken 指定身份验证令牌
commentId 指定注释 ID

示例 URL:

https://people.zoho.com.cn/people/api/timetracker/deletecomment?authtoken=745bd43eff7a164a02bad52f0011fd35&commentId=293141000000144053

XML 响应:

<response uri="/api/timetracker/deletecomment">
<status>0</status>
<message>Timer Comment deleted successfully</message>
<result>
<commentId>293141000000144061<commentId>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timer Comment deleted successfully", "status": 0, "uri": "/api/timetracker/deletecomment" } }