目的

此页列出用于上传、添加、删除和编辑文件的 API。 

上传文件:

请求 URL

https://people.zoho.com.cn/people/api/files/json/uploadFile?authtoken=<token>&uploadfile=<file>

请求参数

authtoken 指定身份验证令牌
uploadfile 指定上传文件

回复

XML 响应:-

<response uri="/api/files/xml/uploadFile">
<status>0</status>
<message>Uploaded successfully
<result></result>
<message>Successfully Added</message>
<filepath>4319220/1478050780330/FileCabinet/offerletter.png</filepath></response>
 

JSON 响应:-

{"response":{"message":"Uploaded successfully","result":{"FILEPATH":"4319220/1478050780330/FileCabinet/offerletter.png","FILENAME":"offer-letter.png"},"status":0,"uri":"/api/files/json/uploadFile"}}

添加文件

请求 URL

https://people.zoho.com.cn/people/api/files/json/addFile?authtoken=<token>&fileName=<fileName>&filePath=<filePath>&fileDesc=<fileDesc>&fileType=<fileType>&confidential=<confidential>&role=<roleId>&catId=<categoryId>&fileforempID=<employeeId>&isreportingTo=<isreportingTo>&notifyToall=<notifyToall>&location=<locationId>&newCatName=<newCatName>

请求参数

authtoken 指定身份验证令牌
fileName  指定文件名
filePath 获取上传文件的文件路径并指定
fileDesc  指定文件描述
 
fileType  指定 1 以添加公司文件(或)指定 0 以添加人力资源文件
confidential 指定为 true 可标记员工机密文件
 
role  指定角色 ID
catId  指定文件类别 ID
fileforempID 指定员工 ID
isreportingTo 如果报告经理可看到他/她下属的文件,指定为 true 以标记 isreportingto 选项
notifyToall 将 notifyToall 选项指定为 true 以发送邮件
location 指定地点 ID
newCatName 指定新类别名称

示例 URL

https://people.zoho.com.cn/people/api/files/json/addFile?authtoken=7d985878998943g4j09h43dd0b167dda34b&fileName=offer-letter.png&fileName=offer-letter.png& filePath=4319220/1478050780330/FileCabinet/offerletter.png&fileDesc=fileapi&fileType=1(or)0&confidential=0&role=6000000043061&catId=6000000043062&fileforempID=6000000043063& isreportingTo=0(or)&notifyToall=true(or)false&location=6000000043064& newCatName=offerletter

回复

XML 响应 

<response uri="/api/files/xml/addFile">
<status0></status>
<message>Data added successfully</message>
<result>
<message>Successfully Added</message>
<FILEID>6000000043065</FILEID>
</result>
</response>

JSON 响应

{"response":{"message":"Data added successfully","result":{"FILEID":6000000043065},"status":0,"uri":"/api/files/json/addFile"}}

编辑文件

请求 URL

https://people.zoho.com.cn/people/api/files/json/editFile?authtoken= 7d985878998943g4j09h43dd0b167dda34b&fileName=<fileName>&filePath=<filePath>&fileDesc=<fileDesc>&fileType=<fileType>&confidential=<confidential>&role=<roleId>&catId=<categoryId>&fileforempID=<employeeId>&isreportingTo=<isreportingTo>&notifyToall=<notifyToall>&location=<locationId>&newCatName=<newCatName>&fileId=<fileId>

请求参数 

authtoken 指定身份验证令牌
fileName 指定文件名
filePath 获取上传文件的文件路径并指定
fileDesc 指定文件描述
fileType 指定 1 以添加公司文件(或)指定 0 以添加人力资源文件
confidential 指定为 true 可标记员工机密文件
role  指定角色 ID
catId 指定文件类别 ID
fileforempID  指定员工 ID
isreportingTo 如果报告经理可看到他/她下属的文件,指定为 true 以标记 isreportingto 选项
notifyToall 将 notifyToall 选项指定为 true 以发送邮件
location  指定地点 ID
newCatName 指定新类别名称
fileId 指定您想要编辑的字段

示例 URL

https://people.zoho.com.cn/people/api/files/json/editFile?

authtoken=7d985878998943g4j09h43dd0b167dda34b&fileName=payslip.png&filePath=4319220/1478050780330/FileCabinet/payslip.png&fileDesc=fileapi&fileType=1(or)0&confidential=0&role=6000000043061&catId=6000000043062&fileforempID=6000000043063&isreportingTo=0(or)1¬ifyToall=true(or)false&location=6000000043064&newCatName=editofferletter&fileId=6000000043065

XML 响应

