Returns the next batch of data from the initial POST request.
note: A newer version of the Query API is available. We recommend using the newest Query API.
Syntax
- HTTP Method: GET
- Availability: Data 360 v2.0, Salesforce 54.0
- format: REST
- URI:
/api/v2/query/{nextBatchId}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| nextBatchId | string | Required. The batch identifier returned from the previous query response. Example: 09151b49-54ed-4948-8139-1f4c7c3a9581 |
Response Structure
The response includes:
data: Array of record objects containing the requested datastartTime: ISO 8601 timestamp indicating when the query started executingendTime: ISO 8601 timestamp indicating when the query finished executingrowCount: Number of rows returned by the queryqueryId: Unique identifier for the querynextBatchId: Identifier for the next batch of resultsdone: boolean indicating if all results have been returnedmetadata: Object containing metadata about the fields in the result set
Metadata Object
The metadata object contains information about each field on the result set:
| Field Name | Field Type | Description |
|---|---|---|
| type | string | SQL data type of the field |
| placeInOrder | integer | Position of the field on the result set |
| typeCode | integer | Numeric code representing the SQL data type |
Examples
Request
GET https://{TSE}.360a.salesforce.com/api/v2/query/09151b49-54ed-4948-8139-1f4c7c3a9581
Authorization: Bearer {{cdpAuthToken}}
Response
{
"data": [["1103658353", "123", "2020-09-28T00:00:00.000+00:00"]],
"startTime": "2024-05-08T13:30:31.241168Z",
"endTime": "2024-05-08T13:30:35.571609Z",
"rowCount": 1,
"queryId": "20240508_133031_00088_p25a7",
"nextBatchId": "09151b49-54ed-4948-8139-1f4c7c3a9581",
"done": false,
"metadata": {
"state__c": {
"type": "VARCHAR",
"placeInOrder": 28,
"typeCode": 12
},
"sales__c": {
"type": "DECIMAL",
"placeInOrder": 23,
"typeCode": 3
},
"productid__c": {
"type": "VARCHAR",
"placeInOrder": 17,
"typeCode": 12
}
}
}
Notes
- Use the
doneflag to determine if more results are available - When
doneis false, use thenextBatchIdto retrieve the next set of records - All queries are executed synchronously
- The API supports cursor-based pagination via
nextBatchId - You must fetch the complete result set within one hour
- The time interval between batch calls must not exceed three minutes