搜索记录
目的
检索与搜索条件匹配的记录。
请求URL
https://www.zohoapis.com.cn/crm/v2/{module_api_name}/search
module_api_name - 模块的API名称
在获取记录列表中支持的模块在这里也支持。
请求方法
GET
范围
scope=ZohoCRM.modules.all
(或)
scope=ZohoCRM.modules.{module_name}.{operation_type}
(and)
scope=ZohoSearch.securesearch.READ
可能的模块名称 | 可能的操作类型 |
---|---|
线索,客户,联系人,商机,市场活动,任务,服务支持,事件,通话,解决方案,产品,供货商,价格表,报价单,销售订单,采购订单,发货单,自定义模块,备注和活动 | ALL - 完全访问记录 READ - 从模块中获取记录 |
参数
参数名称 | 数据类型 | 描述 |
---|---|---|
criteria | 字符串 | 按照显示的条件执行搜索。 (({api_name}:{starts_with|equals}:{value}) 和 ({api_name}:{starts_with|equals}:{value})) 您可以使用equals和starts_with条件搜索最多10个条件(具有相同或不同的列)。 |
字符串 | 通过邮件执行模块搜索。将搜索并列出特定模块的所有电子邮件字段。 | |
phone | 字符串 | 根据电话号码进行模块搜索。将搜索并列出特定模块的所有电话字段。 |
word | 字符串 | 按单词执行全局搜索。 |
converted (可选) | 字符串 | 获取已转换记录的列表。默认值是false。 true - 只获取已转换记录 false - 只获取未转换记录 both - 获取所有记录 |
approved (可选) | 字符串 | 获取已审批记录的列表。默认值是true。 true - 只获取已审批的记录 false - 只获取未审批的记录 both - 获取所有记录 |
page (可选) | 整型 | 从相关页面获取记录列表。 page的默认值是1。 |
per_page (可选) | 整型 | 获取每页可用记录的列表。 page的默认值是200。 |
备注:
以上四个参数中只有一个在某一时刻有效。此外,如果同时给定两个参数,优先次序将会是criteria, email, phone, 和 word,并且只有一种可用。
page和per_page参数用于根据记录在CRM中的位置获取记录。假设用户必须获取400条记录。一个API调用最多可以获得200条记录。所以,对于第200位以上的记录,无法获取。通过使用page (1, 2, 3 和 4) 和per_page (100)参数,用户可以使用4个API调用获取所有400条记录。
通常在获取搜索操作的结果时会有一些延迟。但是,在特定的模块中有特定的字段,当通过这个API搜索时,可以立即给出没有延迟的结果。例如,
线索/联系人 - "Email"字段
客户 - "Account_Name" 字段
商机 - "Deal_Name" 字段
市场活动 - "Campaign_Name" 字段
服务支持 - "Subject" 字段
解决方案 - "Solution_Title" 字段
产品 - "Product_Name" 字段
供货商 - "Vendor_Name" 字段
价格表 - "Price_Book_Name"字段
报价单 - "Subject" 字段
销售订单 - "Subject" 字段
采购订单 - "Subject" 字段
发货单 - "Subject" 字段
自定义模块 - "Name" 字段如果任何搜索API附带的标准只包含上述模块的一个字段,那么您将立即得到结果。
示例请求:通过电话搜索
curl "https://www.zohoapis.com.cn/crm/v2/Contacts/search?phone=888-555-2145"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
示例响应
{
"data": [
{
"Email": "p.boyle@zylker.com",
"Other_Phone": null,
"Mailing_State": "California",
"Other_State": null,
"Other_Country": null,
"Last_Activity_Time": "2016-08-22T19:09:43+05:30",
"Department": null,
"Mailing_Country": "United States",
"id": "4108880000598001",
"$approved": true,
"Custom_Lead_Lookup_1": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Custom_Custom_Lookup_2": null,
"Other_City": null,
"Created_Time": "2016-06-20T18:00:26+05:30",
"$followed": false,
"Home_Phone": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Secondary_Email": "p.boyle@gmail.com",
"Description": "Design your own layouts that align your business processes.",
"Vendor_Name": null,
"Mailing_Zip": null,
"Reports_To": null,
"Multi_Line_1": null,
"Other_Zip": null,
"Twitter": "Twitter",
"Mailing_Street": null,
"$full_name": "Jennifer Donelly",
"Salutation": "Ms.",
"First_Name": "Jennifer",
"New_Field2": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Skype_ID": "Skype_ID",
"Add_to_QuickBooks": false,
"Phone": "888-555-2145",
"Account_Name": null,
"Email_Opt_Out": true,
"New_Field3": null,
"New_Field4": null,
"Modified_Time": "2016-08-22T19:09:43+05:30",
"Date_of_Birth": null,
"Mailing_City": "City",
"New_Check_Box_1": false,
"Title": "Head of Operations",
"Other_Street": null,
"Mobile": null,
"Territories": [],
"Owner": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Last_Name": "Donelly",
"Lead_Source": "Cold Call",
"Fax": "Fax3",
"Lookup_3": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
示例请求:通过邮件搜索
curl "https://www.zohoapis.com.cn/crm/v2/Leads/search?email=p.daly@zylker.com"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
示例响应
{
"data": [
{
"Company": "Zylker",
"Email": "p.daly@zylker.com",
"Last_Activity_Time": "2016-09-22T12:16:06+05:30",
"Industry": null,
"$converted": false,
"Exchange_Rate": 1,
"Currency": "INR",
"Date_2": null,
"Street": null,
"Zip_Code": null,
"id": "410888000000698005",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Date_Time": null,
"Created_Time": "2016-08-09T16:27:04+05:30",
"$followed": false,
"Owner": {
"name": "Patricia Boyle",
"id": "410888000000086001"
},
"City": null,
"No_of_Employees": 0,
"State": "Texas",
"Country": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "410888000000086001"
},
"Annual_Revenue": 0,
"Secondary_Email": null,
"Description": null,
"Decimal_1": null,
"Website": null,
"Twitter": null,
"Salutation": null,
"First_Name": "Paul",
"Lead_Status": null,
"Full_Name": "Paul Daly",
"Modified_By": {
"name": "Patricia Boyle",
"id": "410888000000086001"
},
"Skype_ID": null,
"Phone": "888-555-2145",
"Picks3": null,
"Picks2": null,
"Email_Opt_Out": false,
"Date_Time_2": null,
"Long_Integer_1": null,
"Designation": null,
"Date_Testing": null,
"Modified_Time": "2016-09-22T12:16:06+05:30",
"Pick_List_2": null,
"Picks1": null,
"$converted_detail": {},
"Pick_List_1": null,
"Mobile": null,
"Last_Name": "Daly",
"Layout": {
"name": "Standard",
"id": "410888000000380037"
},
"Auto_Number_1": "Test627Test",
"Lead_Source": null,
"Formula_1": 4,
"Fax": null,
"Lookup_1": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
示例响应:通过条件搜索
curl "https://www.zohoapis.com.cn/crm/v2/Leads/search?criteria=((Last_Name:starts_with:G) 和 (Email:equals:deborah@healthnet.com))"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
示例响应
{
"data": [
{
"Owner": {
"name": "Patricia Boyle",
"id": "2883756000000133013"
},
"Company": "Health Net Inc",
"Email": "deborah@healthnet.com",
"Description": null,
"$currency_symbol": "$",
"Twitter": null,
"Last_Activity_Time": "2018-02-14T13:41:00+05:30",
"First_Name": "Deborah",
"Full_Name": "Deborah Grogan",
"Lead_Status": "Lost Lead",
"Industry": "ERP",
"Modified_By": {
"name": "Patricia Boyle",
"id": "2883756000000133013"
},
"Skype_ID": null,
"Phone": "888-555-5478",
"id": "2883756000000135187",
"Email_Opt_Out": true,
"$approved": true,
"Designation": "IT MGR",
"Modified_Time": "2018-02-14T13:41:00+05:30",
"Created_Time": "2017-12-20T11:56:47+05:30",
"City": "Woodland Hills",
"No_of_Employees": 50,
"Mobile": "865-555-5478",
"Last_Name": "Grogan",
"Lead_Source": "Employee Referral",
"Country": "United States",
"Created_By": {
"name": "Patricia Boyle",
"id": "2883756000000133013"
}
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
示例请求:通过单词搜索
curl "https://www.zohoapis.com.cn/crm/v2/Leads/search?word=abc"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
示例响应
因为搜索的是“abc”这个单词,响应显示了在其任意字段中包含单词abc的所有记录。
{
"data": [
{
"Owner": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Company": "Company1",
"Email": null,
"$currency_symbol": "Rs.",
"Visitor_Score": null,
"Last_Activity_Time": null,
"Industry": null,
"$converted": false,
"$process_flow": false,
"Street": null,
"Zip_Code": null,
"id": "3652397000000562046",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false,
"resubmit": false
},
"First_Visited_URL": null,
"Days_Visited": null,
"Created_Time": "2019-02-19T12:57:55+05:30",
"$editable": true,
"City": null,
"No_of_Employees": null,
"Campaigns_Lookup": null,
"State": null,
"Country": null,
"Last_Visited_Time": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Annual_Revenue": null,
"Secondary_Email": null,
"Description": null,
"Number_Of_Chats": null,
"Rating": null,
"Website": null,
"Twitter": null,
"Average_Time_Spent_Minutes": null,
"Salutation": null,
"First_Name": null,
"Lead_Status": null,
"Full_Name": "abc",
"Record_Image": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Skype_ID": null,
"Phone": null,
"Email_Opt_Out": false,
"Designation": null,
"Modified_Time": "2019-02-19T12:57:55+05:30",
"$converted_detail": {},
"Mobile": null,
"Prediction_Score": null,
"First_Visited_Time": null,
"Last_Name": "abc",
"Referrer": null,
"Lead_Source": null,
"Tag": [],
"Fax": null
},
{
"Owner": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Company": "abc",
"Email": null,
"$currency_symbol": "Rs.",
"Visitor_Score": null,
"Last_Activity_Time": "2019-02-19T12:06:28+05:30",
"Industry": "ERP (Enterprise Resource Planning)",
"$converted": false,
"$process_flow": false,
"Street": null,
"Zip_Code": null,
"id": "3652397000000538029",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false,
"resubmit": false
},
"First_Visited_URL": null,
"Days_Visited": null,
"Created_Time": "2019-02-14T18:19:22+05:30",
"$editable": true,
"City": "Albany",
"No_of_Employees": null,
"Campaigns_Lookup": null,
"State": null,
"Country": null,
"Last_Visited_Time": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Annual_Revenue": null,
"Secondary_Email": null,
"Description": null,
"Number_Of_Chats": null,
"Rating": null,
"Website": null,
"Twitter": null,
"Average_Time_Spent_Minutes": null,
"Salutation": null,
"First_Name": "Test1",
"Lead_Status": "Contacted",
"Full_Name": "Test1 Lead1",
"Record_Image": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Skype_ID": null,
"Phone": null,
"Email_Opt_Out": true,
"Designation": "Team Lead",
"Modified_Time": "2019-02-19T12:06:28+05:30",
"$converted_detail": {},
"Mobile": null,
"Prediction_Score": null,
"First_Visited_Time": null,
"Last_Name": "Lead1",
"Referrer": null,
"Lead_Source": "Advertisement",
"Tag": [],
"Fax": null
}
],
"info": {
"per_page": 200,
"count": 2,
"page": 1,
"more_records": false
}
}
示例请求:通过电话搜索
ZCRMModule module = ZCRMModule.getInstance("Contacts"); // 模块API名称
BulkAPIResponse response = module.searchByPhone("123456789", 1, 10);// 获取带有页面和每页计数的搜索记录
List<ZCRMRecord> records = (List<ZCRMRecord>) response.getData(); //匹配记录
示例响应
{
"data": [
{
"Email": "p.boyle@zylker.com",
"Other_Phone": null,
"Mailing_State": "California",
"Other_State": null,
"Other_Country": null,
"Last_Activity_Time": "2016-08-22T19:09:43+05:30",
"Department": null,
"Mailing_Country": "United States",
"id": "4108880000598001",
"$approved": true,
"Custom_Lead_Lookup_1": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Custom_Custom_Lookup_2": null,
"Other_City": null,
"Created_Time": "2016-06-20T18:00:26+05:30",
"$followed": false,
"Home_Phone": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Secondary_Email": "p.boyle@gmail.com",
"Description": "Design your own layouts that align your business processes.",
"Vendor_Name": null,
"Mailing_Zip": null,
"Reports_To": null,
"Multi_Line_1": null,
"Other_Zip": null,
"Twitter": "Twitter",
"Mailing_Street": null,
"$full_name": "Jennifer Donelly",
"Salutation": "Ms.",
"First_Name": "Jennifer",
"New_Field2": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Skype_ID": "Skype_ID",
"Add_to_QuickBooks": false,
"Phone": "888-555-2145",
"Account_Name": null,
"Email_Opt_Out": true,
"New_Field3": null,
"New_Field4": null,
"Modified_Time": "2016-08-22T19:09:43+05:30",
"Date_of_Birth": null,
"Mailing_City": "City",
"New_Check_Box_1": false,
"Title": "Head of Operations",
"Other_Street": null,
"Mobile": null,
"Territories": [],
"Owner": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Last_Name": "Donelly",
"Lead_Source": "Cold Call",
"Fax": "Fax3",
"Lookup_3": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
示例请求:通过邮件搜素
ZCRMModule module = ZCRMModule.getInstance("Contacts"); // 模块API名称
BulkAPIResponse response = module.searchByEmail("bruce@wayne.com", 1, 10);// 获取带有页面和每页计数的搜索记录
List<ZCRMRecord> records = (List<ZCRMRecord>) response.getData(); //匹配记录
示例响应
{
"data": [
{
"Company": "Zylker",
"Email": "p.daly@zylker.com",
"Last_Activity_Time": "2016-09-22T12:16:06+05:30",
"Industry": null,
"$converted": false,
"Exchange_Rate": 1,
"Currency": "INR",
"Date_2": null,
"Street": null,
"Zip_Code": null,
"id": "410888000000698005",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Date_Time": null,
"Created_Time": "2016-08-09T16:27:04+05:30",
"$followed": false,
"Owner": {
"name": "Patricia Boyle",
"id": "410888000000086001"
},
"City": null,
"No_of_Employees": 0,
"State": "Texas",
"Country": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "410888000000086001"
},
"Annual_Revenue": 0,
"Secondary_Email": null,
"Description": null,
"Decimal_1": null,
"Website": null,
"Twitter": null,
"Salutation": null,
"First_Name": "Paul",
"Lead_Status": null,
"Full_Name": "Paul Daly",
"Modified_By": {
"name": "Patricia Boyle",
"id": "410888000000086001"
},
"Skype_ID": null,
"Phone": "888-555-2145",
"Picks3": null,
"Picks2": null,
"Email_Opt_Out": false,
"Date_Time_2": null,
"Long_Integer_1": null,
"Designation": null,
"Date_Testing": null,
"Modified_Time": "2016-09-22T12:16:06+05:30",
"Pick_List_2": null,
"Picks1": null,
"$converted_detail": {},
"Pick_List_1": null,
"Mobile": null,
"Last_Name": "Daly",
"Layout": {
"name": "Standard",
"id": "410888000000380037"
},
"Auto_Number_1": "Test627Test",
"Lead_Source": null,
"Formula_1": 4,
"Fax": null,
"Lookup_1": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
示例请求
$zcrmModuleIns = ZCRMModule::getInstance("Products");
$bulkAPIResponse=$zcrmModuleIns->searchRecords("ip");
$records = $bulkAPIResponse->getData(); // $records - ZCRMRecord实例的数组
示例响应
{
"data": [
{
"Email": "p.boyle@zylker.com",
"Other_Phone": null,
"Mailing_State": "California",
"Other_State": null,
"Other_Country": null,
"Last_Activity_Time": "2016-08-22T19:09:43+05:30",
"Department": null,
"Mailing_Country": "United States",
"id": "4108880000598001",
"$approved": true,
"Custom_Lead_Lookup_1": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Custom_Custom_Lookup_2": null,
"Other_City": null,
"Created_Time": "2016-06-20T18:00:26+05:30",
"$followed": false,
"Home_Phone": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Secondary_Email": "p.boyle@gmail.com",
"Description": "Design your own layouts that align your business processes.",
"Vendor_Name": null,
"Mailing_Zip": null,
"Reports_To": null,
"Multi_Line_1": null,
"Other_Zip": null,
"Twitter": "Twitter",
"Mailing_Street": null,
"$full_name": "Jennifer Donelly",
"Salutation": "Ms.",
"First_Name": "Jennifer",
"New_Field2": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Skype_ID": "Skype_ID",
"Add_to_QuickBooks": false,
"Phone": "888-555-2145",
"Account_Name": null,
"Email_Opt_Out": true,
"New_Field3": null,
"New_Field4": null,
"Modified_Time": "2016-08-22T19:09:43+05:30",
"Date_of_Birth": null,
"Mailing_City": "City",
"New_Check_Box_1": false,
"Title": "Head of Operations",
"Other_Street": null,
"Mobile": null,
"Territories": [],
"Owner": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Last_Name": "Donelly",
"Lead_Source": "Cold Call",
"Fax": "Fax3",
"Lookup_3": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
示例请求:通过条件搜索
$zcrmModuleIns = ZCRMModule::getInstance("Products");
$bulkAPIResponse=$zcrmModuleIns->searchRecordsByCriteria("((Last_Name:starts_with:D) 或 (Email:equals:p.daly@zylker.com))");
$records = $bulkAPIResponse->getData(); // $records - ZCRMRecord实例的数组。
示例响应
{
"data": [
{
"Owner": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Company": "Villa Margarita",
"Email": "brian@villa.com",
"$currency_symbol": "Rs.",
"Visitor_Score": null,
"Last_Activity_Time": "2019-02-04T11:27:19+05:30",
"Industry": null,
"$converted": false,
"$process_flow": false,
"Street": null,
"Zip_Code": null,
"id": "3652397000000415064",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false,
"resubmit": false
},
"First_Visited_URL": null,
"Days_Visited": null,
"Created_Time": "2019-01-10T15:00:17+05:30",
"$editable": true,
"City": null,
"No_of_Employees": 0,
"Campaigns_Lookup": null,
"State": "Texas",
"Country": null,
"Last_Visited_Time": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Annual_Revenue": 0,
"Secondary_Email": null,
"Description": null,
"Number_Of_Chats": null,
"Rating": null,
"Website": null,
"Twitter": null,
"Average_Time_Spent_Minutes": null,
"Salutation": null,
"First_Name": "Brian",
"Lead_Status": null,
"Full_Name": "Brian Dolan",
"Record_Image": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Skype_ID": null,
"Phone": null,
"Email_Opt_Out": false,
"Designation": null,
"Modified_Time": "2019-02-04T11:27:19+05:30",
"$converted_detail": {},
"Mobile": null,
"Prediction_Score": null,
"First_Visited_Time": null,
"Last_Name": "Dolan",
"Referrer": null,
"Lead_Source": "Twitter",
"Tag": [],
"Fax": null
},
{
"Owner": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Company": "Zylker",
"Email": "p.daly@zylker.com",
"$currency_symbol": "Rs.",
"Visitor_Score": null,
"Last_Activity_Time": "2019-02-04T11:27:19+05:30",
"Industry": null,
"$converted": false,
"$process_flow": false,
"Street": null,
"Zip_Code": null,
"id": "3652397000000415063",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false,
"resubmit": false
},
"First_Visited_URL": null,
"Days_Visited": null,
"Created_Time": "2019-01-10T15:00:17+05:30",
"$editable": true,
"City": null,
"No_of_Employees": 0,
"Campaigns_Lookup": null,
"State": "Texas",
"Country": null,
"Last_Visited_Time": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Annual_Revenue": 0,
"Secondary_Email": null,
"Description": null,
"Number_Of_Chats": null,
"Rating": null,
"Website": null,
"Twitter": null,
"Average_Time_Spent_Minutes": null,
"Salutation": null,
"First_Name": "Paul",
"Lead_Status": null,
"Full_Name": "Paul Daly",
"Record_Image": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Skype_ID": null,
"Phone": null,
"Email_Opt_Out": false,
"Designation": null,
"Modified_Time": "2019-02-04T11:27:19+05:30",
"$converted_detail": {},
"Mobile": null,
"Prediction_Score": null,
"First_Visited_Time": null,
"Last_Name": "Daly",
"Referrer": null,
"Lead_Source": "Twitter",
"Tag": [],
"Fax": null
}
],
"info": {
"per_page": 200,
"count": 2,
"page": 1,
"more_records": false
}
}
示例请求:通过单词搜索
def search_records(self):
try:
module_ins=ZCRMModule.get_instance('Products') #模块API名称
resp=module_ins.search_records('Product1') #搜索关键词
print resp.status_code
resp_info=resp.info
print resp_info.count
print resp_info.page
print resp_info.per_page
print resp_info.is_more_records
record_ins_arr=resp.data
for record_ins in record_ins_arr:
print record_ins.entity_id
print record_ins.owner.id
print record_ins.created_by.id
print record_ins.modified_by.id
print record_ins.created_time
print record_ins.modified_time
print record_ins.get_field_value('Product_Name')
print record_ins.get_field_value('Product_Code')
print record_ins.get_field_value('Vendor_Name')
print record_ins.get_field_value('Commission_Rate')
print record_ins.get_field_value('Qty_in_Demand')
print record_ins.get_field_value('Tax')
print record_ins.get_field_value('Unit_Price')
print record_ins.get_field_value('Reorder_Level')
print record_ins.get_field_value('Usage_Unit')
print record_ins.get_field_value('Qty_Ordered')
print record_ins.get_field_value('Qty_in_Stock')
print record_ins.get_field_value('Sales_Start_Date')
print record_ins.get_field_value('Sales_End_Date')
print record_ins.get_field_value('Taxable')
print record_ins.get_field_value('Support_Expiry_Date')
print record_ins.get_field_value('Manufacturer')
print record_ins.get_field_value('Description')
print record_ins.field_data
print "\n\n"
except ZCRMException as ex:
print ex.status_code
print ex.error_message
print ex.error_code
print ex.error_details
print ex.error_content
示例响应
{
"data": [
{
"Product_Category": "Hardware",
"Qty_in_Demand": 4000,
"Owner": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Description": null,
"$currency_symbol": "Rs.",
"Vendor_Name": {
"name": "ABC Inc",
"id": "3652397000000491141"
},
"Sales_Start_Date": "2019-01-15",
"Tax": [
"Sales Tax",
"Vat"
],
"Product_Active": true,
"Record_Image": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Product_Code": "1234567890",
"$process_flow": false,
"Manufacturer": "AltvetPet Inc.",
"id": "3652397000000491147",
"Support_Expiry_Date": "2020-02-15",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false,
"resubmit": false
},
"Modified_Time": "2019-01-30T11:49:17+05:30",
"Created_Time": "2019-01-29T15:10:21+05:30",
"Commission_Rate": 10,
"Product_Name": "Product1",
"Handler": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"$taxable": true,
"$editable": true,
"Support_Start_Date": "2019-01-15",
"Usage_Unit": "Each",
"Qty_Ordered": 2000,
"Qty_in_Stock": 4000,
"Created_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Tag": [],
"Sales_End_Date": "2020-01-15",
"Unit_Price": 100,
"Taxable": true,
"Reorder_Level": 500
}
]
}
示例响应:通过条件搜索
try:
module_ins=ZCRMModule.get_instance('Products') #模块API名称
resp=module_ins.search_records_by_criteria('((Last_Name:starts_with:D) 或 (Email:equals:p.daly@zylker.com))') #搜索条件
print resp.status_code
resp_info=resp.info
print resp_info.count
print resp_info.page
print resp_info.per_page
print resp_info.is_more_records
record_ins_arr=resp.data
for record_ins in record_ins_arr:
print record_ins.entity_id
print record_ins.owner.id
print record_ins.created_by.id
print record_ins.modified_by.id
print record_ins.created_time
print record_ins.modified_time
print record_ins.get_field_value('Product_Name')
print record_ins.get_field_value('Product_Code')
print record_ins.get_field_value('Vendor_Name')
print record_ins.get_field_value('Commission_Rate')
print record_ins.get_field_value('Qty_in_Demand')
print record_ins.get_field_value('Tax')
print record_ins.get_field_value('Unit_Price')
print record_ins.get_field_value('Reorder_Level')
print record_ins.get_field_value('Usage_Unit')
print record_ins.get_field_value('Qty_Ordered')
print record_ins.get_field_value('Qty_in_Stock')
print record_ins.get_field_value('Sales_Start_Date')
print record_ins.get_field_value('Sales_End_Date')
print record_ins.get_field_value('Taxable')
print record_ins.get_field_value('Support_Expiry_Date')
print record_ins.get_field_value('Manufacturer')
print record_ins.get_field_value('Description')
print record_ins.field_data
print "\n\n"
except ZCRMException as ex:
print ex.status_code
print ex.error_message
print ex.error_code
print ex.error_details
print ex.error_content
示例响应
{
"data": [
{
"Owner": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Company": "Villa Margarita",
"Email": "brian@villa.com",
"$currency_symbol": "Rs.",
"Visitor_Score": null,
"Last_Activity_Time": "2019-02-04T11:27:19+05:30",
"Industry": null,
"$converted": false,
"$process_flow": false,
"Street": null,
"Zip_Code": null,
"id": "3652397000000415064",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false,
"resubmit": false
},
"First_Visited_URL": null,
"Days_Visited": null,
"Created_Time": "2019-01-10T15:00:17+05:30",
"$editable": true,
"City": null,
"No_of_Employees": 0,
"Campaigns_Lookup": null,
"State": "Texas",
"Country": null,
"Last_Visited_Time": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Annual_Revenue": 0,
"Secondary_Email": null,
"Description": null,
"Number_Of_Chats": null,
"Rating": null,
"Website": null,
"Twitter": null,
"Average_Time_Spent_Minutes": null,
"Salutation": null,
"First_Name": "Brian",
"Lead_Status": null,
"Full_Name": "Brian Dolan",
"Record_Image": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Skype_ID": null,
"Phone": null,
"Email_Opt_Out": false,
"Designation": null,
"Modified_Time": "2019-02-04T11:27:19+05:30",
"$converted_detail": {},
"Mobile": null,
"Prediction_Score": null,
"First_Visited_Time": null,
"Last_Name": "Dolan",
"Referrer": null,
"Lead_Source": "Twitter",
"Tag": [],
"Fax": null
},
{
"Owner": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Company": "Zylker",
"Email": "p.daly@zylker.com",
"$currency_symbol": "Rs.",
"Visitor_Score": null,
"Last_Activity_Time": "2019-02-04T11:27:19+05:30",
"Industry": null,
"$converted": false,
"$process_flow": false,
"Street": null,
"Zip_Code": null,
"id": "3652397000000415063",
"$approved": true,
"$approval": {
"delegate": false,
"approve": false,
"reject": false,
"resubmit": false
},
"First_Visited_URL": null,
"Days_Visited": null,
"Created_Time": "2019-01-10T15:00:17+05:30",
"$editable": true,
"City": null,
"No_of_Employees": 0,
"Campaigns_Lookup": null,
"State": "Texas",
"Country": null,
"Last_Visited_Time": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Annual_Revenue": 0,
"Secondary_Email": null,
"Description": null,
"Number_Of_Chats": null,
"Rating": null,
"Website": null,
"Twitter": null,
"Average_Time_Spent_Minutes": null,
"Salutation": null,
"First_Name": "Paul",
"Lead_Status": null,
"Full_Name": "Paul Daly",
"Record_Image": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Skype_ID": null,
"Phone": null,
"Email_Opt_Out": false,
"Designation": null,
"Modified_Time": "2019-02-04T11:27:19+05:30",
"$converted_detail": {},
"Mobile": null,
"Prediction_Score": null,
"First_Visited_Time": null,
"Last_Name": "Daly",
"Referrer": null,
"Lead_Source": "Twitter",
"Tag": [],
"Fax": null
}
],
"info": {
"per_page": 200,
"count": 2,
"page": 1,
"more_records": false
}
}
示例请求
语法:
zoho.crm.searchRecords(<module String>,<criteria String>,<page Long>,<perPage Long>,<connectionName String>,<userAccess Boolean>);
mandatory : module,criteria
示例请求:
resp = zoho.crm.searchRecords("Leads", "((Last_Name:equals:Hawkins) 或 (Last_Name:starts_with:Pat))");
示例响应
{
"data": [
{
"Email": "p.boyle@zylker.com",
"Other_Phone": null,
"Mailing_State": "California",
"Other_State": null,
"Other_Country": null,
"Last_Activity_Time": "2016-08-22T19:09:43+05:30",
"Department": null,
"Mailing_Country": "United States",
"id": "4108880000598001",
"$approved": true,
"Custom_Lead_Lookup_1": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Custom_Custom_Lookup_2": null,
"Other_City": null,
"Created_Time": "2016-06-20T18:00:26+05:30",
"$followed": false,
"Home_Phone": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Secondary_Email": "p.boyle@gmail.com",
"Description": "Design your own layouts that align your business processes.",
"Vendor_Name": null,
"Mailing_Zip": null,
"Reports_To": null,
"Multi_Line_1": null,
"Other_Zip": null,
"Twitter": "Twitter",
"Mailing_Street": null,
"$full_name": "Jennifer Donelly",
"Salutation": "Ms.",
"First_Name": "Jennifer",
"New_Field2": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Skype_ID": "Skype_ID",
"Add_to_QuickBooks": false,
"Phone": "888-555-2145",
"Account_Name": null,
"Email_Opt_Out": true,
"New_Field3": null,
"New_Field4": null,
"Modified_Time": "2016-08-22T19:09:43+05:30",
"Date_of_Birth": null,
"Mailing_City": "City",
"New_Check_Box_1": false,
"Title": "Head of Operations",
"Other_Street": null,
"Mobile": null,
"Territories": [],
"Owner": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Last_Name": "Donelly",
"Lead_Source": "Cold Call",
"Fax": "Fax3",
"Lookup_3": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}
示例请求:通过电话搜索
ZCRMModule moduleIns = ZCRMModule.GetInstance("Leads"); // 模块API名称
BulkAPIResponse<ZCRMRecord> response = moduleIns.SearchByPhone("95959595", 1, 10);// 获取带有页面和每页计数的搜索记录
List<ZCRMRecord> records = response.BulkData; //匹配记录
Sample Request: To Search by Email
ZCRMModule moduleIns = ZCRMModule.GetInstance("Leads"); //模块API名称
BulkAPIResponse<ZCRMRecord> response = moduleIns.SearchByEmail("email@zohocorp.com", 1, 10);// 获取带有页面和每页计数的搜索记录
List<ZCRMRecord> records = response.BulkData; //匹配记录
示例响应
{
"data": [
{
"Email": "p.boyle@zylker.com",
"Other_Phone": null,
"Mailing_State": "California",
"Other_State": null,
"Other_Country": null,
"Last_Activity_Time": "2016-08-22T19:09:43+05:30",
"Department": null,
"Mailing_Country": "United States",
"id": "4108880000598001",
"$approved": true,
"Custom_Lead_Lookup_1": null,
"$approval": {
"delegate": false,
"approve": false,
"reject": false
},
"Custom_Custom_Lookup_2": null,
"Other_City": null,
"Created_Time": "2016-06-20T18:00:26+05:30",
"$followed": false,
"Home_Phone": null,
"Created_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Secondary_Email": "p.boyle@gmail.com",
"Description": "Design your own layouts that align your business processes.",
"Vendor_Name": null,
"Mailing_Zip": null,
"Reports_To": null,
"Multi_Line_1": null,
"Other_Zip": null,
"Twitter": "Twitter",
"Mailing_Street": null,
"$full_name": "Jennifer Donelly",
"Salutation": "Ms.",
"First_Name": "Jennifer",
"New_Field2": null,
"Modified_By": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Skype_ID": "Skype_ID",
"Add_to_QuickBooks": false,
"Phone": "888-555-2145",
"Account_Name": null,
"Email_Opt_Out": true,
"New_Field3": null,
"New_Field4": null,
"Modified_Time": "2016-08-22T19:09:43+05:30",
"Date_of_Birth": null,
"Mailing_City": "City",
"New_Check_Box_1": false,
"Title": "Head of Operations",
"Other_Street": null,
"Mobile": null,
"Territories": [],
"Owner": {
"name": "Patricia Boyle",
"id": "4108880000086001"
},
"Last_Name": "Donelly",
"Lead_Source": "Cold Call",
"Fax": "Fax3",
"Lookup_3": null
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}