uploadFile 方法 - 对比
用途
将一个文件附加到一个记录。
请求URL
版本 1.0:
https://crm.zoho.com.cn/crm/private/xml/Leads/uploadFile?authtoken=AuthToken&scope=crmapi&id=Record Id&content=File Input Stream
版本 2.0:
URL: https://www.zohoapis.com.cn/crm/v2/Leads/{record_id}/Attachments
Method: POST
在 multipart/form-data 请求中,提供文件流的文件参数。
Header: Authorization=Zoho-oauthtoken {oauth_token}
请求参数
版本 1.0 | 版本 2.0 |
---|---|
authtoken=**** | Authorization=Zoho-oauthtoken ***** - 作为一个 Header。 |
scope=crmapi | N/A |
newFormat | N/A |
version | N/A |
type | 和 V1 一样 |
样本响应:
版本 1.0 响应 | 版本 2.0 响应 |
---|---|
<?xml version="1.0" encoding="UTF-8" ?> <response uri="/crm/private/xml/Leads/uploadFile"> <result> <message>File has been attached successfully</message> <recorddetail> <FL val="Id">1386586000002579046</FL> <FL val="Created Time">2018-03-28 14:37:22</FL> <FL val="Modified Time">2018-03-28 14:37:22</FL> <FL val="Created By"><![CDATA[Bruce Wills]]></FL> <FL val="Modified By"><![CDATA[Bruce Wills]]></FL> </recorddetail> </result> </response> | { "data": [ { "code": "SUCCESS", "details": { "Modified_Time": "2018-03-28T14:35:04+05:30", "Modified_By": { "name": "Bruce Wills", "id": "1386586000000078001" }, "Created_Time": "2018-03-28T14:35:04+05:30", "id": "1386586000002588005" "Created_By": { "name": "Bruce Wills", "id": "1386586000000078001" } }, "message": "attachment uploaded successfully", "status": "success", } ] } |