Copied to clipboard

Flag this post as spam?

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


  • Kevin C. Halpin 27 posts 108 karma points
    Mar 05, 2018 @ 20:54
    Kevin C. Halpin
    0

    Merging API results with Umbraco content

    Hi all,

    I have the following scenario. I want to use external API for getting information about hotels. For every hotel that I get from the API I have custom properties in Umbraco (example different picture and description cause I don't like the ones from the API ). I still need to use the API though to get the availability of the hotel rooms in real time. So for example If a have 50 hotel results from the API call I then want to add these custom properties from Umbraco content to each one of them before sending them as a response to frontend. How do you propose to implement this with most optimization?

  • Marcio Goularte 388 posts 1360 karma points
    Mar 05, 2018 @ 21:18
  • Robert Foster 459 posts 1820 karma points MVP 3x admin c-trib
    Mar 06, 2018 @ 00:20
    Robert Foster
    0

    One way you could do it would be to write your own WebApiController that retrieves the external hotel details, then does a lookup in Umbraco for the custom properties. Once the details have been retrieved you can pass them on to the client.

    Alternatively, the client could call your own WebApi to augment the hotel details from Umbraco content (perhaps even the Umbraco REST Api may be enough here) and then aggregate the results before displaying them?

Please Sign in or register to post replies

Write your reply to:

Draft