可用API列表
目的
要检索特定 API 版本中支持的 API 列表,并可以根据其请求方法或 OAuth 范围过滤 API。
端点
- GET /__apis
请求详情
请求 URL
{api-domain}/crm/{version}/__apis
标题
授权: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
范围
ZohoCRM.apis.READ
参数
- filtersstring, optional
此参数允许您根据URL中指定的版本过滤支持的API。您可以根据三个标准进行过滤:模块、OAuth范围和方法。如果不包含此参数,默认情况下将显示指定API版本的所有支持API。
filters参数的结构:
{
"field": {
"api_name": "{{value}}"
},
"comparator": "equals",
"value": "{{value}}"
}
注意:在发送请求之前,您必须对filters参数的值进行编码。此参数只能有一个标准。
示例:{"field": {"api_name": "operation_types.method"},"comparator": "equals","value": "POST"}
这将获取所有请求方法为POST的API。 - fieldsJSON object,mandatory
表示要过滤的属性。
支持的属性:模块、OAuth 范围和请求方法。
- api_namestring,mandatory
表示要查询的过滤器的 API 名称。支持的过滤器包括:
- operation_types.oauth_scope - 根据指定的 OAuth 范围过滤 API。
- operation_types.method - 根据特定方法过滤 API。
- module(包括 自定义模块)- 过滤支持指定模块的 API。
每个过滤条件在以下部分中都有示例请求和响应的解释。
- comparatorstring,mandatory
表示用于过滤的比较器。支持的值是等于。
- valuestring,mandatory
包含要与field中的api_name键的相应属性进行比较的值,JSON对象。
注意
- 在发送请求之前对 filters 参数的值进行编码。
- filters 参数支持:
- 单一标准。
- 等于比较器。
- 此 API 从版本 2 开始支持。
- 此 API 消耗 1 个积分。
示例请求
Copiedcurl "https://www.zohoapis.com/crm/v8/__apis"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"示例响应
Copied{
"__apis": [
{
"path": "/crm/v8/Quotes/{{id}}/actions/send_mail",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.send_mail.quotes.CREATE",
"max_credits": 20,
"min_credits": 20
},
{
"method": "PUT",
"oauth_scope": "ZohoCRM.send_mail.quotes.CREATE",
"max_credits": 20,
"min_credits": 20
}
]
},
{
"path": "/crm/v8/Accounts/{{id}}/photo",
"operation_types": [
{
"method": "GET",
"oauth_scope": "ZohoCRM.modules.accounts.READ",
"max_credits": 1,
"min_credits": 1
},
{
"method": "DELETE",
"oauth_scope": "ZohoCRM.modules.accounts.DELETE",
"max_credits": 1,
"min_credits": 1
},
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.accounts.CREATE",
"max_credits": 1,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/Deals/{{id}}/Attachments",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.deals.CREATE",
"max_credits": 1,
"min_credits": 1
},
{
"method": "GET",
"oauth_scope": "ZohoCRM.modules.deals.READ",
"max_credits": 1,
"min_credits": 1
},
{
"method": "PUT",
"oauth_scope": "ZohoCRM.modules.deals.UPDATE",
"max_credits": 1,
"min_credits": 1
},
{
"method": "DELETE",
"oauth_scope": "ZohoCRM.modules.deals.DELETE",
"max_credits": 1,
"min_credits": 1
}
]
},
.
.
.
]
}参数 "filters" 的值为 "oauth_scope"
- "api_name": "operation_types.oauth_scope"
根据特定的 OAuth 范围过滤 API。
filters 参数的结构是:
filters : {"field": {"api_name": "operation_types.oauth_scope"}, "comparator": "equals", "value": "{{scope_name}}"}
- 支持的 范围名称 - settings, modules, users, templates, org, mass_convert, features, mass_delete, mass_update, share, change_owner, send_mail, bulk, composite_requests, notifications, 和 coql。
- 要获取 特定模块的 API,包括模块名称如 "modules.线索", "modules.contacts" 等。
- 要获取 特定元数据的 API,指定值为 "settings.territories", "settings.custom_views", "settings.fields" 等。
以下是一个使用 "filters" 参数并将其值设为 "oauth_scope" 的示例请求:
Copiedcurl "https://www.zohoapis.com/crm/v8/__apis?filters=%7B%22field%22%3A%20%7B%22api_name%22%3A%20%22operation_types.oauth_scope%22%7D%2C%22comparator%22%3A%20%22equals%22%2C%22value%22%3A%20%22send_mail%22%7D"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"示例响应
Copied{
"__apis": [
{
"path": "/crm/v8/Quotes/{{id}}/actions/send_mail",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.send_mail.quotes.CREATE",
"max_credits": 20,
"min_credits": 20
},
{
"method": "PUT",
"oauth_scope": "ZohoCRM.send_mail.quotes.CREATE",
"max_credits": 20,
"min_credits": 20
}
]
},
{
"path": "/crm/v8/Invoices/{{id}}/actions/send_mail",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.send_mail.invoices.CREATE",
"max_credits": 20,
"min_credits": 20
},
{
"method": "PUT",
"oauth_scope": "ZohoCRM.send_mail.invoices.CREATE",
"max_credits": 20,
"min_credits": 20
}
]
},
{
"path": "/crm/v8/Sales_Orders/{{id}}/actions/send_mail",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.send_mail.salesorders.CREATE",
"max_credits": 20,
"min_credits": 20
},
{
"method": "PUT",
"oauth_scope": "ZohoCRM.send_mail.salesorders.CREATE",
"max_credits": 20,
"min_credits": 20
}
]
},
.
.
.
]
}参数 "filters" 的值为 "method"
- "api_name": "operation_types.method"
根据请求方法过滤 API。
filters 参数的结构是:
filters - {"field": {"api_name": "operation_types.method"},"comparator": "equals","value": "{{request_method_as_value}}"}
支持的值: GET, POST, PUT, PATCH 和 DELETE。这些值区分大小写。
使用值为 "method" 的 "filters" 参数的示例请求
Copiedcurl "https://www.zohoapis.com/crm/v8/__apis?filters=%7B%22field%22%3A%20%7B%22api_name%22%3A%20%22operation_types.method%22%7D%2C%22comparator%22%3A%20%22equals%22%2C%22value%22%3A%20%22POST%22%7D"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"示例回复
Copied{
"__apis": [
{
"path": "/crm/v8/Quotes/{{id}}/actions/send_mail",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.send_mail.quotes.CREATE",
"max_credits": 20,
"min_credits": 20
}
]
},
{
"path": "/crm/v8/Accounts/{{id}}/photo",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.accounts.CREATE",
"max_credits": 1,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/Deals/upsert",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.deals.CREATE",
"max_credits": 10,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/Deals/{{id}}/Attachments",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.deals.CREATE",
"max_credits": 1,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/Events",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.events.CREATE",
"max_credits": 10,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/Deals/{{id}}/actions/assign_territories",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.deals.UPDATE",
"max_credits": 1,
"min_credits": 1
}
]
},
.
.
.
]
}参数 "filters" 的值为 "module"
- "api_name": "module"
根据支持的模块过滤 API。
filters 参数结构如下:
filters : {"field": {"api_name": "module"},"comparator": "equals","value": "{{module_api_name}}"}
支持的值为系统定义的模块,例如 Leads,Accounts,Contacts,Deals,Campaigns,Tasks,Cases,Meetings,Calls,Solutions,Products,Vendors,Price Books,Quotes,Sales Orders,Purchase Orders,Invoices,Appointments,Appointments Rescheduled History,以及 Services.
使用值为 "module" 的 "filters" 参数的示例请求
Copiedcurl "https://www.zohoapis.com/crm/v8/__apis?filters=%7B%22field%22%3A%20%7B%22api_name%22%3A%20%22module%22%7D%2C%22comparator%22%3A%20%22equals%22%2C%22value%22%3A%20%22Deals%22%7D"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"示例响应
Copied{
"__apis": [
{
"path": "/crm/v8/Deals/upsert",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.deals.CREATE",
"max_credits": 10,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/Deals/{{id}}/Attachments",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.deals.CREATE",
"max_credits": 1,
"min_credits": 1
},
{
"method": "GET",
"oauth_scope": "ZohoCRM.modules.deals.READ",
"max_credits": 1,
"min_credits": 1
},
{
"method": "PUT",
"oauth_scope": "ZohoCRM.modules.deals.UPDATE",
"max_credits": 1,
"min_credits": 1
},
{
"method": "DELETE",
"oauth_scope": "ZohoCRM.modules.deals.DELETE",
"max_credits": 1,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/Deals/{{id}}/actions/assign_territories",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.deals.UPDATE",
"max_credits": 1,
"min_credits": 1
}
]
},
.
.
.
]
}使用值为 "custom" 的 "filters" 参数的示例请求
Copiedcurl "https://www.zohoapis.com/crm/v8/__apis?filters=%7B%22field%22%3A%20%7B%22api_name%22%3A%20%22module%22%7D%2C%22comparator%22%3A%20%22equals%22%2C%22value%22%3A%20%22custom%22%7D"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"响应 JSON 键
- __apisJSON array
包含请求中给定API版本支持的API详细信息URL。
- pathstring
表示请求中API版本的API端点URL。
- operation_typesstring
表示该版本 API 允许的操作。
- methodstring
表示该 API 支持的请求方法。
- oauth_scopestring
表示执行此操作所需的 OAuth 范围。
- max_creditsinteger
表示 API 消耗的最大积分。
- min_creditsinteger
表示 API 消耗的最小积分。
可能的错误
- 无效数据HTTP 400
- 您传递了一个无效的JSON作为filters参数的值。
解决方法:请为filters参数指定一个有效的JSON。请参阅参数部分以获取正确的格式。 - 您在过滤参数中的api_name属性中提供了无效的值。
解决方法:为api_name属性指定一个有效的值。可能的值有operation_types.oauth_scope、operation_types.method和module。 - 您在 filters 参数中为 value 键提供了无效的值。
解决方案:- 对于 "api_name" : "operation_types.oauth_scope",值可以是 modules、settings、share、change_owner、mass_update、mass_delete、mass_convert 等。
- 对于 "api_name" : "operation_types.method",值可以是 GET、POST、PUT、PATCH 和 DELETE。
- 对于 "api_name" : "module",值应为系统定义的模块之一,如 Leads、Contacts、Accounts 等。请参阅 参数 部分以获取支持的值。
- 对于 自定义模块,值应为 custom。
- The comparator you have used is not supported.
Resolution: The supported comparator is equals. - The given method value is not supported.
Resolution: The method value is case-sensitive. The supported methods are GET, POST, PUT, PATCH, and DELETE.
- 您传递了一个无效的JSON作为filters参数的值。
- DEPENDENT_FIELD_MISSINGHTTP 400
您未在参数中指定一个或多个依赖值。
解决方法:为过滤参数指定依赖字段。请参阅参数部分了解强制和可选属性。 - MANDATORY_NOT_FOUNDHTTP 400
参数值中缺少一个或多个必填键。
解决方法:请指定所有必填字段。请参阅参数部分。 - INVALID_REQUEST_METHODHTTP 400
请求方法不正确。
解决方法:使用HTTP GET方法来进行此API调用。任何其他请求方法都会导致此错误。 - OAUTH_SCOPE_MISMATCHHTTP 401
您用于进行此 API 调用的访问令牌不具有所需的范围。
解决方案:生成一个具有范围 ZohoCRM.apis.READ 的新访问令牌,然后再次尝试此 API。 - 认证失败HTTP 401
您尚未使用有效的访问令牌授权API调用。
解决方案:在请求头中包含有效的访问令牌以授权API调用。 - INVALID_URL_PATTERNHTTP 404
请求URL不正确。
解决方法:指定一个有效的请求URL。请参阅请求URL部分。
- 内部错误HTTP 500
服务器中出现意外且未处理的异常。
解决方法:请联系支持团队,邮箱地址为 support@zohocrm.com。
Sample Response
Copied{
"__apis": [
{
"path": "/crm/v8/{{module}}/actions/add_tags",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.custom.UPDATE",
"max_credits": 50,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/{{module}}/{{id}}/Locking_Information__s/{{id}}",
"operation_types": [
{
"method": "GET",
"oauth_scope": "ZohoCRM.modules.custom.READ",
"max_credits": 1,
"min_credits": 1
},
{
"method": "PUT",
"oauth_scope": "ZohoCRM.modules.custom.UPDATE",
"max_credits": 1,
"min_credits": 1
},
{
"method": "DELETE",
"oauth_scope": "ZohoCRM.modules.custom.DELETE",
"max_credits": 1,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/{{module}}/{{id}}/actions/remove_territories",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.custom.UPDATE",
"max_credits": 1,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/{{module}}/upsert",
"operation_types": [
{
"method": "POST",
"oauth_scope": "ZohoCRM.modules.custom.CREATE",
"max_credits": 10,
"min_credits": 1
}
]
},
{
"path": "/crm/v8/{{module}}/deleted",
"operation_types": [
{
"method": "GET",
"oauth_scope": "ZohoCRM.modules.custom.READ",
"max_credits": 2,
"min_credits": 2
}
]
},
.
.
.
]
}