为特定的记录创建备注
目的
向特定记录添加新的备注。
请求URL
https://www.zohoapis.com.cn/crm/v2/{module_api_name}/{record_id}/Notes
module_api_name - 模块的API名称
record_id - 记录的唯一ID
在获取特定备注中支持的模块在这里也支持。
请求方法
POST
范围
scope=ZohoCRM.modules.all
(或)
scope=ZohoCRM.modules.{module_name}.{operation_type}
(和)
scope=ZohoCRM.modules.notes.CREATE
可能的模块名称 | 可能的操作类型 |
---|---|
线索,客户,联系人,商机,市场活动,任务,事件,通话,服务支持,解决方案,产品,供货商,价格表,报价单,销售订单,采购订单,发货单和自定义模块 | ALL - 完全访问备注 WRITE - 编辑备注数据 CREATE - 创建备注数据 |
示例请求
在请求中,“@newnote。“json”包含示例输入数据。
curl "https://www.zohoapis.com.cn/crm/v2/Leads/1000000145990/Notes"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@newnote.json"
-X POST
示例输入
在输入中,指定备注模块的字段API名称以及相应的值。
{
"data": [
{
"Note_Title": "Contacted",
"Note_Content": "Need to do further tracking"
}
]
}
示例响应
{
"data": [
{
"message": "record added",
"details": {
"created_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"id": "410888000000737004",
"modified_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"modified_time": "2016-09-16T12:19:22+05:30",
"created_time": "2016-09-16T12:19:22+05:30"
},
"status": "success",
"code": "SUCCESS"
}
]
}
示例请求
ZCRMRecord record = ZCRMRecord.getInstance("Products",23857634545l);//模块API名称和记录ID
ZCRMNote note = new ZCRMNote(record);
note.setContent("test msg");
note.setTitle("test class notes");
APIResponse response = record.addNote(note);
ZCRMNote createdNote = (ZCRMNote) response.getData();
String recStatus =response.getStatus();
示例输入
在输入中,指定备注模块的字段API名称以及相应的值。
{
"data": [
{
"Note_Title": "Contacted",
"Note_Content": "Need to do further tracking"
}
]
}
示例响应
{
"data": [
{
"message": "record added",
"details": {
"created_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"id": "410888000000737004",
"modified_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"modified_time": "2016-09-16T12:19:22+05:30",
"created_time": "2016-09-16T12:19:22+05:30"
},
"status": "success",
"code": "SUCCESS"
}
]
}
示例请求
try{
$record=ZCRMRecord::getInstance('Accounts',410405000000497012);
$noteIns=ZCRMNote::getInstance($record);
$noteIns->setTitle("Title_API1");
$noteIns->setContent("This is test content");
$responseIns=$record->addNote($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": "Need to do further tracking"
}
]
}
示例响应
{
"data": [
{
"message": "record added",
"details": {
"created_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"id": "410888000000737004",
"modified_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"modified_time": "2016-09-16T12:19:22+05:30",
"created_time": "2016-09-16T12:19:22+05:30"
},
"status": "success",
"code": "SUCCESS"
}
]
}
示例请求
def add_note(self):
try:
record=ZCRMRecord.get_instance('Leads',1386586000001856002)
note_ins=ZCRMNote.get_instance(record, None)
note_ins.title="title2"
note_ins.content='content2...'
resp=record.add_note(note_ins)
print resp.status_code
print resp.code
print resp.data.id
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
示例输入
在输入中,指定备注模块的字段API名称以及相应的值。
{
"data": [
{
"Note_Title": "Contacted",
"Note_Content": "Need to do further tracking"
}
]
}
示例响应
{
"data": [
{
"message": "record added",
"details": {
"created_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"id": "410888000000737004",
"modified_by": {
"id": "410888000000086001",
"name": "Patricia Boyle"
},
"modified_time": "2016-09-16T12:19:22+05:30",
"created_time": "2016-09-16T12:19:22+05:30"
},
"status": "success",
"code": "SUCCESS"
}
]
}