CdpQuery Class

Get Data 360 metadata and query data.

Namespace

ConnectApi

CdpQuery Methods

These methods are for CdpQuery. All methods are static.

getAllMetadata()

Get all metadata, including Calculated Insights, Engagement, Profile, and other objects, as well as their relationships to other objects.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getAllMetadata()

getAllMetadata(entityType, entityCategory, entityName)

Get all metadata, filtering for entity type, category, and name.

API Version

54.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getAllMetadata(String entityType, String entityCategory, String entityName)

Parameters

entityType
Type: String
Type of metadata entity requested. Valid values are DataLakeObject, DataModelObject, and CalculatedInsight. If unspecified, all types are returned.
entityCategory
Type: String
Category of the metadata entity. Valid values are Profile, Engagement, and Related. If unspecified, all category entities are returned.
entityName
Type: String
Metadata name of the entity, for example UnifiedIndividual__dlm. If unspecified, a complete list of entities is returned.

getAllMetadata(entityType, entityCategory, entityName, dataspace)

Get all metadata, filtering for entity type, category, name, and data space.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getAllMetadata(String entityType, String entityCategory, String entityName, String dataspace)

Parameters

entityType
Type: String
Type of metadata entity requested. Valid values are DataLakeObject, DataModelObject, and CalculatedInsight. If unspecified, all types are returned.
entityCategory
Type: String
Category of the metadata entity. Valid values are Profile, Engagement, and Related. If unspecified, all category entities are returned.
entityName
Type: String
Metadata name of the entity, for example UnifiedIndividual__dlm. If unspecified, a complete list of entities is returned.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

getDataGraphData(dataGraphEntityName, id)

Query a data graph in the default data space. For real-time data graphs, the method attempts to retrieve data from the real-time data graph but falls back to the standard data graph if the real-time data graph is unavailable.

API Version

59.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput getDataGraphData(String dataGraphEntityName, String id)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
id
Type: String
Record ID to query for. The ID is matched against the primary key field of the primary Data Model Object (DMO) in the data graph.

Return Value

Type: ConnectApi.CdpQueryOutput

getDataGraphData(dataGraphEntityName, id, dataspace)

Query a data graph in a specified data space. For real-time data graphs, the method attempts to retrieve data from the real-time data graph but falls back to the standard data graph if the real-time data graph is unavailable.

API Version

59.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput getDataGraphData(String dataGraphEntityName, String id, String dataspace)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
id
Type: String
Record ID to query for. The ID is matched against the primary key field of the primary Data Model Object (DMO) in the data graph.
dataspace
Type: String
Name of the data space in which to query the data graph.

Return Value

Type: ConnectApi.CdpQueryOutput

getDataGraphData(dataGraphEntityName, id, live)

Query a data graph by performing a live lookup in the default data space. For real-time data graphs, the method attempts to retrieve data from the real-time data graph but falls back to the standard data graph if the real-time data graph is unavailable.

API Version

63.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput getDataGraphData(String dataGraphEntityName, String id, Boolean live)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
id
Type: String
Record ID to query for. The ID is matched against the primary key field of the primary Data Model Object (DMO) in the data graph.
live
Type: Boolean
Indicates whether live lookup for the data graph is enabled (true) or not (false). With live lookup, the Query Service does not query the data graph itself. It instead queries the data graph's metadata to return data that is guaranteed to be fresh. The response mimics the structure of the regular JSON-formatted response for the data graph. You can use live lookup on any data graph, regardless of the complexity of its structure.

Return Value

Type: ConnectApi.CdpQueryOutput

getDataGraphData(dataGraphEntityName, id, dataspace, live)

Query a data graph by performing a live lookup in a specified data space. For real-time data graphs, the method attempts to retrieve data from the real-time data graph but falls back to the standard data graph if the real-time data graph is unavailable.

API Version

63.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput getDataGraphData(String dataGraphEntityName, String id, String dataspace, Boolean live)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
id
Type: String
Record ID to query for. The ID is matched against the primary key field of the primary Data Model Object (DMO) in the data graph.
dataspace
Type: String
Name of the data space in which to query the data graph.
live
Type: Boolean
Indicates whether live lookup for the data graph is enabled (true) or not (false). With live lookup, the Query Service does not query the data graph itself. It instead queries the data graph's metadata to return data that is guaranteed to be fresh. The response mimics the structure of the regular JSON-formatted response for the data graph. You can use live lookup on any data graph, regardless of the complexity of its structure.

Return Value

Type: ConnectApi.CdpQueryOutput

