更新备注
目的
用来更新已有的备注。
请求URL
https://www.zohoapis.com.cn/crm/v2/{module_api_name}/{record_id}/Notes/{note_id}
module_api_name - 模块的API名称
record_id - 记录的唯一ID
note_id - 备注的唯一ID
在获取特定备注中支持的模块在这里也支持。
请求方法
PUT
范围
scope=ZohoCRM.modules.all
(或)
scope=ZohoCRM.modules.{module_name}.{operation_type}
| 可能的模块名称 | 可能的操作类型 |
|---|---|
| 线索,客户,联系人,商机,市场活动,任务,服务支持,事件,通话,解决方案,产品,供货商,价格表,报价单,销售订单,采购订单,发货单和自定义模块 | ALL - 完全访问备注 WRITE - 编辑备注数据 UPDATE - 更新备注数据 |
示例请求
在这个请求中,"@updatenote.json" 包含了示例输入数据。
curl "https://www.zohoapis.com.cn/crm/v2/Leads/410888000000645234/Notes/410888000000643123"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@updatenote.json"
-X PUT 示例输入
在输入中,指定备注模块的字段API名称以及相应的值。
{
"data": [
{
"Note_Title": "Contacted",
"Note_Content": "Tracking done. Happy with the customer"
}
]
} 示例响应
{
"data": [
{
"code": "SUCCESS",
"details": {
"created_time": "2016-07-05T17:13:24+05:30",
"modified_time": "2016-08-08T11:28:41+05:30",
"modified_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"id": "410888000000643123",
"created_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
}
},
"message": "record updated",
"status": "success"
}
]
} 示例请求
ZCRMRecord record = ZCRMRecord.getInstance("Products",23857634545l);//模块API名称和记录ID
ZCRMNote note = ZCRMNote.getInstance(record,374968745l);// 备注ID
note.setContent("update message");
APIResponse response = record.updateNote(note);
ZCRMNote updatedNote = (ZCRMNote) response.getData();
String recStatus =response.getStatus(); 示例输入
在输入中,指定备注模块的字段API名称以及相应的值。
{
"data": [
{
"Note_Title": "Contacted",
"Note_Content": "Tracking done. Happy with the customer"
}
]
} 示例响应
{
"data": [
{
"code": "SUCCESS",
"details": {
"created_time": "2016-07-05T17:13:24+05:30",
"modified_time": "2016-08-08T11:28:41+05:30",
"modified_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"id": "410888000000643123",
"created_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
}
},
"message": "record updated",
"status": "success"
}
]
} 示例请求
try{
$record=ZCRMRecord::getInstance('Accounts',410405000000497012); // 410405000000497012 - 客户ID
$noteIns=ZCRMNote::getInstance($record,410405000000498056); // , 410405000000498056 - 备注ID
$noteIns->setTitle("Title_API22..");
$noteIns->setContent("This is test content");
$responseIns=$record->updateNote($noteIns);
$zcrmNote=$responseIns->getData();
echo "HTTP Status Code:".$responseIns->getHttpStatusCode();
echo "Status:".$responseIns->getStatus();
echo "Message:".$responseIns->getMessage();
echo "Code:".$responseIns->getCode();
echo "Details:".$responseIns->getDetails()['id'];
echo "Entity Id:".$zcrmNote->getId();
}
catch (ZCRMException $e)
{
echo $e->getCode();
echo $e->getMessage();
echo $e->getExceptionCode();
} 示例输入
在输入中,指定备注模块的字段API名称以及相应的值。
{
"data": [
{
"Note_Title": "Contacted",
"Note_Content": "Tracking done. Happy with the customer"
}
]
} 示例响应
{
"data": [
{
"code": "SUCCESS",
"details": {
"created_time": "2016-07-05T17:13:24+05:30",
"modified_time": "2016-08-08T11:28:41+05:30",
"modified_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"id": "410888000000643123",
"created_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
}
},
"message": "record updated",
"status": "success"
}
]
} 示例请求
def update_note(self):
try:
record=ZCRMRecord.get_instance('Leads',440872000000222019) #module API Name, entityId
note_ins=ZCRMNote.get_instance(record, 440872000000241025) #note ID
note_ins.title="title2 updated"
note_ins.content='content2 updated...'
resp=record.update_note(note_ins)
print resp.status_code
print resp.code
print resp.data.modified_by.id
print resp.data.modified_by.name
print resp.message
print resp.status
except ZCRMException as ex:
print ex.status_code
print ex.error_message
print ex.error_code
print ex.error_details
print ex.error_content
#Here 440872000000222019 是线索ID而 440872000000241025 是备注ID 示例输入
在输入中,指定备注模块的字段API名称以及相应的值。
{
"data": [
{
"Note_Title": "Contacted",
"Note_Content": "Tracking done. Happy with the customer"
}
]
} 示例响应
{
"data": [
{
"code": "SUCCESS",
"details": {
"created_time": "2016-07-05T17:13:24+05:30",
"modified_time": "2016-08-08T11:28:41+05:30",
"modified_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"id": "410888000000643123",
"created_by": {
"name": "Patricia Boyle",
"id": "4108880000086001"
}
},
"message": "record updated",
"status": "success"
}
]
}