ASP.NET and FedEx integration - asp.net

i am doing FedEx integration with asp.net project. The web service works correct but, I have some doubts about the API code
Anyone know what is the use of RateRequestTypes object in FedEx API? Can you please tell what is the purpose of the following lines in the code
request.RequestedShipment.RateRequestTypes = new RateRequestType[2];
request.RequestedShipment.RateRequestTypes[0] = RateRequestType.ACCOUNT;
request.RequestedShipment.RateRequestTypes[1] = RateRequestType.LIST;

The RateRequestType is if you have an Account with Fedex you will get Account based rates, otherwise List base rates which are more expensive. Most people when developing an api for fed ex use account based rates.

RateRequestTypes object in FedEx API?
Simple answer, no. You need to look at the documentation FedEx (should've) provided you.
If the problem is elsewhere, such as not understanding the messages being passed to and from, then take a look at fiddler. I find this is worth its weight in gold when debugging web services.

Related

Datashake alternatives for gathering review data?

I am looking for alternatives to Datashake that would be compatible using webhooks for either Zapier or Pabbly. Let me know if there is any other tool that has a review scraper and is compatible with Zapier and Pabbly.
Tried integrating datashake with pabbly and zapier. We could not integrate datashake with them. We are looking for alternatives.
See https://www.reviewsmaker.com - There are other places you can look specifically for APIs such as APIfy or Webautomation.io; RM is by far the most superior and is worth checking out. Anything that has an endpoint that consumes and gives a payload can be used with webhooks. :)

PageSpeed Insights API: usability, security and metrics missing from json response

I am using PageSpeed Insights API to grab speed metrics of different websites and integrate the data in a tool I'm creating.
If I try a query using the API test tool (https://developers.google.com/speed/docs/insights/v4/reference/pagespeedapi/runpagespeed), then everything is fine and I get the info I need.
However, when I perform the very same query (as far as I can see) from my server, the response json does not include the same information. Some information is just missing.
Basically, other than the 'initial_url', all the metrics information that should be included in the 'loadingExperience' branch is missing. No info on 'FIRST_CONTENTFUL_PAINT_MS' or 'DOM_CONTENT_LOADED_EVENT_FIRED_MS'.
On the other hand, I can't seem to find the way to request info on USABILITY and SECURITY under the 'ruleGroups' branch. According to the API reference, this branch should feature information on these aspects too, but nothing like that is return after the query. Just the SPEED branch info is returned.
This is the URL I use to query the API:
https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=https://stackoverflow.com&strategy=mobile&screenshot=true&locale=en&key=XXXXXXXXmyAPIKeyXXXXXXXX';
Am I missing anything? I have checked the API documentation and Google'd for more info on this, but I can't seem to find any parameter to force request this information.
(By the way, this is my first question at StackOverFlow, so I hope I have shared all the necessary information. And apologies if my english is bad. I do my best.)
I'm having the same issue with some websites. The problem is related to the website. Some websites are providing the userExperience.metrics object and some are not. I have no idea what is causing this.
However you can try to use strategy=desktop parameter to get the userExperience.metrics object in version 5. This worked for me.
Working URL: https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://stackoverflow.com&strategy=desktop&key=[SetYourApiKeyHere]

how accurate is microsoft cognitive speaker identification

I am trying to build an application with Microsoft Cognitive Speaker Identification Service. But when I check it using its api some audio are not recognized correctly. I would like to know how much is the accuracy level of the service. Is there any way to improve it.
There are various things that can affect the accuracy of the identification e.g. Noise level, microphone quality, echo, etc.
To improve the performance in your condition, you can make sure the enrollment audio is recorded in the same conditions as the test audio (e.g. same microphone) and try to ensure that recording is done in a quiet environment.
It does work across multiple users and tried on different PCs/microphones.
I'd make sure that:
It is in a quiet room/environment
You are sending the audio correctly... (it is just byte array data, no additional encoding.)
Also check the header MediaTypeHeaderValue/content type, all request seem to be 'application/json' even though we send wav files.
Take care when mapping your users to the azure guids, and make sure you are using the correct ones. If you are using the SDK rather than API for profile creation and enrollment, there's no retreival of profile by id at the moment, I have done a workaround, to recreate the profile , and update the id in a database just before Enrollment. (the API doesn't need this though)
Also make sure you are using the latest API, (urls ending .../speaker/verification/v2.0/ etc... Some of the text independent features in the SDK are V2 only, and can fail verification becuse V2 stores profiles in 3 separate locations depending on the verification method.
Also check the profile was created/enrolled using the same verification method you are using to verify. try with a new profile if unsure.

OnConnect Sport Listing data

I recently created an application for the Gracenote OnConnect platform specifically to query Sport tv listings data. My project is an open source tool to allow users to easily find the channel for a given search event. So for example, if I wanted to find out when and on what channel the Yankees vs Red Sox game was tonight, I would go this site, search "Yankees vs Red Sox" and see that it is on ESPN at 7pm.
I've received an API key from the OnConnect API on the "Public Plan" and have made a few calls. It seems as though some of the required data is there, but I wanted to get some feedback before getting into the weeds. First of all, could I use the available API using the free public plan to get this kind of data? If so, do you have any suggestions for how to work with the API including specific endpoints to hit or consumption patterns?
Thank you,
Vance Faulkner
OnConnect API Public Plan is only for you to try out and test internally. Therefore, you cannot use it in your open source tool.

How to get distance from Google Map API from server side ASP.NET 2.0

I am working on a project which requires a server side access to google map api. i want to calculate distance (actual distance, not straight line). google map api supports javascript and not asp.net. please give suggestions ...!
you specified google maps in your question - but have you looked at Virtual Earth? Specifically this routing with Virtual Earth Web Service example sounds exactly like what you want:
server-side access (just Add Service Reference inside visual studio)
actual distance (not straight line) since it is using a route
The concerns raised by others about T&Cs for 'internal/intranet use' apply to VE as well as Google I think - you'll have to read up about whether your application needs licensing or not.
p.s. if you did just want to calculate straight-line distance, I have instructions using SQL Server 2008; which also links to some straight c# code that does it too.
The Google API allows you to Geocode via a server side call:
http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct
This would allow you to get the longitude and latitude of the locations. You can then cache these and use them to calculate distance using the techniques CMS suggests.
You will need to be careful of the Google T&C's though as you are only allowed to store the geocoding data for use on a Google map which is publicly available.
You would probably also run into limitations on the number of requests you could make from a single IP.
However I think what you mean by non-straight line distance is distance taking into account roads and one way streets etc.
If this is the case I think a commercial service is your only option. Although theoretically you could do it all via screen scraping, I'm almost certain that this would break Google's T&C's.
The simplest solution would probably be just to embed a Google map on a page of your application and let the user calculate the distance. You could pre-fill the to and from fields if required.
Again if this is for an internal app i.e. Not publicly available "my understanding" of the Google T&C's would forbid this.
Use something like firebug or fiddler to look at the requests that are being sent to Google from javascript you should then beable to build the request using that information and an HTTPWebRequest in .net and retrieve the same information.
HTH
You can calculate the distance of two geographical coordinates (latitude, longitude) using the Great-circle distance algorithm.
Here you can find some other formulas for distance calculation.
Well, you've pretty much identified the key issue, the Gmaps API is a browser resident javascript API and there's not much getting around that. Most of the API is executed in the browser so there's not much network traffic to spy on.
As tsaunders mentions there is a geocoding API call that is restfully accessible, but it only does reverse/geocoding and if you have lat/lng's already you can use the calculations the rms suggested, but they are as tsaunders points out 'as the crow flies' distance.
If indeed you are looking for road taken distance, the API does do routing but you are back in the browser to get the start/end points from the user.
Perhaps you can be a little more specific about what you are trying to do and why you feel this requires you to to access the API from your server. My application for instance has features that gather information from the user and sends requests back to my server to work on, some of that data are processed by the Gmaps API first.
If I were to use a API platform, I certinaly would not use Google as the free one does not include advances Geocoding menaing the accuracy is poor. There is also no sla , support or rights of service.
The directions are poor, the coverage for Ireland and Geocoding is almost childlike and the privacy stinks. No professional business would use a google mapping solution.
They copy everyone else's idea, say they are there own and get loads of press (they only added tube stations in 2006) an dcyclc lanes (2010), viamichelin added these 2006 and Traffic in 2009 !
Any agency or developers looking for an API should stick to Bing or ViaMichelin for better customisation and user experience which is killer !

Resources