Query Data using Query API V2

This API supports SQL query in ANSI standard. The results return as an array of records. The expected input when calling this API is free form SQL. The expected input objects include data stream, profile and engagement data model objects, and unified data model objects. This API can be used to support a variety of use cases, which includes large volume data reads, external application integration, or interactive ad hoc querying on the data lake.

Key Properties

  • Cursor pagination is supported.
  • GET and POST API calls are supported.
  • The POST endpoint is used to make the first request. The POST endpoint returns data along with batchId for next batch leveraging cursor pagination.
  • The GET endpoint is used for subsequent requests for the same query.
  • The GET endpoint requires a batchId as a parameter.
  • Pagination is forward cursor only, which means the same batchId couldn’t be used more than one time.
  • There’s no explicit limit on the number of nested sub queries.
  • There’s no explicit limit on the number of joins.
  • There’s no explicit limit on the number of filters.
  • There’s no explicit limit on the number of column projections.
  • There’s no explicit limit on the data types.
  • In the response a done boolean flag is exposed. If the flag is set to true, then there are no more records to be queried. If the flag is set to false, then the next page can be retrieved using the next batchId.
  • Response data size is limited to a maximum of 8 MB.
  • The next batch calls are allowed for up to one hour.
  • When using aggregate functions, the results computed are of number types instead of string types.

The response contains a queryId. The ID remains the same irrespective of POST and GET calls.

Note

Connected App Setup

Set Up a Connected App to discover new insights about your customers.

Acquire and Exchange Your Access Token for Salesforce CDP

Refer to Getting Started page to acquire the CDP token.