3 Replies Latest reply on Mar 28, 2016 8:25 AM by Ryan Rutan

    Comparing REST API to JS API (Pro/Con)


      Greetings all. New to the community and looking to get some input. We're on a hosted Jive 8 platform and I've been perusing between the REST API and JS API for a pro/con list.


      Personally I find myself preferring JS. The implementation seems less coupled with having to make jQuery AJAX calls to the REST and handling the returned responses manually vs. the Jive Request Objects that are returned and executed via the JS (OSAPI?) methodology.


      I find that checking for the existence of an '.error' property on the returned request to be simple, and like that Jive handles the request via a Promise for asynchronous calls. We simply define the request, execute it, await the return, at which point we examine for errors, handle them uniformly if one exists, or if not, continue to handle the data payload.


      But I'd like to hear the pro/con from many who've been using both. One stated problem with the JS API is that it might cause fragmentation within our code base (the vast majority of calls have been random combinations of JS/jQuery/AJAX + REST) and if we can find a significant enough Pro to that con, I'm wondering if JS would be a more natural choice for our needs.