Orchard icon indicating copy to clipboard operation
Orchard copied to clipboard

REST Api + consume data

Open agriffard opened this issue 9 years ago • 7 comments

I would like to open a discussion about how to expose specific apis in Orchard.

Here is an example I have in mind: If the Comments module exposes a json endpoint that list the last comments, there could be a simple 'plugin' that allows to show them on the front or in the admin (widget, dashboard, ...).

It can be easy. Some people have already made that kind of api implementation.

Please, share your thoughts about the feature needed or the way to implement them if they don't exist yet.

agriffard avatar Jun 25 '16 18:06 agriffard

I have another use case in mind: Add some 'quick infos/actions widgets' in the upcoming new admin theme, in the right sidebar. Ex : quick search, moderate comments, send mail to user.

agriffard avatar Jun 25 '16 18:06 agriffard

Of course the question of using technologies as SignalR (for real time notifications) or data-binding libraries/framework (angular, ...) is also open.

agriffard avatar Jun 25 '16 18:06 agriffard

Also see: https://orchard.codeplex.com/discussions/560607

Piedone avatar Jun 26 '16 10:06 Piedone

Those could be also helpfull :

https://github.com/domaindrivendev/Swashbuckle http://swagger.io/

Related to the new admin theme. I'm not sure though that we want to wait on that full REST API to be built before releasing the new admin theme. That's why maybe we need to plan a phase 2 on it.

The REST API is there on the roadmap and it says it is "on track" who's owning that feature branch?

Skrypt avatar Jun 26 '16 14:06 Skrypt

ApiExplorer needs to be fed with an httpConfiguration in order for the Api's to be discoverable by Swagger/Swashbuckle. The way I've done it is not pretty, avoids messing with Orchard core files, but resets any external ApiDescriptors. So to expose Orchard API's, we should best populate ApiExplorer in Orchard.Mvc.Routes.RoutePublisher

SzymonSel avatar Jan 19 '17 12:01 SzymonSel

For the record @sebastienros created a RESTful module PoC in his fork: https://orchard.codeplex.com/SourceControl/network/forks/sebastienros/Backup?branch=feature/rest

Also on some old meeting we discussed that:

  • Without Odata for now
  • Reusable infrastructure (e.g. authentication) for other modules to use
  • Implementations e.g. for managing content types, content items, Taxonomies, search...

Other implementations, not linked from https://orchard.codeplex.com/discussions/560607:

  • https://gallery.orchardproject.net/List/Modules/Orchard.Module.Orchard.BlogsApi
  • https://gallery.orchardproject.net/List/Modules/Orchard.Module.Amba.KeyValueStorage
  • https://github.com/CloudMetal/Orchard.Api

Piedone avatar Jan 19 '17 17:01 Piedone