getDataGraphDataWithLookupKeys(dataGraphEntityName, lookupKeys)

Query a data graph by the primary key of either the primary Data Model Object (DMO) or the Individual linked DMO. Get the data from the default data space. For real-time data graphs, the method attempts to retrieve data from the real-time data graph but falls back to the standard data graph if the real-time data graph is unavailable.

API Version

59.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput getDataGraphDataWithLookupKeys(String dataGraphEntityName, String lookupKeys)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
lookupKeys
Type: String
Lookup key and value to search on. Specify one of these key-value pairs:
  • The primary key of the primary DMO, for example, lookupKeys=[id__c=def]
  • The primary key of the Individual linked DMO, for example, lookupKeys=[IndividualLink__dlm.SourceRecordId__c=1111111]

Return Value

Type: ConnectApi.CdpQueryOutput

getDataGraphDataWithLookupKeys(dataGraphEntityName, lookupKeys, dataspace)

Query a data graph by the primary key of either the primary Data Model Object (DMO) or the Individual linked DMO. Get the data from a specified data space. For real-time data graphs, the method attempts to retrieve data from the real-time data graph but falls back to the standard data graph if the real-time data graph is unavailable.

API Version

59.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput getDataGraphDataWithLookupKeys(String dataGraphEntityName, String lookupKeys, String dataspace)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
lookupKeys
Type: String
Lookup key and value to search on. Specify one of these key-value pairs:
  • The primary key of the primary DMO, for example, lookupKeys=[id__c=def]
  • The primary key of the Individual linked DMO, for example, lookupKeys=[IndividualLink__dlm.SourceRecordId__c=1111111]
dataspace
Type: String
Name of the data space in which to query the data graph.

Return Value

Type: ConnectApi.CdpQueryOutput

getDataGraphDataWithLookupKeys(dataGraphEntityName, lookupKeys, dataspace, noCache)

Query a data graph by the primary key of either the primary Data Model Object (DMO) or the Individual linked DMO. Get the data from a specified data space. Get data from a standard or real-time data graph. For real-time data graphs, the method attempts to retrieve data from the real-time data graph but falls back to the standard data graph if the real-time data graph is unavailable.

API Version

64.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput getDataGraphDataWithLookupKeys(String dataGraphEntityName, String lookupKeys, String dataspace, Boolean noCache)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
lookupKeys
Type: String
Lookup key and value to search on. Specify one of these key-value pairs:
  • The primary key of the primary DMO, for example, lookupKeys=[id__c=def]
  • The primary key of the Individual linked DMO, for example, lookupKeys=[IndividualLink__dlm.SourceRecordId__c=1111111]
dataspace
Type: String
Name of the data space in which to query the data graph.
noCache
Type: Boolean
Indicates whether to read data from the standard, non-real-time data graph (true) or the real-time data graph (false).

Return Value

Type: ConnectApi.CdpQueryOutput

getDataGraphMetadata()

Retrieve metadata from all data graphs in the default data space. Retrieves data from both standard and real-time data graphs.

API Version

59.0

Requires Chatter

No

Signature

public static ConnectApi.CdpDgMetadata getDataGraphMetadata()

Return Value

Type: ConnectApi.CdpDgMetadata

getDataGraphMetadata(dataGraphEntityName)

Retrieve metadata from a specified data graph in the default data space. Retrieves data from both standard and real-time data graphs.

API Version

59.0

Requires Chatter

No

Signature

public static ConnectApi.CdpDgMetadata getDataGraphMetadata(String dataGraphEntityName)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.

Return Value

Type: ConnectApi.CdpDgMetadata

getDataGraphMetadata(dataGraphEntityName, dataspace)

Retrieve metadata from a specified data graph in a specified data space. Retrieves data from both standard and real-time data graphs.

API Version

59.0

Requires Chatter

No

Signature

public static ConnectApi.CdpDgMetadata getDataGraphMetadata(String dataGraphEntityName, String dataspace)

Parameters

dataGraphEntityName
Type: String
API name of the data graph to query.
dataspace
Type: String
Name of the data space in which to query the data graph.

Return Value

Type: ConnectApi.CdpDgMetadata

getInsightsMetadata()

Get Insight metadata, including Calculated Insight objects, their dimensions and measures.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getInsightsMetadata()

getInsightsMetadata(ciName)

Get metadata for a Calculated Insight object. Metadata includes dimensions and measures.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getInsightsMetadata(String ciName)

Parameters

ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.

getInsightsMetadata(ciName, dataspace)

