API response to be in XML


#1

Hi,

I was looking for API mocking solution and came across dreamfactory. I am done with the installation and its up and running working without any issue. The APIs are currently pre-configured for my sql in API Docs section are returning response only in JSON. How could I configure these APIs to either provide only XML response or both XML and JSON.

Also, these APIs requires authentication. How could authentication be disabled.

Please excuse if these question sound too basic. I am new this and I already tried searching in google and available doc, community posts etc but couldn’t find the answer.

Regards
Amit


#2

Hello @amit_btb ,

To receive an xml, you should use the url parameter or header: Accept
http://wiki.dreamfactory.com/DreamFactory/API#Response_Format

To allow access without authentication, you must define a Default Role
http://wiki.dreamfactory.com/DreamFactory/Tutorials/Setting_up_application_default_role

Best Regards,


#3

Hi, thanks a lot for your reply. I could do things following the links you shared.


#4

What other Accept parameters will work in the api url? Besides JSON and XML, the only other one I’ve noticed to work is “accept=text/csv” for csv.