how to convert azure app insights api response to C# models - azure

so i am able to call app insight's api "https://api.applicationinsights.io/v1/apps/xx/xx/xx" from my C# code.
i can get the json response.
i have this response in json and i want to serialize it into C# objects. do i have to create matching C# classes my self or is there any built in c# models i can use and serialize them?

Not really a direct answer to your question, but instead of consuming REST API directly and doing the conversion/serialization yourself you can simply use Application Insights .Net SDK.
The SDK will do all the necessary conversions for you and give you nice C# objects. The source code for this is also open source and is available here: https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights.Query.
You can take a look here for all the models available to you for direct use here: https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights.Query/src/Generated/Models.

In my opinion, if you choose to use app insights api, that means you didn't add any other sdk into your project, that means there's no any built in models for you.
And if you choose to use sdk instead, here's a sample for it, and per my testing, it only provides QueryResults as the response, here's my testing result, and this is the introduction for preparation. Pls note, you need wait for a while to make the newly added role to take effect. If you can't find the api permission mentioned in the document, you can search for it like what I did.

Related

FTP in and out of Acumatica

I am trying to integrate Acumatica with an interfacing system and I need to be able to send and receive data in xml format, say for example one is Customer info, that should be sent to the interfacing system.
For some reasons, we ruled out the Import/ Export scenarios and we need to achieve the interface using FTP.
I'm unable to find much info online on how to FTP data in and out of Acumatica. So if anyone can share links to some documentation, it will be very helpful. Thanks.
Seeing as you want to be able to send and receive data in an XML format, you might want to check the Web Service options.
There are two possibilities, the Contract Based SOAP API and the Screen Based SOAP API. Both of these are sending SOAP request in XML format.
If you are starting a new project, Acumatica is suggesting you use either version of the Contract Based API (SOAP or REST). So your best bet is probably in looking at Contract Based SOAP API.
As there is not much information on the structure behind what is being sent you will probably have to create yourself project in c# first and inspect the structure of the package being sent to the server hosting the Acumatica instance so that you can reproduce it using your own FTP Interface.
You need to work with .Net native FtpWebRequest class. You can find more information at MSDN FtpWebRequest.

Why Rest Api in Sharepoint

What is the main reason that we go for Rest Api in SharePoint 2013. Already we have Client Object Model for implementing application. Anybody can please guide me.
The Client Side Object Model is built upon the REST API so that is one reason for it to exist. For good JavaScript developers they may like the simplicity of the REST API. For people trying to keep their page size to a minimum, they may appreciate forgoing the size of the CSOM and its dependencies. Lastly, in mash up scenarios with other tools, having an easy way to address content via REST urls makes for better interoperability with other tools instead of relying on a product specific API (i.e. the CSOM).

BreezeJS with ServiceStack?

I was wondering whether or not BreezeJS is compatible when using other technologies other than Web API and/or Entity Framework? As I'm currently in development of a SPA using Service Stack to retrieve data and ORMLite?
So I am curious how BreezeJS handle's this as I know it uses it's own API Controller usually with an extension of the DbContext class which Entity Framework uses. Thanks.
There is currently a sample called NoDb in the samples zip available on the breeze website. This sample does not use EF, but it does use WebApi. So I'd start by looking there. ( additional documentation on this sample should be added within a day or two as well).
In terms of using ServiceStack instead of WebApi, breeze supports the concept of a "dataServiceAdapter" and currently ships with two, an OData adapter and a WebApi adapter. It is certainly possible to write a ServiceStack adapter that breeze could use but this is not trivial. Please add this as a feature request ( and vote for it) on the breeze User Voice. We take these requests seriously.

Monotouch consuming ASP.NET Web Api

I have a Monotouch project that today uses WCF Web Services to get data. Now I want to migrate it in order to start using ASP.NET Web Api Json.
Does anyone know how can I send a viewmodel data from a ASP.NET Web Api and then read it in monotouch?
Thanks for the help in advance.
I think you should read this Xamarin article.
In general, Web API is just standard HTTP passing either XML or JSON back and forth. There is not necessarily a client framework accessing it--you can consume it with raw HttpWebRequests or the equivalent in whichever programming language you are using.
Considering that, your options are:
Use an open-source library to do it (something like RestSharp)
Create the HttpWebRequest calls, and format the XML or JSON for the requests and responses yourself (you can use the .Net BCL to do this or other open source projects)
I tend to do the former, just because I like fine grained control of what is going on. #1 might be easier for you though.

Using ServiceStack with a ServiceReferenceClient

I'm trying to call ServiceStack service from a console app with a service reference client (generated after using Add Service Reference in VS 2010).
I looked at the sample at github but was unable to create a similar client code.
My objective is to provide a set of services with a simple API that can be called by a .NET client as easy as possible. Ideally, client should not need any knowledge of ServiceStack to call the services.
My questions are:
How should I create request if the service does not need any parameters?
How can I resolve proxy.Properties?
Here is the gist
You can use SOAP/WSDL's Add Service Reference but you should be mindful of SOAP's Limitations.
Although the current recommendations for client libraries is to use your preferred choice of ServiceStack's built-in generic service clients.
Got it working, updated gist Removed properties, version, request

Resources