时间记录 API

目的

此 API 用于获取时间记录,以及用于添加、修改和删除时间记录。

获取时间记录 API

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

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/gettimelogs?authtoken=<authtoken>&fromDate=<fromDate>&toDate= <toDate>&billingStatus=<billingStatus>&jobId=<jobId>&user =<user>&dateFormat=<dateFormat>

请求参数:

authtoken 指定身份验证令牌
user 指定员工记录编号或邮箱地址或员工 ID
fromDate 指定起始日期
toDate 指定截止日期
billingStatus 将计费状态指定为可计费或不可计费或为所有计费状态指定二者
jobId 指定工作 ID 或为所有工作选择全部
dateFormat 指定日期格式

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/gettimelogs?authtoken=ffb014e4d3af62aa74c7db66eff557fc&user=charless.stones%2Bsguru1%40zohocorp.com&jobId=0&fromDate=2014-12-01&toDate=2014-12-31&billingStatus=all

XML 响应:

<response uri="/api/timetracker/gettimelogs">
<status>0</status>
<message>Data fetched successfully</message>
<result>
<timeLog>
<workDate>2014-12-22</workDate>
<jobId>281496000000213662</jobId>
<erecno>281496000000054071</erecno>
<hours>20:00</hours>
<fromTime>0</fromTime>
<type>0</type>
<jobName>test2</jobName>
<taskName />
<toTime>0</toTime>
<timelogId>281496000000232570</timelogId>
<jobIsCompleted>0</jobIsCompleted>
<description>asdf</description>
<jobIsActive>1</jobIsActive>
<totaltime>72000</totaltime>
<billingStatus>non-billable</billingStatus>
<timerLog>false</timerLog>
</timeLog>
<timeLog>
<workDate>2014-12-23</workDate>
<jobId>281496000000242015</jobId>
<erecno>281496000000054071</erecno>
<hours>20:00</hours>
<fromTime>0</fromTime>
<type>0</type>
<jobName>charless job</jobName>
<taskName>asfd</taskName>
<toTime>0</toTime>
<timelogId>281496000000242021</timelogId>
<jobIsCompleted>0</jobIsCompleted>
<description>asf</description>
<jobIsActive>1</jobIsActive>
<totaltime>72000</totaltime>
<billingStatus>billable</billingStatus>
<timerLog>false</timerLog>
</timeLog>
</result>
</response>

JSON 响应:

{ "response": { "message": "Data fetched successfully", "result": [ { "workDate": "2014-12-22", "jobId": "281496000000213662", "erecno": "281496000000054071", "hours": "20:00", "fromTime": 0, "type": "0", "jobName": "test2", "taskName": "", "toTime": 0, "timelogId": "281496000000232570", "jobIsCompleted": 0, "description": "asdf", "jobIsActive": 1, "totaltime": 72000, "billingStatus": "non-billable", "timerLog": false }, { "workDate": "2014-12-23", "jobId": "281496000000242015", "erecno": "281496000000054071", "hours": "20:00", "fromTime": 0, "type": "0", "jobName": "charless job", "taskName": "asfd", "toTime": 0, "timelogId": "281496000000242021", "jobIsCompleted": 0, "description": "asf", "jobIsActive": 1, "totaltime": 72000, "billingStatus": "billable", "timerLog": false } ], "status": 0, "uri": "/api/timetracker/gettimelogs" } }

添加时间记录 API

此 API 用于添加时间记录。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/addtimelog?authtoken=<authtoken>&user=<user>&workDate= <workDate>&jobId =<jobId>&hours =<hours>&fromTime=<fromTime>&toTime=<toTime>&workItem=<workItem>&billingStatus =<billingStatus>&description =<description>

请求参数:

authtoken 指定身份验证令牌
user 指定员工记录编号或邮箱地址或员工 ID
workDate 指定工作日期
billingStatus 指定计费状态
jobId 指定工作 ID
hours 指定小时数
fromTime 指定起始时间
toTime 指定截止时间
description 指定描述
workItem 指定工作项

示例 URL:

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

XML 响应:

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

JSON 响应:

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

修改时间记录 API

此 API 用于编辑时间记录。

请求 URL:

http://people.zoho.com.cn/people/api/timetracker/edittimelog?authtoken=<authtoken>&timeLogId=<timeLogId>&user= <user>&workDate =<workDate>&jobId =<jobId>&hours=<hours>&fromTime=<fromTime>&toTime=<toTime>&billingStatus =<billingStatus>&description =<description>&workItem=<workItem>

请求参数:

authtoken 指定身份验证令牌
user 指定员工记录编号或邮箱地址或员工 ID
timeLogId 指定时间记录 ID
workItem 指定工作项
workDate 指定工作日期
billingStatus 指定计费状态
jobId 指定工作 ID
hours 指定小时数
fromTime 指定起始时间
toTime 指定截止时间
description 指定描述

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/edittimelog?authtoken=28ac426a249678c8867a0d93bb373912&timeLogId=177402000000814321&workItem=web designing&user=charless.stones%2Bsguru1%40zohocorp.com&jobName=Testigapi&workDate=2015-01-05&billingStatus=Billable&hours=10

XML 响应:

<response uri="/api/timetracker/edittimelog">
<status>0</status>
<message>Timelog entry edited Successfully</message>
<result>
<timeLogId>281496000000484013</timeLogId>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timelog entry edited Successfully", "result": [ { "timeLogId": "281496000000484009" } ], "status": 0, "uri": "/api/timetracker/edittimelog" } }

删除时间记录 API

此 API 用于删除时间记录。

请求 URL:

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

请求参数:

authtoken 指定身份验证令牌
timeLogId 指定时间记录 ID(用逗号分隔)

示例 URL:

http://people.zoho.com.cn/people/api/timetracker/deletetimelog?authtoken=28ac426a249678c8867a0d93bb373912&timeLogId=177402000000814321

XML 响应:

<response uri="/api/timetracker/deletetimelog">
<status>0</status>
<message>Timelog entry deleted Successfully</message>
<result>
<timeLogId>281496000000484013</timeLogId>
</result>
</response>

JSON 响应:

{ "response": { "message": "Timelog entry deleted Successfully", "result": [ { "timeLogId": "281496000000484009" } ], "status": 0, "uri": "/api/timetracker/deletetimelog" } }