Get metadata for a Calculated Insight object and specify the data space. Metadata includes dimensions and measures.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getInsightsMetadata(String ciName, String dataspace)

Parameters

ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

getMetadataEntities()

Get a list of metadata entities and retrieve only essential fields to optimize performance at scale.

API Version

66.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataEntitiesOutput getMetadataEntities()

Example

getMetadataEntities(entityCategory, entityType)

Get a list of metadata entities and retrieve only essential fields to optimize performance at scale. Specify the entity category and type.

API Version

66.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataEntitiesOutput getMetadataEntities(String entityCategory, String entityType)

Parameters

entityCategory
Type: String
Category of the metadata entity. Supported values are:
  • Activation_Audience
  • CG_Audience
  • Content
  • Directory_Table
  • Engagement
  • Profile
  • Related
  • Segment_Membership
  • Vector_Embedding
entityType
Type: String
Type of metadata entity. Supported values are:
  • Calculated_Insight
  • DataLakeObject
  • DataModelObject

Example

getMetadataEntities(entityCategory, entityType, dataspace)

Get a list of metadata entities and retrieve only essential fields to optimize performance at scale. Specify the entity category, type, and data space.

API Version

66.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataEntitiesOutput getMetadataEntities(String entityCategory, String entityType, String dataspace)

Parameters

entityCategory
Type: String
Category of the metadata entity. Supported values are:
  • Activation_Audience
  • CG_Audience
  • Content
  • Directory_Table
  • Engagement
  • Profile
  • Related
  • Segment_Membership
  • Vector_Embedding
entityType
Type: String
Type of metadata entity. Supported values are:
  • Calculated_Insight
  • DataLakeObject
  • DataModelObject
dataspace
Type: String
Name of the data space in which to query the metadata entities.

Example

getProfileMetadata()

Get metadata for data model objects in the profile category, including Individual, Contact Point Email, Unified Individual, and Contact Point Address objects. Metadata includes the objects, their fields, and category.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getProfileMetadata()

getProfileMetadata(dataModelName)

Get metadata for a data model object in the profile category, such as Individual, Contact Point Email, Unified Individual, and Contact Point Address. Metadata includes the list of fields, data types, and indexes available for lookup.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getProfileMetadata(String dataModelName)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.

getProfileMetadata(dataModelName, dataspace)

Get metadata for a data model object in the profile category, such as Individual, Contact Point Email, Unified Individual, and Contact Point Address. Also, specify the data space. Metadata includes the list of fields, data types, and indexes available for lookup.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryMetadataOutput getProfileMetadata(String dataModelName, String dataspace)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

queryANSISql(input)

Synchronously query data across data model, lake, unified, and linked objects. This query returns up to 49,999 rows.

A newer version of the Query API is available. We recommend using queryAnsiSqlV2(input) and nextBatchAnsiSqlV2(nextBatchId) to take advantage of subsequent requests and larger response sizes.

Note

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryANSISql(ConnectApi.CdpQueryInput input)

Parameters

input
Type: ConnectApi.CdpQueryInput
A ConnectApi.CdpQueryInput body with the SQL query.

Return Value

Type: ConnectApi.CdpQueryOutput

queryANSISql(input, batchSize, offset, orderby)

Synchronously query data across data model, lake, unified, and linked objects. Specify batch size, offset, and order of the results. This query returns up to 49,999 rows.

A newer version of the Query API is available. We recommend using queryAnsiSqlV2(input) and nextBatchAnsiSqlV2(nextBatchId) to take advantage of subsequent requests and larger response sizes.

Note

API Version

53.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryANSISql(ConnectApi.CdpQueryInput input, Integer batchSize, Integer offset, String orderby)

Parameters

input
Type: ConnectApi.CdpQueryInput
A ConnectApi.CdpQueryInput body with the SQL query.
batchSize
Type: Integer
Number of records to return. Values are from 1-49999. The default value is 49999.
offset
Type: Integer
Number of rows to skip before returning results. The sum of offset and batchSize must be less than 2147483647. The default value is 0.
orderby
Type: String
Comma-separated values to sort the results in ascending or descending order, for example, GenderId__c ASC,Occupation__c DESC.

Return Value

Type: ConnectApi.CdpQueryOutput

queryANSISql(input, batchSize, offset, orderby, dataspace)

Synchronously query data across data model, lake, unified, and linked objects. Specify batch size, offset, order of the results, and data space. This query returns up to 49,999 rows.

