In your C# project you would create a .cs file fo your controller, eg in the example in the docs, you'd probably have a folder called Controllers, with a sub folder called API, and in that create a file called ProductsController.cs and define your public class as in the example to create the auto routed endpoint.
is that what you are after? or have I misunderstood what you are trying to do??
I want to retrieve data from one website to an Umbraco website. In order to do that, I need to create a plugin right? And if I were to create a plugin, do I need to write the plugin configuration in the appsettings.json or appsettings.Development.json file? Or is pulling data from another website manageable without the need of creating a plugin?
Or this is a regular daily sync of content/media from the external resource? then you might setup a 'Hangfire Task' with this plugin: https://github.com/nul800sebastiaan/Cultiv.Hangfire to run at a regular time.
Or is the other website a known service? eg Twitter feed, then you might find existing plugins in the marketplace, that perform the task!
https://marketplace.umbraco.com/all/recent
Thank you for your detailed response. Apologies for not being clear in my previous questions.
I would like to create a plugin to fetch active jobs from our Teamtailor instance using an API (https://docs.teamtailor.com/), that I would like to show under our example.com/jobs website.
To do so I need to see where to store configuration data and expose configuration properties for API keys, number of active jobs, filters etc on the backend and also design blocks and pages for fetched data on the frontend.
Where to write the configuration for a plugin based Web API controller
Hi, I want to create a plugin for pulling data from another website, but I don't know in which file I should write the configuration for the plugin?
Hi Marija
There is some information here about creating a Plugin Umbraco ApiController
https://docs.umbraco.com/umbraco-cms/reference/routing/umbraco-api-controllers#plugin-based-controller
In your C# project you would create a .cs file fo your controller, eg in the example in the docs, you'd probably have a folder called Controllers, with a sub folder called API, and in that create a file called ProductsController.cs and define your public class as in the example to create the auto routed endpoint.
is that what you are after? or have I misunderstood what you are trying to do??
regards
Marc
Hello Marc
I want to retrieve data from one website to an Umbraco website. In order to do that, I need to create a plugin right? And if I were to create a plugin, do I need to write the plugin configuration in the appsettings.json or appsettings.Development.json file? Or is pulling data from another website manageable without the need of creating a plugin?
Hi Marija
It depends a little on what you are trying to do!
A one-off import from another website? (you'd look at the CMS Import plugin (https://marketplace.umbraco.com/package/cmsimport)
Or the Umbraco site is pulling information from another website (eg it has an API that makes data available to receive), in which case you might use Umbraco's services to create the data inside Umbraco - https://docs.umbraco.com/umbraco-cms/reference/management/services/contentservice
Or do you want to retrieve the data from the external source and present it alongside existing Umbraco Content, then you might use 'route hijacking' https://docs.umbraco.com/umbraco-cms/implementation/default-routing/controller-selection to combine the external data with a particular Umbraco page's data.
Or if the external data is displayed across multiple different page types, you might use View Component: https://docs.umbraco.com/umbraco-cms/reference/templating/mvc/viewcomponents#view-component-locations to encapsulate retrieving the data and displaying it on part of a page.
Or this is a regular daily sync of content/media from the external resource? then you might setup a 'Hangfire Task' with this plugin: https://github.com/nul800sebastiaan/Cultiv.Hangfire to run at a regular time.
Or is the other website a known service? eg Twitter feed, then you might find existing plugins in the marketplace, that perform the task! https://marketplace.umbraco.com/all/recent
Sorry for the blanket answer!
regards
Marc
Hello Marc,
Thank you for your detailed response. Apologies for not being clear in my previous questions.
I would like to create a plugin to fetch active jobs from our Teamtailor instance using an API (https://docs.teamtailor.com/), that I would like to show under our example.com/jobs website.
To do so I need to see where to store configuration data and expose configuration properties for API keys, number of active jobs, filters etc on the backend and also design blocks and pages for fetched data on the frontend.
How would I go about doing that?
Hello Marc,
Any additional ideas about this topic?
is working on a reply...