getSearchRecords 方法
目录
目的
您可以使用此方法利用所选列的表达式搜索记录。
请求 URL
XML 格式:
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
JSON 格式:
https://crm.zoho.com.cn/crm/private/json/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
注意:
- 无论是哪种 Zoho CRM 版本,您仅可发送2 250 次 API 请求/天。 每次调用中,您可以获取最多 200 条记录。
请求参数
| 参数 | 数据类型 | 说明 |
| authtoken* | 字符串 | 验证您的 Zoho 凭据的加密字母数字字符串。 |
| scope* | 字符串 | 将crmapi 指定为范围 |
| selectColumns* | 字符串 | 模块(可选列)即线索(姓氏、网站、邮件)或全部 |
| searchCondition* | 字符串 | (创建者|=|username) |
| newFormat | 整数值 | newFormat=1: 插入来自您的 CRM 账户的数据时排除有 "null" 的字段。 newFormat=2: 插入来自您的 CRM 账户的数据时将有 "null" 的字段包括在内。 |
| fromIndex | 整数值 | 默认值 - 1 |
| toIndex | 整数值 | 默认值 - 20 最大值 - 200 |
| 版本 | 整数值 | version = 1: (默认值)这将基于之前的 API 执行即在进行强化之前获取响应。 version = 2: 这将基于上一次 API 执行获取响应。 |
* - 必填参数
注意:
正则表达式
使用此方法时,确保selectColumns 和 searchCondition 参数设置为必填。 您可以在 API 请求中指定下列表达式:
- is OR =
- isn't OR <>
- contains(*srcString*)
- starts with(srcString*)
- ends with(*srcString)
- doesn't contain
- < OR is before
- > OR is after
- <=
- =>
示例
示例 1
如果您希望从线索中选择线索名称、公司、邮件、手机、网站 ,而且邮件应包含 "@sample.com",则搜索 API 请求应给出如下:
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi&newFormat=1&selectColumns=Leads(Lead Name,Company,Email,Mobile,Website)&searchCondition=(Email|contains|*@sample.com*)
示例 2
如果您想从线索中选择公司、邮件、网站,而且员工数量不超过 100,则搜索 API 请求应给出如下:
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi&newFormat=1&selectColumns=Leads(Company,Email,Website)&searchCondition=(No of Employees|>|100)
示例 3
如果您想从线索中选择线索名称、邮件,而且公司不得以 "Zoho" 开头,则搜索 API 请求应给出如下:
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi&newFormat=1&selectColumns=Leads(Lead Name,Email)&searchCondition=(Company|starts with|Zoho*)
带有等号 (=) 的示例
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=Leads(First Name,Last Name,Email,Company)&searchCondition=(Email|=|test@test.com)
带有大于号 ()> 的示例
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=Leads(First Name,Last Name,Email,Company)
&searchCondition=(Annual Revenue|>|1000)
带有小于号 ()< 的示例
注意:
- 将 null 值替换为带有 "0" 的整数字段。 没有任何值的整数字段将不会包括在搜索内。
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=Leads(First Name,Last Name,Email,Company)
&searchCondition=(customfield1|<|1000)
带有包含的示例
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=Leads(First Name,Last Name,Email,Company)
&searchCondition=(Company|contains|*oho*)
带有开始的示例
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=Leads(First Name,Last Name,Email,Company)
&searchCondition=(Company|starts with|zoho*)
带有结束的示例
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=Leads(First Name,Last Name,Email,Company)
&searchCondition=(Company|ends with|*zoho)
带有等于号 (=) 且 selectColumns=All 的示例
https://crm.zoho.com.cn/crm/private/xml/Leads/getSearchRecords?authtoken=Auth Token&scope=crmapi
&selectColumns=All
&searchCondition=(Email|=|test@test.com)
测试程序
您可以使用所附程序运行并测试在您的 Java 环境中 getSearchRecords 方法的工作效果。
Java 程序包含以下内容:
- 验证令牌生成格式
- 参数及其数值
- 方法的实际使用
点击此处下载程序