A newer version of the Query API is available. We recommend using queryAnsiSqlV2(input) and nextBatchAnsiSqlV2(nextBatchId) to take advantage of subsequent requests and larger response sizes.

Note

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryANSISql(ConnectApi.CdpQueryInput input, Integer batchSize, Integer offset, String orderby, String dataspace)

Parameters

input
Type: ConnectApi.CdpQueryInput
A ConnectApi.CdpQueryInput body with the SQL query.
batchSize
Type: Integer
Number of records to return. Values are from 1-49999. The default value is 49999.
offset
Type: Integer
Number of rows to skip before returning results. The sum of offset and batchSize must be less than 2147483647. The default value is 0.
orderby
Type: String
Comma-separated values to sort the results in ascending or descending order, for example, GenderId__c ASC,Occupation__c DESC.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.CdpQueryOutput

queryAnsiSqlV2(input)

Query data across data model, lake, unified, and linked objects.

API Version

54.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutputV2 queryAnsiSqlV2(ConnectApi.CdpQueryInput input)

Parameters

input
Type: ConnectApi.CdpQueryInput
A ConnectApi.CdpQueryInput body with the SQL query.

Return Value

Type: ConnectApi.CdpQueryOutputV2

Usage

Use the nextBatchId in the ConnectApi.CdpQueryOutputV2 output class as the nextBatchId parameter in the nextBatchAnsiSqlV2(nextBatchId) method to continue getting batches of data for up to an hour.

queryAnsiSqlV2(input, dataspace)

Query data across data model, lake, unified, and linked objects. Also, specify the data space.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutputV2 queryAnsiSqlV2(ConnectApi.CdpQueryInput input, String dataspace)

Parameters

input
Type: ConnectApi.CdpQueryInput
A ConnectApi.CdpQueryInput body with the SQL query.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.CdpQueryOutputV2

Usage

Use the nextBatchId in the ConnectApi.CdpQueryOutputV2 output class as the nextBatchId parameter in the nextBatchAnsiSqlV2(nextBatchId) method to continue getting batches of data for up to an hour.

nextBatchAnsiSqlV2(nextBatchId)

Get the next batch of data across data model, lake, unified, and linked objects.

API Version

54.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutputV2 nextBatchAnsiSqlV2(String nextBatchId)

Parameters

nextBatchId
Type: String
ID of the next batch. See the Usage section for more information.

Return Value

Type: ConnectApi.CdpQueryOutputV2

Usage

Initially, use the queryAnsiSqlV2(input) method to query up to 8 MB of data. Use the nextBatchId from the ConnectApi.CdpQueryOutputV2 output class as the nextBatchId parameter in this method to get the next batch of data. You can continue using subsequent next batch IDs for up to an hour.

nextBatchAnsiSqlV2(nextBatchId, dataspace)

Get the next batch of data across data model, lake, unified, and linked objects. Also, specify the data space.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutputV2 nextBatchAnsiSqlV2(String nextBatchId, String dataspace)

Parameters

nextBatchId
Type: String
ID of the next batch. See the Usage section for more information.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.CdpQueryOutputV2

Usage

Initially, use the queryAnsiSqlV2(input) method to query up to 8 MB of data. Use the nextBatchId from the ConnectApi.CdpQueryOutputV2 output class as the nextBatchId parameter in this method to get the next batch of data. You can continue using subsequent next batch IDs for up to an hour.

querySql(input)

Submit an SQL query request for execution and retrieve the first chunk of data.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlOutput querySql(ConnectApi.QuerySqlInput input)

Parameters

input
Type: ConnectApi.QuerySqlInput
Input representation for an SQL query.

Return Value

Type: ConnectApi.QuerySqlOutput

Usage

To get started with writing queries, see Write a Simple Query. For more information about creating SQL statements, see Data 360 SQL Syntax.

Example

Submit a query, check its status, then retrieve and process data in chunks until all results are fetched:

querySql(input, dataspace)

Submit an SQL query request for execution and specify the data space.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlOutput querySql(ConnectApi.QuerySqlInput input, String dataspace)

Parameters

input
Type: ConnectApi.QuerySqlInput
Input representation for an SQL query.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlOutput

Usage

To get started with writing queries, see Write a Simple Query. For more information about creating SQL statements, see Data 360 SQL Syntax.

Example

Submit a query with a data space:

querySql(input, workloadName, dataspace)

Submit an SQL query request for execution and specify the workload name and data space.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlOutput querySql(ConnectApi.QuerySqlInput input, String workloadName, String dataspace)

Parameters

