Endpoint Read Data (Direct COQL Query - Auto Paging)
Name
get_module_data_coql
Description
Parameters
| Parameter | Required | Options | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: sql_query Enter a direct Zoho CRM COQL SELECT query. The query is sent to Zoho's /coql API and executed server-side, so filters, sorting, selected columns, joins, and aggregate functions are handled by Zoho before data is returned. If your query does not include a LIMIT clause, this connector automatically adds LIMIT {offset}, PageSize and continues paging while Zoho returns more records. If you include your own LIMIT clause, the connector treats it as a fixed query and does not auto-inject paging. API v2 supports up to 200 rows per page. Newer API versions such as v7/v8 support larger page sizes, up to 2000 rows per page. Zoho COQL offset paging has a documented maximum window: v7/v8 allow up to 100,000 rows per query criteria, while v6 documents a 10,000-row window. For larger pulls, split the query using a stable condition such as id > last_record_id and repeat the request. Use v2 for the Emails module or when a COQL feature fails in newer API versions. If aggregate queries such as COUNT or SUM fail, try another API version. |
||||||||||||
|
Name:
Label: API Version Zoho CRM API version used for the COQL request. Use the latest version for normal queries. Use v2 for the Emails module or when a query behaves differently or fails in newer API versions. |
|
|||||||||||
|
Name:
Label: PageSize Number of rows requested per COQL page. Use 200 or less with API v2. Newer API versions support larger page sizes, up to 2000. For the Emails module, use Version v2 and PageSize 200 or less. |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples
SSIS
Use Zoho CRM Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
| Optional Parameters | |
|---|---|
| sql_query | select Email, Country from Leads where Country = 'United States' order by id desc |
| API Version | |
| PagingMode | ByPostData |
| NextUrlEndIndicator | false |
| StopIndicatorAttributeOrExpr | $.info.more_records |
| NextUrlWaitInMs | 0 |
| PagingByUrlAttributeName | {%offset%} |
| PagingByUrlCurrentPage | 0 |
| PageSize | 200 |
| PagingIncrementBy | 200 |
API Destination
| Optional Parameters | |
|---|---|
| sql_query | select Email, Country from Leads where Country = 'United States' order by id desc |
| API Version | |
| PagingMode | ByPostData |
| NextUrlEndIndicator | false |
| StopIndicatorAttributeOrExpr | $.info.more_records |
| NextUrlWaitInMs | 0 |
| PagingByUrlAttributeName | {%offset%} |
| PagingByUrlCurrentPage | 0 |
| PageSize | 200 |
| PagingIncrementBy | 200 |
ODBC application
Use these SQL queries in your ODBC application data source:
Read data using Direct COQL Endpoint
<p>Runs a direct Zoho CRM COQL query using the <code>get_module_data_coql</code> endpoint. Enter the full COQL statement in the <code>sql_query</code> parameter. The connector sends the query to Zoho's <code>/coql</code> API and automatically pages results when your query does not include a <code>LIMIT</code> clause.</p> <p>Use this endpoint when you want full control over the COQL query, including selected fields, filters, joins, sorting, and aggregate expressions. For a guided parameter-based experience, use the <code>get_module_data_coql_builder</code> endpoint instead.</p> <p><strong>Tip:</strong> If you want to run native COQL directly without calling an endpoint with <code>WITH(...)</code>, use the <code>#DirectSql</code> prefix. See the native COQL pass-through example below.</p> <p>API <code>v2</code> supports up to <strong>200 rows per page</strong>. Newer API versions such as <code>v7</code> or <code>v8</code> support larger page sizes, up to <strong>2000 rows per page</strong>. For the Emails module, use API <code>v2</code> and keep <code>PageSize</code> at <code>200</code> or less.</p>
SELECT *
FROM get_module_data_coql
WITH(
sql_query = 'select Last_Name, First_Name, Company from Leads where Company like ''Test'' order by id desc'
, Version = 'v8'
, PageSize = '2000'
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read data using Direct COQL Endpoint
<p>Runs a direct Zoho CRM COQL query using the <code>get_module_data_coql</code> endpoint. Enter the full COQL statement in the <code>sql_query</code> parameter. The connector sends the query to Zoho's <code>/coql</code> API and automatically pages results when your query does not include a <code>LIMIT</code> clause.</p> <p>Use this endpoint when you want full control over the COQL query, including selected fields, filters, joins, sorting, and aggregate expressions. For a guided parameter-based experience, use the <code>get_module_data_coql_builder</code> endpoint instead.</p> <p><strong>Tip:</strong> If you want to run native COQL directly without calling an endpoint with <code>WITH(...)</code>, use the <code>#DirectSql</code> prefix. See the native COQL pass-through example below.</p> <p>API <code>v2</code> supports up to <strong>200 rows per page</strong>. Newer API versions such as <code>v7</code> or <code>v8</code> support larger page sizes, up to <strong>2000 rows per page</strong>. For the Emails module, use API <code>v2</code> and keep <code>PageSize</code> at <code>200</code> or less.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM get_module_data_coql
WITH(
sql_query = ''select Last_Name, First_Name, Company from Leads where Company like ''''Test'''' order by id desc''
, Version = ''v8''
, PageSize = ''2000''
)';
EXEC (@MyQuery) AT [LS_TO_ZOHO_CRM_IN_GATEWAY];