To clarify; by event, I meant an event in the sense of a thing that happens (a concert, a show), and not an Umbraco event. I'm trying to bring data from external API into front end of the website.
I want to use JSON values in an object like image, description etc, to generate an event.
Using these you could create an "Events" node in Umbraco which stores your details of your API you need to call, plus any intro text etc for your listing page.
Then by hijacking the routes and the rendering you could allow artificial pages to exist that display event specific information.
For example,
Your node might be /Events, then each individual one could be /Events/EventName.
Your custom controller could then make the required API calls to get the event details and return a typed model to a custom view.
Using the API examples
Hi,
I have successfully connected to an external API using Postman, and I want to incorporate it into Umbraco. Is there an example anywhere on how to:
Let me explain with an example. I want to pass all events into a list view, and then have a view for each individual event.
Are there any tutorials/starting pointers to achieve this?
Hi Kamil,
Are you trying to access the 3rd party API in the Umbraco back office, or are you trying to use it for part of the front end of the website?
In either scenario, how do you want to use the data from the 3rd party?
Thanks,
Nik
Hi Nik,
To clarify; by event, I meant an event in the sense of a thing that happens (a concert, a show), and not an Umbraco event. I'm trying to bring data from external API into front end of the website.
I want to use JSON values in an object like image, description etc, to generate an event.
Okay, so I would start by looking into Umbraco Routing and rendering. Specifically, I would look at Custom MVC routes and Render MVC Controllers
Using these you could create an "Events" node in Umbraco which stores your details of your API you need to call, plus any intro text etc for your listing page.
Then by hijacking the routes and the rendering you could allow artificial pages to exist that display event specific information.
For example,
Your node might be /Events, then each individual one could be /Events/EventName.
Your custom controller could then make the required API calls to get the event details and return a typed model to a custom view.
How could I do this on a uSkinned installation with ModelsBuilder enabled? Would it be largely the same?
Could I create a content page in the back office, and then somehow store API data in the created template?
Hi Kamil,
I don't know anything about uSkinned I'm afraid, however, yes, I would imagine it would be largely the same.
If you don't want editors setting the API settings, you could look at storing them in webconfig instead and accessing them from there.
I'm also making the assumption that you are using Visual Studio, or similar IDE to help with the creation of your site.
Thanks,
Nik
is working on a reply...