Copied to clipboard

Flag this post as spam?

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


  • Raphaël Threis 3 posts 71 karma points
    Aug 22, 2023 @ 08:49
    Raphaël Threis
    0

    How to consume an API REST service the proper way

    Hello everyone, I'm all new to umbaco, and looking for the best way to use / consume an external REST API (or an older webservice).

    Could you tell me what I should set up for it ?

    I don't know if i've got to set up a new package, or if i can help myself out with a Datatype / Media type.

    The actual information I need to retrieve is stored on an external Server, in an encapsulated CMs system, allowing us to make external calls on a REST API.

    What shoul the return format be. Usually, we use JSon format.

    Thank you for your kind return, Greetings from belgium,

    Raph

  • Johan Reitsma 68 posts 234 karma points MVP
    Aug 22, 2023 @ 08:54
    Johan Reitsma
    0

    What does the API deliver? Do you want to store the information in Umbraco?

    In most cases, we create a second project in visual studio where we define a service to do the calls to the rest API.

    Then in your Umbraco reference to the library and use it where needed.

  • Raphaël Threis 3 posts 71 karma points
    Aug 22, 2023 @ 09:09
    Raphaël Threis
    0

    The External REST API is in fact an old Soap Webservice that delivers a Xml response.

    [EDIT] So, this means, I create a Package in Umbraco, put all my code in there, and finally just include it to Umbraco using NuGet ?

  • Raphaël Threis 3 posts 71 karma points
    Aug 23, 2023 @ 07:54
    Raphaël Threis
    0

    hold on a moment, because I'm all lost in here. So, like the Doc says, I created a new Package, based on template (like here)

    The thing is, now got no clue on how to continue, because, when I open the project in VS 2022, everything is empty.

    I the started all new, trying to create a new Package project rightaway in VS2022, but same, everything is empty.

    So, my question is on how do i need to proceed, to create a package, that's going to be used to make calls to an external SOAP WebService. I already inlcuded the webService in the project, but this doesn't bring very far at this point.

    Thank you all for the help you'll be able to provide me.

    Cheers from Belgium, Raph

Please Sign in or register to post replies

Write your reply to:

Draft