Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Marija Cholakova 4 posts 74 karma points notactivated
    Mar 25, 2024 @ 08:50
    Marija Cholakova
    0

    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?

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Mar 26, 2024 @ 08:46
    Marc Goodson
    0

    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

  • Marija Cholakova 4 posts 74 karma points notactivated
    Mar 27, 2024 @ 09:15
    Marija Cholakova
    0

    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?

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    29 days ago
    Marc Goodson
    0

    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

  • Marija Cholakova 4 posts 74 karma points notactivated
    29 days ago
    Marija Cholakova
    0

    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?

  • Marija Cholakova 4 posts 74 karma points notactivated
    16 days ago
    Marija Cholakova
    0

    Hello Marc,

    Any additional ideas about this topic?

Please Sign in or register to post replies

Write your reply to:

Draft