Xataface and iPhone/Android JSON resultset
Archived from the Xataface Users forum.
milton02 — Fri Nov 04, 2011 4:26 pm
Hi,
I am totally new to Xataface, but I am quite excited for the simplicity of use. Anyway looking at the documentation I could find any docs explaining how to get results in JSON to be consumed by mobile clients. In fact I am evaluating the product to see if I can have REST style URL to query my MySQL DBs and get results in JSON. I would also like to do updates and editigs (I have seen already the URL format wiki page, but I don’t know how to get back JSON confirmation for the operations).
Could you point me out to some docs or example to create and consume basic queries?
Best,
Antonio
shannah — Fri Nov 04, 2011 5:00 pm
The export_json action is probably what you’re looking for. You can also create custom actions to return JSON if you like.
(I.e. just use the same URL conventions to specify which record you want, but use -action=export_json)
milton02 — Sat Nov 05, 2011 2:07 pm
Thanks a lot, shannah,
it works totally great and in a couple of minute.
I have now the problem to update my tables from the client mobile, i.e executing POST, PUT and DELETE operation on some HTTP URLs to add, update and delete records.
Are there any simple ways to achieve this with Xataface, passing source input via JSON object from my mobile client?
Thanks a lot in advance for you answers
Antonio
shannah — Mon Nov 07, 2011 9:57 am
1.3.x has no preset API for this . You’ll need to implement your own actions for this. I’m currently working on a REST API and Javascript/AJAX wrapper to be included with the 2.0 release - but this isn’t available for the 1.3.x branch.