locked
Can i use the web api to get json data ? RRS feed

  • Question

  • User1253338400 posted

    Hi ,

    I am wanting to get started with using web api and write a web api app using Visual Studio 2017 in order to call a url and return json data , using Get.

    I want to be able to serialize and deserialize and format the data.

    Is there a public url that I can connect to and get the data ?

    Thanks

    Monday, December 17, 2018 3:57 AM

Answers

  • User475983607 posted



    This is great. But instead of initializing the products and adding 3 new elements , how can i call a public url / consume a public service like maybe twitter , google apis available to public which will return json data

    The first step is reading the Google and Twitter support docs.  The usual path is creating a developer account.  Use the account to login which results is a token being returned.  Use the token to interact with the service.

    HttpClient is the newest .NET API for making HTTP requests from code.  If you are building a browser based app then see the support docs.  Usually a JavaScript API is downloaded/referenced and you write code against the API.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 17, 2018 8:29 PM

All replies

  • User753101303 posted

    Hi,

    It"s a bit unclear if you are looking for https://docs.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api or for services with which you could "play" ('seems anyway your intent is to create your own service).

    If before writing your own you want to try to consume services found at https://www.geonames.org/(and maybe they could be even useful in your app)

    Monday, December 17, 2018 12:06 PM
  • User1253338400 posted



    Hi
    This is great. But instead of initializing the products and adding 3 new elements , how can i call a public url / consume a public service like maybe twitter , google apis available to public which will return json data
    Thanks
    Monday, December 17, 2018 8:13 PM
  • User475983607 posted



    This is great. But instead of initializing the products and adding 3 new elements , how can i call a public url / consume a public service like maybe twitter , google apis available to public which will return json data

    The first step is reading the Google and Twitter support docs.  The usual path is creating a developer account.  Use the account to login which results is a token being returned.  Use the token to interact with the service.

    HttpClient is the newest .NET API for making HTTP requests from code.  If you are building a browser based app then see the support docs.  Usually a JavaScript API is downloaded/referenced and you write code against the API.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 17, 2018 8:29 PM
  • User1253338400 posted

    Great thanks so much for the help.

    cheers

    Robby

    Monday, December 17, 2018 11:06 PM