input
Type: ConnectApi.QuerySqlInput
Input representation for an SQL query.
workloadName
Type: String
Description of the scenario, task, or application name that your query handles. Set this value to help Salesforce Customer Support assist you with debugging issues.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlOutput

Usage

To get started with writing queries, see Write a Simple Query. For more information about creating SQL statements, see Data 360 SQL Syntax.

Example

Submit a query with a data space and workload name:

querySqlRows(queryId, offset, rowLimit)

Get additional query results that weren't returned in the initial request. Paginate through existing query results by specifying the offset and row limit. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlPageOutput querySqlRows(String queryId, Long offset, Long rowLimit)

Parameters

queryId
Type: String
ID from the initial query to retrieve more results, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
offset
Type: Long
Row number to start with when retrieving the next chunk of query results. Value must be less than the total number of available rows. If unspecified, no rows are skipped.
rowLimit
Type: Long
Maximum number of rows to include in the response. The actual number of rows returned may be lower than the requested value if fewer are available or if the result set exceeds internal system size limits. Value must be greater than 0.

Return Value

Type: ConnectApi.QuerySqlPageOutput

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Query additional rows with an offset and row limit:

querySqlRows(queryId, offset, rowLimit, omitSchema)

Get additional query results that weren't returned in the initial request. Paginate through existing query results by specifying the offset and row limit. Also, specify whether to include metadata in the response or not. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlPageOutput querySqlRows(String queryId, Long offset, Long rowLimit, Boolean omitSchema)

Parameters

queryId
Type: String
ID from the initial query to retrieve more results, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
offset
Type: Long
Row number to start with when retrieving the next chunk of query results. Value must be less than the total number of available rows. If unspecified, no rows are skipped.
rowLimit
Type: Long
Maximum number of rows to include in the response. The actual number of rows returned may be lower than the requested value if fewer are available or if the result set exceeds internal system size limits. Value must be greater than 0.
omitSchema
Type: Boolean
Indicates whether to exclude metadata from the response (true) or not (false). Omitting the schema reduces the amount of data returned and improves performance.

Return Value

Type: ConnectApi.QuerySqlPageOutput

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Query additional rows with an offset, a row limit, and omitting the schema:

querySqlRows(queryId, offset, rowLimit, dataspace)

Get additional query results that weren’t returned in the initial request. Paginate through existing query results by specifying the offset and row limit. Also, specify the data space. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlPageOutput querySqlRows(String queryId, Long offset, Long rowLimit, String dataspace)

Parameters

queryId
Type: String
ID from the initial query to retrieve more results, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
offset
Type: Long
Row number to start with when retrieving the next chunk of query results. Value must be less than the total number of available rows. If unspecified, no rows are skipped.
rowLimit
Type: Long
Maximum number of rows to include in the response. The actual number of rows returned may be lower than the requested value if fewer are available or if the result set exceeds internal system size limits. Value must be greater than 0.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlPageOutput

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Query additional rows with an offset, row limit, and data space:

querySqlRows(queryId, offset, rowLimit, omitSchema, dataspace)

Get additional query results that weren't returned in the initial request. Paginate through existing query results by specifying the offset and row limit. Also, specify the data space and whether or not to exclude metadata from the response. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlPageOutput querySqlRows(String queryId, Long offset, Long rowLimit, Boolean omitSchema, String dataspace)

Parameters

queryId
Type: String
ID from the initial query to retrieve more results, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
offset
Type: Long
Row number to start with when retrieving the next chunk of query results. Value must be less than the total number of available rows. If unspecified, no rows are skipped.
rowLimit
Type: Long
Maximum number of rows to include in the response. The actual number of rows returned may be lower than the requested value if fewer are available or if the result set exceeds internal system size limits. Value must be greater than 0.
omitSchema
Type: Boolean
Indicates whether to exclude metadata from the response (true) or not (false). Omitting the schema reduces the amount of data returned and improves performance.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlPageOutput

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Query additional rows with an offset, row limit, data space, and omitting the schema:

querySqlRows(queryId, offset, rowLimit, workloadName, dataspace)

Get additional query results that weren't returned in the initial request. Paginate through existing query results by specifying the offset and row limit. Also, specify the workload name and data space. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlPageOutput querySqlRows(String queryId, Long offset, Long rowLimit, String workloadName, String dataspace)

Parameters

