1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XML/JSON Output Format

Discussion in 'XenForo Development Discussions' started by ibnesayeed, Apr 1, 2011.

  1. ibnesayeed

    ibnesayeed Well-Known Member

    I wanted to create some JavaScript rich (thick client) applications on top of XenForo for managing multiple forums (once RTL support is there). Then I realized that I need to write modifications for various resources as illustrated in "XenForo AJAX Tutorial" to output only JSON data free from any HTML template. I think it will be really nice if we get responses from XenForo engine natively in machine friendly formats as well along with the human readable HTML output. I would personally prefer JSON but adding XML too will be added sugar. It will enable cross-site communication and aggregation for XenForo powered sites.

    URL formats can be something like this:


    (Notice, we need to consider redirects also)

    PS: I think, I should have posted it in the feature request section. But it feels more of a concern for developers. So I am posting it here, feel free to move it to another forum.
    Daniel Hood likes this.
  2. Luke F

    Luke F Well-Known Member

    Tapatalk API would be ideal for this :)
  3. ibnesayeed

    ibnesayeed Well-Known Member

    I think we don't need to rely on third party services, there might be some privacy concerns as well. In fact XenForo MVC architecture is so clean and well written that various output formats are expected from the core library itself. I know that JSON is in the blood of XenForo, it is just a matter of exposing it.
  4. Luke F

    Luke F Well-Known Member

    It's not as simple as you're making it out to be.

    The Tapatalk API is both well documented and perfect for the job, plus you would automatically have support for other forum systems.
  5. ibnesayeed

    ibnesayeed Well-Known Member

    In my opinion, it is not very complex either. What I understood XenForo architecture so far, it makes JSON object first then wraps HTML markup around it. What complexities do you think there might be other than adding some conditionals and thorough testing of course? I am not much into PHP coding nowadays but I develop JavaScript rich Rails applications more frequently. So, I add HTML, JSON and XML output support in almost every application for SEO, AJAX and Cross-Site communication respectively.

    Being a Digital Library researcher, I strongly feel the need of better machine readability in next generation web applications, without the help of any third-party service. And XenForo is no exception. :)

    Lets see what Mike and/or Kier think about it.
  6. tapatalk

    tapatalk Well-Known Member

    Give Tapatalk API a try - we have spent tremendous effort in documenting every single details of the XMLRPC based interface we uses and has proven to be very usable by other third party developers. If you are concerns of the "third-party", we are probably the most committed third-party you can get as the same API already works on more than 5 different forum systems. (y)
    Kier and Darkimmortal like this.
  7. ibnesayeed

    ibnesayeed Well-Known Member

    It's not about saying NO to "third-party". We all know this forum software (or any other well written web application) is simply a structure of DATA and its RELATIONSHIP processed through authentication and access layers. In the next step presentation layer comes into picture. My concern is simple, if presentation free layer is already there in the system then why do we need external service to expose that? This is post-web 2.0 era and now machines tends to consume web applications more than humans.
  8. Luke F

    Luke F Well-Known Member

    The vast majority of output from XenForo is only HTML and developing the Tapatalk plugin required significant rewriting of controller and view code.

    The code for outputting in alternative formats simply isn't there, and it is far from trivial to add it.

    Really there is no choice other than to use an existing API plugin or develop your own. Tapatalk if you want XMLRPC and an open+well-documented API or Forum Runner for (iirc) JSON.
  9. tapatalk

    tapatalk Well-Known Member

    I understand where ibnesayeed is coming from - there are a lot of things that can be simple and seems just need one more minor effort to get there, but it may never get there for various reason. I can imagine it takes effort to develop and may not be used by a lot of ordinary forum owners who don't write application / integration. And the on-going cost to support the API if things break etc (it's a pain, we know..).

    Good luck and hope xenForo will have an API too!

Share This Page