<response uri="/api/files/xml/editFile">
<status>0</status>
<message>
Data updated successfully
<result>
<message>Successfully Updated</message>
<FILEID>6000000043065</FILEID>
</result>
</response>

删除文件

请求 URL 

https://people.zoho.com.cn/people/api/files/json/deleteFiles?authtoken=<token>& deleteFileId=<fileId>

请求参数

authtoken 指定身份验证令牌
deleteFileId 指定想要删除的文件 ID

示例 URL

https://people.zoho.com.cn/people/api/files/json/deleteFiles?authtoken=7d985878998943g4j09h43dd0b167dda34b&deleteFileId=6000000043065

:您可给出多个文件 ID 以删除文件。

获取文件类别

请求 URL 

https://people.zoho.com.cn/people/api/files/json/getCategories?authtoken=<token>

请求参数 

authtoken 指定身份验证令牌

回复

XML 响应

<response uri="/api/files/xml/getCategories">
<status>0</status>
<message>Data fetched successfully</message>
<result>
[{"CatID":"3000000012007","CatName":"OfferLetter"},{"CatID":"3000000036001","CatName":"Payslip"},
</result>
</response>

JSON 响应

{"response":{"message":"Data fetched successfully","result":{"CatID":3000000012007,"CatName":"OfferLetter"},"status":0,"uri":"/api/files/json/getCategories"}}

获取文件 

请求 URL 

https://people.zoho.com.cn/people/api/files/json/getAllFiles?authtoken=<token>&fileType=<fileType>&start=<start>&limit=<limit>&roleId=<roleId>&catId=<catId>&employeeId=<employeeId>&locationId=<locationId>&filterBy=<filterBy>

请求参数 

authtoken 指定身份验证令牌
fileType 指定 1 以获取公司文件(或)指定 0 以获取人力资源文件
start 指定开始限制
limit 指定结束限制
roleId  指定角色 ID
catId 指定文件类别 ID
employeeId  指定员工 ID
locationId

指定地点 ID

filterBy 指定以下过滤器(“全部”、“我的”、“下属”、“所有角色”、“我的角色”)

示例 URL

https://people.zoho.com.cn/people/api/files/json/getAllFiles?authtoken=7d985878998943g4j09h43dd0b167dda34b&fileType=0&start=0&limit=25&roleId=6000000043061&catId=6000000043062&employeeId=6000000043063&locationId=6000000043064&filterBy=my

回复 

XML 响应

<response uri="/api/files/xml/getAllFiles">
<status>0</status>
<message>Data fetched successfully</message>
<result>

[{"fileName":"payslip.html","fileCatName":"3","filePath":"1480399880022FileCabinet/payslip.txt","fileRoleID":"","fileDate":"11-29-2016","fileDesc":"","fileLocationID":"","decryptfilePath":"1480399880022FileCabinet/payslip.txt","fileCreateByName":"","fileConfident":0,"fileCategoryID":"2790000000304003","fileOwnerID":"","isreportingTo":0,"fileUsageSpace":1313890,"fileType":1,"fileID":"27900000003390032"},

{"fileName":"offerletter.txt","fileCatName":"offerletter","filePath":"1480399918832FileCabinet/offerletter.txt","fileRoleID":"","fileDate":"11-29-2016","fileDesc":"","fileLocationID":"","decryptfilePath":"1480399918832FileCabinet/offerletter.txt","fileCreateByName":"","cats":[{"getFileCatName":"3","getFileCatId":"2790000000304009"},{"getFileCatName":"99","getFileCatId":"2790000000145005"}],"fileConfident":0,"fileCategoryID":"2790000000145005","fileOwnerID":"","isreportingTo":0,"fileUsageSpace":1313790,"fileType":1,"fileID":"27900000003380023"}]

</result>
</response>

JSON 响应

{"response":{"result":{"RESULT":[{"fileOwnerName":"John g","fileName":"Payslip","fileCatName":"Payroll","filePath":"14748722981FileCabinet/usecase.rtf","fileRoleID":"","fileDate":"11-30-2016","fileDesc":"","fileLocationID":"","decryptfilePath":"1479448722981FileCabinet/usecase.rtf","fileCreateByName":"","cats":[{"getFileCatName":"Payroll","getFileCatId":"2790000000340001"}],"fileConfident":0,"fileCategoryID":"2790000000340001","fileOwnerID":"2790000000092117","isreportingTo":0,"fileUsageSpace":13137890,"fileType":0,"fileID":"2790000000331011"}]},"message":"Data fetched successfully","uri":"/api/files/json/getAllFiles","status":0}}

:如果您想要 xml 响应,请在 url 中提供 xml