Quick base api to json

Hi
New to Postman and wish to use Quick Base API_DoQuery and pull the results in as JSON. I only get xml. I’m using Quick Base API_DoQuery in a query string after our QB domain name URL with parameters to get certain fields and limit that to about 100 records. QB delivers the payload as xml. Is it possible to coax Postman to convert that payload to JSON? If so, can you please provide guidance?
Thank you,
Chris

Hi @cgreene!

Welcome to the community :clap:

So in regards to this problem, you wont have too many options. First, do you know if the Quick Base API web server supports responses in JSON? If not, that will be your biggest limitation. However, if it follows standard web protocols, add in the following header to your request to see if JSON is returned.

Accept: application/json

If that doesnt work, you can use the xml2js library in your “Tests” script section to convert the xml to json. This may not turn out exactly how you want it, but it can create a somewhat equivalent JSON response from your XML.

Best,
Orest

Hi @odanylewycz,
Do I import the xml2js library from somewhere?

Hi @cgreene,

Nope it should be readily available for you to use in your Tests and PreRequest Script

As a reference, these are the libraries loaded by default in PreRequest Script and Tests sections:
https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/