queryId
Type: String
ID from the initial query to retrieve more results, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
offset
Type: Long
Row number to start with when retrieving the next chunk of query results. Value must be less than the total number of available rows. If unspecified, no rows are skipped.
rowLimit
Type: Long
Maximum number of rows to include in the response. The actual number of rows returned may be lower than the requested value if fewer are available or if the result set exceeds internal system size limits. Value must be greater than 0.
workloadName
Type: String
Description of the scenario, task, or application name that your query handles. Set this value to help Salesforce Customer Support assist you with debugging issues.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlPageOutput

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Query additional rows with an offset, row limit, workload name, and data space:

querySqlRows(queryId, offset, rowLimit, omitSchema, workloadName, dataspace)

Get additional query results that weren't returned in the initial request. Paginate through existing query results by specifying the offset and row limit. Also, specify the workload name, data space, and whether or not to exclude metadata from the response. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlPageOutput querySqlRows(String queryId, Long offset, Long rowLimit, Boolean omitSchema, String workloadName, String dataspace)

Parameters

queryId
Type: String
ID from the initial query to retrieve more results, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
offset
Type: Long
Row number to start with when retrieving the next chunk of query results. Value must be less than the total number of available rows. If unspecified, no rows are skipped.
rowLimit
Type: Long
Maximum number of rows to include in the response. The actual number of rows returned may be lower than the requested value if fewer are available or if the result set exceeds internal system size limits. Value must be greater than 0.
omitSchema
Type: Boolean
Indicates whether to exclude metadata from the response (true) or not (false). Omitting the schema reduces the amount of data returned and improves performance.
workloadName
Type: String
Description of the scenario, task, or application name that your query handles. Set this value to help Salesforce Customer Support assist you with debugging issues.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlPageOutput

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Query additional rows with an offset, row limit, workload name, data space, and omitting the schema:

cancelQuerySql(queryId)

Delete the specified query and terminate long-running queries that are no longer needed to manage resource consumption.

API Version

62.0

Requires Chatter

No

Signature

public static Void cancelQuerySql(String queryId)

Parameters

queryId
Type: String
ID of the query to cancel, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.

Return Value

Type: Void

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Cancel a query:

cancelQuerySql(queryId, dataspace)

Delete the specified query and terminate long-running queries that are no longer needed to manage resource consumption. Specify the data space.

API Version

62.0

Requires Chatter

No

Signature

public static Void cancelQuerySql(String queryId, String dataspace)

Parameters

queryId
Type: String
ID of the query to cancel, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: Void

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Cancel a query with a data space:

cancelQuerySql(queryId, workloadName, dataspace)

Delete the specified query and terminate long-running queries that are no longer needed to manage resource consumption. Specify the data space and workload name.

API Version

62.0

Requires Chatter

No

Signature

public static Void cancelQuerySql(String queryId, String workloadName, String dataspace)

Parameters

queryId
Type: String
ID of the query to cancel, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
workloadName
Type: String
Description of the scenario, task, or application name that your query handles. Set this value to help Salesforce Customer Support assist you with debugging issues.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: Void

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Cancel a query with a workload name and data space:

querySqlStatus(queryId)

Get the status of an SQL query request. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlStatus querySqlStatus(String queryId)

Parameters

queryId
Type: String
ID of the query to return the status for, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.

Return Value

Type: ConnectApi.QuerySqlStatus

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Get the status of a query:

querySqlStatus(queryId, waitTimeMs)

Get the status of an SQL query request and specify the time to wait before returning the response. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlStatus querySqlStatus(String queryId, Integer waitTimeMs)

Parameters

queryId
Type: String
ID of the query to return the status for, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
waitTimeMs
Type: Integer
Maximum time (in milliseconds) to wait for the result. Configure a wait time up to 10 seconds before returning the status without chunk information. If unspecified, the status is returned immediately. Use this to avoid resource limits by delaying requests.

Return Value

Type: ConnectApi.QuerySqlStatus

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Get the status of a query with wait time:

querySqlStatus(queryId, dataspace)

Get the status of an SQL query request and specify the data space. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlStatus querySqlStatus(String queryId, String dataspace)

Parameters

queryId
Type: String
ID of the query to return the status for, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlStatus

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Get the status of a query with a data space:

querySqlStatus(queryId, dataspace, waitTimeMs)

Get the status of an SQL query request. Specify the data space and time to wait before returning the response. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlStatus querySqlStatus(String queryId, String dataspace, Integer waitTimeMs)

Parameters

queryId
Type: String
ID of the query to return the status for, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.
waitTimeMs
Type: Integer
Maximum time (in milliseconds) to wait for the result. Configure a wait time up to 10 seconds before returning the status. If unspecified, the status is returned immediately. Use this to avoid resource limits by delaying requests.

