ODBC guide

Query companies with search API (generic request)


Invokes the CRM search API via the generic request table when no dedicated table exists for the operation. This example searches companies with a filter (e.g. last modified date) and returns selected properties. You can call other valid API paths and methods by changing Url, RequestMethod, and RequestData.

SELECT *
FROM generic_request
WITH (
  Url='crm/v3/objects/companies/search',
  Filter='$.results[*]',
  RequestContentTypeCode='ApplicationJson',
  RequestMethod='POST',
  RequestData='{
    "filters": [ {"propertyName": "hs_lastmodifieddate", "operator": "GT", "value": "<<yearstart-1y||unix_timestamp_ms,FUN_TO_DATE>>" } ],
    "properties": ["address","city","state"]
  }'
)