POST /api/v2/query
Use the POST endpoint of Query API V2 to make the
first request with the SQL query. The POST endpoint returns data along with batchId for next
batch.
Syntax
- HTTP method
- POST
- Availability
- Customer Data Platform v2.0, Salesforce 54.0
- Formats
- REST
- URI
- /api/v2/query
Examples
- Request Header
-
1Authorization: Bearer {{cdpAuthToken}} - Request
-
1{ 2 "sql": "select * from ssot__WebsiteEngagement__dlm order by 1 asc" 3} - Response
-
1{ 2"data": [ 3[ 4"1103658353", 5"123", 6"1989-04-01 00:00:00.000 UTC", 7 8 9], [], [] ... 10] 11], 12"startTime": "2021-10-06T13:36:30.33265Z", 13"endTime": "2021-10-06T13:36:32.81927Z", 14"rowCount": 255, 15"queryId": "20211006_133630_00059_9adm3", 16"nextBatchId": "09151b49-54ed-4948-8139-1f4c7c3a9581", 17"done": false, 18"metadata": 19 { 20 "ssot__EngagementAssetId__c": 21 { 22 "type": "VARCHAR", 23 "placeInOrder": 5, 24 "typeCode": 12 25 }, 26 "ssot__TaskId__c": 27 { 28 "type": "VARCHAR", 29 "placeInOrder": 6, 30 "typeCode": 12 31 }, 32 "ssot__EngagementDateTm__c": 33 { 34 "type": "TIMESTAMP WITH TIME ZONE", 35 "placeInOrder": 21, 36 "typeCode": 93 37 } 38 } 39}