Happy Business Starts Here

Savvy Scholar

Get AQuA API responses real time

We are moving our code from SOAP to REST. One of the best features in SOAP was that I could make a ZOQL query for the fields I need for my UI (Visualforce pages in Salesforce). 


However when I use AQuA and submit a query (REST HTTP POST) for say Account object, for a single crmId, I don't instantly get the response. The response I get shows the record count as '0'. Later if I submit a get with the batchId thats when the record count is 1 and I get the query results.


Is it possible to submit a query in AQuA and receive the response realtime. my requirements are very simple like 'select AccountNumber, Status from Account where crmId='001xxxxxxxxxxxxxxxxxxxx''

Zuora Documentation

Re: Get AQuA API responses real time

Hi rajpc,


Instead of using the AQuA API, you could use the Query action. This API operation enables you to run a ZOQL query and directly get the results (as JSON) in the response body. It's intended to be used in exactly the situation you described: to fetch a small number of results to power a UI.


Here's how to use it:



POST /v1/action/query

  "queryString": "select AccountNumber, Status from Account where CrmID='0017F000008Xl1LQAS'"



  "records": [
      "AccountNumber": "A00000095",
      "Status": "Active",
      "Id": "2c92c0f85e5019d7015e5123b6717b9d"
  "size": 1,
  "done": true


Would that work for you?

Savvy Scholar

Re: Get AQuA API responses real time

Hi David,


I am able to make the REST Query but I am not able to authenticate via OAuth2 to get to this step.


I had to create a HTTPRequest and set the header for Api-key and Api-profileId.


Can you let me if I can authenticate via OAuth2 instead and perform the REST Query

Zuora Documentation

Re: Get AQuA API responses real time

I'm able to use OAuth to authenticate and call /v1/action/query.


Have you successfully used OAuth with any other REST operation?


The Zuora OAuth flow is documented here:



Could you paste in your request headers and any error response you're receiving from Zuora? Thanks!

Zuora Staff

Re: Get AQuA API responses real time

Hi @rajpc,


AQuA is gear towards more of a data replication type of use cases. For example, pulling data once a week or once a month into a data warehouse for other reporting purposes. So if you'ure after more of a 'real-time' type of calls, I would recommend our REST API offerings (here).




If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √