No response when calling REST API through GEOROUTE - stata

I'm trying to calculate the travel distance between two pairs of lat long using the GEOROUTE package (version SJ22-1 dm0092_1) in Stata 13 and Here REST API. But every time I run the syntax I get the following error. Does it mean there's something wrong with my API authentication?
Screenshot of the error details

Related

google-cloud-build PyPi 400 errors

I am currently receiving 400 errors when invoking the list_builds() method (seen here: https://googleapis.dev/python/cloudbuild/latest/gapic/v1/api.html?highlight=list_builds#google.cloud.devtools.cloudbuild_v1.CloudBuildClient.list_builds)
The following command works using gcloud:
gcloud builds list --filter="status=FAILURE"
However, the following API call returns google.api_core.exceptions.InvalidArgument: 400 Error processing filter expression
for element in client.list_builds("REDACTED", filter_="status=FAILURE"):
# process element
pass
I'm guessing I'm missing something very obvious and simple here but I can't exactly figure out what I'm doing wrong
The correct way to pass in the filter string to the API call includes using double apostrophes around the actual text like so:
filter_='status="FAILURE"'
Unsure of whether or not this will be changed in the future, but this is the same behavior for passing it in via the REST API here: https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds/list
e.g specifiying status=FAILURE will fail, but status="FAILURE" returns a 200 response.
welcome to Stack O! So I'm just spitballing here, but the docs say that the Filter string is "The raw filter text to constrain the results."
When you filter a Cloud Build in the console, the "raw filter text" in the UI says Status : Failed - you could try:
--filter="Status : Failed"
--filter="Status: Failed"
--filter="Status:Failed"
Alternately, it might be the string in the URL, the formatting of which is too bananapants for Stack O's robots to handle, so I can't paste it here, but it starts with f and ends with Failed:
The key here is that you have an equal sign in your string, as well as Failure instead of Failed - changing one or both of those might do the trick.
Hope this helps!

Radixx API example

I am using radixx API for flight search and booking. They gave me the WSDL links and SDK for the WSDL:
Here are the WSDL files:-
http://s9.tpapi.uat.radixx.com/
I have tried one:-
http://s9.tpapi.uat.radixx.com/RadixxSecurity.asmx?op=GetSecurityGUID
I have given the loginid and password and got the guid.
But when i am trying other WSDL file to get details Like below:-
http://s9.tpapi.uat.radixx.com/RadixxFlights.asmx?op=GetFlightScheduleInformation_v2
Here there are five parameter but i know only three of these :-
SecurityGUID(Got from the above wsdl)
StartSearchDate and EndSearchDate(These are the dates)
I dont't know about :-
SearchType and SearchCriteria
They told me i can get those value from SDk but i can't find those.
I cant find the values of other wsdl parameters. Please help me to get those parameters values.
Please help me.
Thanks,
The SDK manual you've been given is not matching the WSDL API. The operation you're looking for should be on http://connectpoint.radixx.com/sdk/#Flight%20-%20Request_xsd.html, but it's not documented. You'll have to contact them for a more complete documentation.

Amazon ItemSearch API reponse different from amazon.com search results

I am trying to figure out the right parameters for ItemSearch such that the API call will return the same result as on the website. Currently I am using these params it is not consistent with the website.
url_params = dict(
Service='AWSECommerceService',
Operation='ItemSearch',
AssociateTag=AMAZON_ASSOCIATETAG,
SearchIndex='All',
AWSAccessKeyId=AWS_ACCESS_KEY_ID,
Keywords=keywords,
ResponseGroup='Small,OfferSummary,Images'
)
For example if 'iphone%205s' is put in keywords, the API returns a list of iPhone protectors, while searching on the website gives iPhones as top results.
I am also trying to figure out why this is for book searches. One possible answer I found online was that the websites search feature might use more elaborate queries than just one simple API call. For example, it may take into account other factors into the search (not sure what that might be but it may).

How to construct signing request for Amazon EC2 API call with filters?

This question is a follow-up to my earlier question on getting a REST API call to EC2 API working.
Having got that working, I wanted to generalize it and tried a couple of things. For example, I tried to filter by region name and make the request
https://ec2.amazonaws.com/?Action=DescribeRegions
&RegionName.1=us-east-1
&RegionName.2=eu-west-1
which they show in the documentation.
Signing that was easy, stick the RegionName(s) into the signing request in their alphabetical position and sign the whole thing just as I would without them. That worked out just fine.
So I progressed to the second example that they provide in the documentation.
https://ec2.amazonaws.com/?Action=DescribeRegions
&Filter.1.Name=endpoint
&Filter.1.Value.1=*ap*
OK, I tried to put the filters into my signing parameters in the alphabetically sorted location as required ...
char * signing_parameters_template =
"AWSAccessKeyId=%s&"
"Action=DescribeRegions&"
"Filter.1.Name=endpoint&"
"Filter.1.Value=*ap*&"
"SignatureMethod=HmacSHA256&"
"SignatureVersion=2&"
"Timestamp=%s&"
"Version=2013-08-15";
and sign that. I get an error that the signature doesn't match. I've tried a bunch of variations of this, no luck.
How does one sign a request that includes filters?
I have to escape the "*" in the filter
"Filter.1.Value=*ap*&"
That's it!

Designing a webservice

I am trying to design a web-service which is used for vehicle parking ticket generation.
One of the APIs is
1. Input: Amount of money customer has deposited.
2. Output: Return the time till which his parking ticket is valid.
e.g. Consider the parking rate is £1 per hour and if the input is £3 and if the current time is 11.30am then the web-service should return 2.30pm. Hope that makes sense.
I was thinking about using RESTful service but I can not figure out what should be the resource. RESTful service does not sound like a good choice.
Any suggestions?
The resource could be just “parkingtickets”. The business action is to ‘create’ a parking ticket. It should be mapped to HTTP POST since the server is to create a resource (parking ticket).
POST /parkingtickets/
Body: {amount: <amount>, starttime: <date-time>}
Return: OK, and {ticketid: <id>, endtime: <data-time>}
You can read more on the usage of HTTP verbs in here
I had to do something similar before.
I built a php app/site where you call functions like this:
example.com/service/calculateparkingtime/?deposit=3.50
and it would print out a json like this(with json headers):
{state:true,parking_time:3.5}
state is used for all responses and if there is an error there is also an 'error' key with an error message like:
{state:false,
error:"Parking time exceeds the working hours of the car park.",
errorCode:"Park01",parking_time:2.5,exceeding_amount:1}
If your API consists of such couple of small functions you can do the same.
service was used with either CURL or file_get_contents in php.
You can build the same app using other languages like ASP.NET and such.
If I understand the problem correctly, you just want the answer to a question/calculation, i.e. you should use HTTP GET:
GET foobar.tld/ticketExpires/<amountInGBP> -> expiretime
I would probably return date+time, since £200 would return a time some days later....
your example would be:
GET foobar.tld/ticketExpires/3 -> "2:30pm" (or preferably "YYYY-MM-DD 14:30:00")
issues: different timezones between webservice and client? is amount of money always in GBP?
You also need to consider what the format for the response/answer should be: JSON, XML, plaintext, the client "should" to specify the desired format using headers. If you have a simple client just return smoe default format the client understands.