Loading


Advertisement:

Author Topic: [HELP] Any osclass REST API plugin or planned in near future?  (Read 123 times)

programista

  • Newbie
  • *
  • Posts: 8
Hi.

My client needs an android app for osclass based site (heavily modified also by me).

But i need API access to make it happen. Had searched the forums but no luck.

And yes, i know that osclass now offers their official app with their own plugin. (rest api?)

Due to the project specifics, we need our own application and our own rest api.

It would be inventing the wheel again and a waste of time if i start the work and then some plugin will show up or an official api, so i need to ask before i start.

Making the app and api will take some time, approx. 1-2 moths, the questions are:

- Do osclass team plan to release the rest api plugin used in their official apps for free or separately in the time frame of 1-6 months?

- If not or the team can't comment on this now, are there any plans to include a free rest api in oclass, or if anything is being worked right now to make it happen in time frame 1-6 month (maybe even not related to the paid plugin in apps)

- Is there any free/paid REST API plugin for oclass available right now or will be in the time frame of 1-6 months, maybe even something incomplete, community project etc.

Best regards and hoping for some help
Andrew
« Last Edit: March 20, 2017, 06:33:36 pm by programista »

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4390
Re: [HELP] Any osclass REST API plugin or planned in near future?
« Reply #1 on: March 21, 2017, 11:17:01 am »
Do we plan to release an API? "Yes", but that's a lot more complex question and there are a lot of issues to fix before
Do we plan to release an API soon? No


There are a lot of issues that arise with the idea of an API. For example, what happens with plugins? how do you include plugins in the API? You need to rewrite them specially for the API, your app needs to know how to consume the extra fields.

programista

  • Newbie
  • *
  • Posts: 8
Re: [HELP] Any osclass REST API plugin or planned in near future?
« Reply #2 on: March 22, 2017, 07:40:34 pm »
Well, it could be without plugins support at the beginning to make it easier, but i think there is no point cuz plugins support is very easy to add.

Plugins can be supported in api the same way as any extensions in the code are supported now - by hooks, and it makes sense, one way or another, it is the only way it can be done, the only way to support custom code for plugins is... well.. custom code and you need hooks to do it.

Lets say search api, just any api you can think of, before outputting any json result (maybe using json api standard), just add to any api a hook to add any number of fields to the result, either be it single data response or a list of something, the same way you can add something before even making db queries, like add custom conditions to search.

Nothing new, it is already used everywhere in the current script.

But i guess you are already done all that, cuz you are selling commercial apps, to what, someone with plugins can't buy them? I don;t think so.

But, back to the point, thank you for the complete and precise answer for my questions, this all i needed, guess i will need to do i myself.

Thx again.

SteveJohnson

  • Sr. Member
  • ****
  • Posts: 285
  • Golden tip - Clear your cache :|
Re: [HELP] Any osclass REST API plugin or planned in near future?
« Reply #3 on: March 23, 2017, 06:39:14 pm »
I understand this might be a complex question.. as the each theme may implement the core osclass in a different way, and also each plugin does different work.

Maybe there can be a core API, much like the core osclass script. And all plugins can optionally have their specific role in generating their part in the API?

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4390
Re: [HELP] Any osclass REST API plugin or planned in near future?
« Reply #4 on: March 24, 2017, 10:00:38 am »
Again, this is a more complex issue. We didn't find a nice solution that covers every plugin possible, as some of them modify the view/html.

Let's say we create an API for the core with "hooks" and it works fine, now, we want to use some plugin, like the most simple plugin, one which add some attributes to the listing, let's say it's a cars attributes one which let's you select make and model, pretty simple.. How do we know we need to show more form elements/fields for said plugin? Ok, don't panic, when we ask the API, it should reply with a JSON, with the form's fields, so we get our regular fields + our plugin fields.

But what happens if we want that when you select a make, then the dropdown menu for models only shows models of that make? In a normal website, we add some javascript, an ajax request and done, but... how our app knows it has to do an ajax request? how does it runs "javascript"? is that js added to the form fields? how?

Another example, social plugins that let you login into your website with a facebook , google or twitter account. How can you make them work with you app?

Other plugins, like payments plugins for example, adds new "pages" to your website, like a checkout page. How does your app know how to show that checkout page? And being specific of said plugins, how could you make a payment from your app?

Finally, there are other plugins, like sliders, cookie consent, age warning, anything related to banners/ad management,... that you will not be able to use on your app.


In short, we didn't find a nice solution for any plugin that uses javascript and some HTML "a bit different", if you have one, please, let us know.