Post Query with API Version
This REST API submits an aggregate query with a specified API version, using the apiVersion
query parameter. For integration purposes specify the apiVersion
to ensure consistent and reliable query performance. For many other reporting purposes you do not have to specify the apiVersion
and by default AQuA uses the latest Zuora API version to execute the query.
Request
Environment | Request |
---|---|
Production for US Cloud Data Center 2 |
POST https://rest.zuora.com/v1/batch-query/ |
API Sandbox for US Cloud Data Center 2 | POST https://rest.apisandbox.zuora.com/v1/batch-query/ |
US Performance Test | POST https://rest.pt1.zuora.com/v1/batch-query/ |
Production for US Cloud Data Center 1 | POST https://rest.na.zuora.com/v1/batch-query/ |
API Sandbox for US Cloud Data Center 1 | POST https://rest.sandbox.na.zuora.com/v1/batch-query/ |
Central Sandbox for US Cloud Data Center | POST https://rest.test.zuora.com/v1/batch-query/ |
Production for EU Cloud Data Center | POST https://rest.eu.zuora.com/v1/batch-query/ |
Sandbox for EU Cloud Data Center | POST https://rest.sandbox.eu.zuora.com/v1/batch-query/ |
Central Sandbox for EU Cloud Data Center | POST https://rest.test.eu.zuora.com/v1/batch-query/ |
Request Parameters
format |
The supported values are csv, zip and gzip. The default value is csv. |
|||||||||||||||
version |
The API version you want to use. Supported versions:
See Stateless and Stateful Modes for more information. |
|||||||||||||||
name |
The name of the job. 32 character limit. |
|||||||||||||||
encrypted |
If enabled, you must supply the formatting (zip or unzip) first and decrypt it to get the actual contents. |
|||||||||||||||
partner |
The partner field indicates the unique ID of a data integration partner. The dropdown list of this field displays partner IDs for the past thirty days. It must be used together with "project" field to uniquely identify a data integration target. For example, if a continuous AQuA session is to retrieve data incrementally for a Salesforce.com Org 00170000011K3Ub, you can use partner as "Salesforce", and "project" as "00170000011K3Ub."
This field is required only if you are using AQuA in stateful mode. Otherwise, if you are using AQuA in stateless mode, partner field can be null. Zuora highly recommends you use the stateless mode instead of the stateful mode to extract bulk data. See Bulk data extraction from Zuora using AQuA for best practices. Submit a request at Zuora Global Support to obtain a partner ID. |
|||||||||||||||
project |
The project field contains the unique ID of a data integration project for a particular partner. The dropdown list of this field displays project IDs for the past thirty days. This field must be used together with partner field to uniquely identify a data integration target. This field is required only if you are using AQuA in stateful mode. Otherwise, if you are using AQuA in stateless mode, partner field can be null. |
|||||||||||||||
dateTimeUtc |
When using WSDL 69 and later you can ensure that the exported output of dateTime records are rendered according to ISO-8601 generic UTC form by setting When "
|
|||||||||||||||
queries |
A JSON Array object that contains a list of query objects. The list of query objects are name and query.
|
Response Parameters
batches |
A JSON array object that contains a list of batch objects.
|
|||||||||||||||||||||||
project |
The project field contains the unique ID of a data integration project for a particular partner. The dropdown list of this field displays project IDs for the past thirty days. This field must be used together with partner field to uniquely identify a data integration target. This field is required only if you are using AQuA in stateful mode. Otherwise, if you are using AQuA in stateless mode, partner field can be null. |
|||||||||||||||||||||||
partner |
The partner field indicates the unique ID of a data integration partner. The dropdown list of this field displays partner IDs for the past thirty days. It must be used together with "project" field to uniquely identify a data integration target. For example, if a continuous AQuA session is to retrieve data incrementally for a Salesforce.com Org 00170000011K3Ub, you can use partner as "Salesforce", and "project" as "00170000011K3Ub."
This field is required only if you are using AQuA in stateful mode. Otherwise, if you are using AQuA in stateless mode, partner field can be null. Zuora highly recommends you use the stateless mode instead of the stateful mode to extract bulk data. See Bulk data extraction from Zuora using AQuA for best practices. Submit a request at Zuora Global Support to obtain a partner ID. |
|||||||||||||||||||||||
notifyUrl |
If URL is provided, the AQuA job will call this |
|||||||||||||||||||||||
name |
The name of the job. 32 character limit. |
|||||||||||||||||||||||
id |
The job ID created for the AQuA API request. The job ID can be used for querying for the query status. |
|||||||||||||||||||||||
version |
The API version you want to use. Supported versions:
See Stateless and Stateful Modes for more information. |
|||||||||||||||||||||||
format |
The supported values are csv, zip and gzip. The default value is csv. |
|||||||||||||||||||||||
startTime |
The start time of the query. |
|||||||||||||||||||||||
status |
The job status. Status types are:
|
|||||||||||||||||||||||
encrypted |
If enabled, you must supply the formatting (zip or unzip) first and decrypt it to get the actual contents. |
JSON Example
Example 1
This example shows submitting a JSON request with the apiVersion = 58.0.
HTTP request:
POST https://www.zuora.com/apps/api/batch-query/
POST https://apisandbox.zuora.com/apps/api/batch-query/
JSON request:
{ "format": "csv", "version": "1.1", "name": "Example", "encrypted": "none", "partner": "salesforce", "project": "00170000011K3Ub", "queries": [ { "name": "Account", "query": "select UpdatedDate from ProductRatePlanCharge", "type": "zoqlexport", "apiVersion": "58.0", "deleted": { "column": "Deleted", "format": "Boolean" } } ] }
Successful JSON response:
{ "batches": [ { "deleted": { "column": "Deleted", "format": "Boolean" }, "full": true, "name": "Account", "query": "select UpdatedDate from ProductRatePlanCharge", "status": "pending", "recordCount": 0, "apiVersion": "58.0", "batchType": "zoqlexport", "batchId": "402881824835bb2a0148463a2c3804d0" } ], "project": "00170000011K3Ub", "partner": "salesforce", "name": "Example", "id": "402881824835bb2a0148463a2c3704cf", "version": "1.1", "format": "CSV", "status": "submitted", "encrypted": "none" }
Example 2
This example shows submitting a JSON request with the apiVersion= 19.0.
HTTP request:
POST https://www.zuora.com/apps/api/batch-query/
POST https://apisandbox.zuora.com/apps/api/batch-query/
{ "format": "csv", "version": "1.1", "name": "Example", "encrypted": "none", "partner": "salesforce", "project": "00170000011K3Ub", "notifyUrl" : "http://requestb.in/1ju8vhu1", "queries": [ { "name": "Account", "query": "select Id,ProductRatePlan.Id,BillCycleDay,AccountingCode,ChargeModel,ChargeType,Description,Name,UpdatedDate from ProductRatePlanCharge", "type": "zoqlexport", "apiVersion": "19.0", "deleted": { "column": "Deleted", "format": "Boolean" } } ] }
JSON response with error:
Error.zoql.noSuchFieldId\n