Return Value

Type: ConnectApi.QuerySqlStatus

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Get the status of a query with a data space and wait time:

querySqlStatus(queryId, workloadName, dataspace)

Get the status of an SQL query request. Specify the workload name and data space. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlStatus querySqlStatus(String queryId, String workloadName, String dataspace)

Parameters

queryId
Type: String
ID of the query to return the status for, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
workloadName
Type: String
Description of the scenario, task, or application name that your query handles. Set this value to help Salesforce Customer Support assist you with debugging issues.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.QuerySqlStatus

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Get the status of a query with a workload name and data space:

querySqlStatus(queryId, workloadName, dataspace, waitTimeMs)

Get the status of an SQL query request. Specify the workload name, data space, and time to wait before returning the response. Results are available for up to 24 hours.

API Version

62.0

Requires Chatter

No

Signature

public static ConnectApi.QuerySqlStatus querySqlStatus(String queryId, String workloadName, String dataspace, Integer waitTimeMs)

Parameters

queryId
Type: String
ID of the query to return the status for, for example MTAuMjMuMTU2LjIwODo3NDg0_49169cf8-a6f4-738f-6544-c3a7ba2ff548. The query ID is returned in the querySql response.
workloadName
Type: String
Description of the scenario, task, or application name that your query handles. Set this value to help Salesforce Customer Support assist you with debugging issues.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.
waitTimeMs
Type: Integer
Maximum time (in milliseconds) to wait for the result. Configure a wait time up to 10 seconds before returning the status . If unspecified, the status is returned immediately. Use this to avoid resource limits by delaying requests.

Return Value

Type: ConnectApi.QuerySqlStatus

Usage

Retrieve the queryId from the initial query request. To submit an SQL query request for execution, call querySql(input), querySql(input, dataspace), or querySql(input, workloadName, dataspace).

Example

Get the status of a query with a workload name, data space, and wait time:

queryCalculatedInsights(ciName, dimensions, measures, orderby, filters, batchSize, offset)

Query a Calculated Insight object.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryCalculatedInsights(String ciName, String dimensions, String measures, String orderby, String filters, Integer batchSize, Integer offset)

Parameters

ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.
filters
Type: String
Filter the result set to a more narrow scope or specific type, such as [GenderId__c=Male,​FirstName__c=Angel].
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 4999.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.

Return Value

Type: ConnectApi.CdpQueryOutput

queryCalculatedInsights(ciName, dimensions, measures, orderby, filters, batchSize, offset, timeGranularity)

Query a Calculated Insight object within a specified time range.

API Version

54.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryCalculatedInsights(String ciName, String dimensions, String measures, String orderby, String filters, Integer batchSize, Integer offset, String timeGranularity)

Parameters

ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.
filters
Type: String
Filter the result set to a more narrow scope or specific type, such as [GenderId__c=Male,​FirstName__c=Angel].
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 4999.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
timeGranularity
Type: String
Time range for the measures. Values are:
  • HOUR
  • DAY
  • MONTH
  • QUARTER
  • YEAR
If unspecified, no time range is applied.

Return Value

Type: ConnectApi.CdpQueryOutput

queryCalculatedInsights(ciName, dimensions, measures, orderby, filters, batchSize, offset, timeGranularity, dataspace)

Query a Calculated Insight object within a specified time range and specify the data space.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryCalculatedInsights(String ciName, String dimensions, String measures, String orderby, String filters, Integer batchSize, Integer offset, String timeGranularity, String dataspace)

Parameters

ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.
filters
Type: String
Filter the result set to a more narrow scope or specific type, such as [GenderId__c=Male,​FirstName__c=Angel].
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 4999.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
timeGranularity
Type: String
Time range for the measures. Values are:
  • HOUR
  • DAY
  • MONTH
  • QUARTER
  • YEAR
If unspecified, no time range is applied.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, filters, fields, batchSize, offset, orderby)

Query a Profile data model object using filters.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, Id__c is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, searchKey, filters, fields, batchSize, offset, orderby)

Query a Profile data model object using filters and a search key.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String searchKey, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, Id__c is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, childDataModelName, searchKey, filters, fields, batchSize, offset, orderby)

