Support the development of TastyIgniter Learn more
I am attempting to modify the data returned from the curl request for the Orders API to fit the POS system that I am using. The API currently queries for data in json the POS is using an XML format. What would be your best suggestion for modifying the RESTful API response to match the needed format? any help would be appreciated. Thank you!
You would either need extend the API extension to modify the transformers response or alternatively (and this is what I would do) have your POS call a intermediary controller / script that you write that then calls the API and transforms the response.
ryanmitchell Thank you Ryan! I will work on those options. I have attempted to modify the transformer response through extensions\igniter\api\apiresources\transformer\OrderTransformer.php without much luck I don’t seem to be able to restrict the data (select specific data fields) coming through or modify the format(manipulate layout etc). Is this the correct file? It’s not my main wheelhouse but as they say a little knowledge is dangerous! Thank you again!
You would need to modify the base transformer class to send XML instead of JSON - as I said I think the easier approach is to write a script that calls the API and transforms it into XML instead.
This sort of function might help: https://www.codeproject.com/Questions/553031/JSONplusTOplusXMLplusconvertionpluswithplusphp
ryanmitchell Awesome I will work it that way appreciate you help! Thank you!