Answer:
AQuA can process "zoql" and "zoqlexport" type calls. When you select zoql, you can simply use the same format what you'd use for a SOAP call, so our query above would look like this:
{
"format" : "csv",
"version" : "1.1",
"name" : "Example2",
"encrypted" : "none",
"useQueryLabels" : "true",
"partner" : "viktortest",
"project" : "testsession1",
"dateTimeUtc" : "true",
"queries" : [ {
"name" : "Account",
"query" : "select billtoid from account",
"type" : "zoql"
}]
}
However if we'd set type to zoqlexport, then we'd need to use the same format as would be used for a create() export call, as in this case we're not querying via the API framework, but we're creating exports using the Data Source Export framework.
There are differences between how API objects and Data Sources are handled. For the SOAP API object, BillToId is actually a field under the Account object. But in case of Data Sources, BillToContact is a separate Data Source from Account, and is pre-joined with it, therefore the correct zoqlexport query to fetch the BillToContact ID would be the following:
{
"format" : "csv",
"version" : "1.1",
"name" : "Example2",
"encrypted" : "none",
"useQueryLabels" : "true",
"partner" : "viktortest",
"project" : "testsession1",
"dateTimeUtc" : "true",
"queries" : [ {
"name" : "Account",
"query" : "select billtocontact.id from account",
"type" : "zoqlexport"
}]
}
Supporting reference:
https://knowledgecenter.zuora.com/DC_Developers/T_Aggregate_Query_API/B_Submit_Query
https://knowledgecenter.zuora.com/DC_Developers/M_Export_ZOQL
https://knowledgecenter.zuora.com/DC_Developers/K_Zuora_Object_Query_Language
http://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Export/Create_an_Export
... View more