Query a Profile data model object and a child object using filters and a search key.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String childDataModelName, String searchKey, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
childDataModelName
Type: String
Name of the child data model object, for example, UnifiedContactPointEmail__dlm.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON]. Filters are applied to the parent object only.
fields
Type: String
Comma-separated list of child object field names that you want to include in the result, for example, Id__c,EmailAddress__c. If unspecified, the first 10 alphabetically sorted fields are returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, ciName, searchKey, dimensions, measures, filters, fields, batchSize, offset, orderby)

Query a Profile data model object and a Calculated Insight object using filters and a search key.

API Version

52.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String ciName, String searchKey, String dimensions, String measures, String filters, String fields, Integer batchSize, Integer offset, String orderby)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, Id__c is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, ciName, searchKey, dimensions, measures, filters, fields, batchSize, offset, orderby, timeGranularity)

Query a Profile data model object and a Calculated Insight object using filters, a search key, and a time range.

API Version

54.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String ciName, String searchKey, String dimensions, String measures, String filters, String fields, Integer batchSize, Integer offset, String orderby, String timeGranularity)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, Id__c is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.
timeGranularity
Type: String
Time range for the measures. Values are:
  • HOUR
  • DAY
  • MONTH
  • QUARTER
  • YEAR
If unspecified, no time range is applied.

Return Value

Type: ConnectApi.CdpQueryOutput

queryProfileApi(dataModelName, id, ciName, searchKey, dimensions, measures, filters, fields, batchSize, offset, orderby, timeGranularity, dataspace)

Query a Profile data model object and a Calculated Insight object using filters, a search key, a time range, and a data space.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryOutput queryProfileApi(String dataModelName, String id, String ciName, String searchKey, String dimensions, String measures, String filters, String fields, Integer batchSize, Integer offset, String orderby, String timeGranularity, String dataspace)

Parameters

dataModelName
Type: String
Name of the data model object, for example, UnifiedIndividual__dlm.
id
Type: String
Value of the primary or secondary key field, for example, John. If unspecified, defaults to the value of the primary key field.
ciName
Type: String
Name of the Calculated Insight object, for example, IndividualChildrenCount__cio.
searchKey
Type: String
If a field other than the primary key is used, name of the key field, for example, FirstName__c.
dimensions
Type: String
Comma-separated list of up to 10 dimensions, such as GenderId__c, to project. If unspecified, this parameter includes all of the available dimensions.
measures
Type: String
Comma-separated list of up to 5 measures, such as TotalSales__c, to project. If unspecified, this parameter includes all of the available measures.
filters
Type: String
Comma-separated list of equality expressions within square brackets, for example, [FirstName__c=DON].
fields
Type: String
Comma-separated list of up to 50 field names that you want to include in the result, for example, Id__c,FirstName__c,​GenderId__c,Occupation__c. If unspecified, Id__c is returned.
batchSize
Type: Integer
Number of items to return. Values are from 1–4,999. If unspecified, the default value is 100.
offset
Type: Integer
Number of rows to skip before returning results. If unspecified, no rows are skipped.
orderby
Type: String
Sort order for the result set, such as GenderId__c ASC,​Occupation__c DESC. If unspecified, items are returned in the order they are retrieved.
timeGranularity
Type: String
Time range for the measures. Values are:
  • HOUR
  • DAY
  • MONTH
  • QUARTER
  • YEAR
If unspecified, no time range is applied.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.CdpQueryOutput

universalIdLookupBySourceId(entityName, dataSourceId, dataSourceObjectId, sourceRecordId)

Look up objects by source ID.

API Version

54.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryDataOutput universalIdLookupBySourceId(String entityName, String dataSourceId, String dataSourceObjectId, String sourceRecordId)

Parameters

entityName
Type: String
Entity name.
dataSourceId
Type: String
Data source ID.
dataSourceObjectId
Type: String
Data source object ID.
sourceRecordId
Type: String
Source record ID.

Return Value

Type: ConnectApi.CdpQueryDataOutput

universalIdLookupBySourceId(entityName, dataSourceId, dataSourceObjectId, sourceRecordId, dataspace)

Look up objects by source ID and specify the data space.

API Version

57.0

Requires Chatter

No

Signature

public static ConnectApi.CdpQueryDataOutput universalIdLookupBySourceId(String entityName, String dataSourceId, String dataSourceObjectId, String sourceRecordId, String dataspace)

Parameters

entityName
Type: String
Entity name.
dataSourceId
Type: String
Data source ID.
dataSourceObjectId
Type: String
Data source object ID.
sourceRecordId
Type: String
Source record ID.
dataspace
Type: String
Name of the data space to query. If unspecified, the default data space is used.

Return Value

Type: ConnectApi.CdpQueryDataOutput