google nearby places search results in "invalid request" - search

I am using Google's nearbysearch API.
Here is my url:
https://maps.googleapis.com/maps/api/place/nearbysearch/xml?key=&location=30.2981490,-97.7234120&type=atm&language=en&rankby=distance
I'm invoking it in Ruby with
curl #{url}
No matter what i change, location, type, rankby to radius, I get:
INVALID_REQUEST
What am I missing?

Change the order of query string. it worked
https://maps.googleapis.com/maps/api/place/nearbysearch/xml?type=atm&rankby=distance&location=30.2981490,-97.7234120&language=en&key=api_key

Related

How to use fhir client search to include all resources i.e. ($everything)

How would you search for all resources for a given patient e.g. encounter, appointment, consent?
I know you could search for it via postman request http://localhost:9090/organId/Patient/12345/$everything and get the result. But I want to be able to execute the search query from my java program.
This is what I have so far, but I know the include part is not good and not working. Googling didn't return any result.
Bundle bundle = myFhirClient
.search()
.forResource(Patient.class)
.returnBundle(Bundle.class)
.where(new NumberClientParam(Patient.SP_RES_ID).exactly().number(patientId)).include(new Include("$everything"))
.sort(new SortSpec().setOrder(SortOrderEnum.DESC).setParamName(Patient.SP_RES_ID))
.execute();
Any help is much appreciated
I had to use Fhir Client operation instead of search. This will return all the reference resources for the given patientId.
Parameters outParams = myFhirClient
.operation()
.onInstance(new IdType("Patient", patientId))
.named("$everything")
.withNoParameters(Parameters.class) // No input parameters
.execute();

Can't seem to find the issue with the requestID parameter for the request header

I am trying to pull data from a REST API that uses a "similar standard to JSON RPC". The params I am passing look right according to the documentation here and here.
The error I am receiving is ...message:"Header missing request ID".... I am unsure what I am missing that would properly declare the requestID.
I have looked at the documentation provided via the API I am trying to pull data from but it's not very helpful considering it's all in PHP and cURL. I am trying to complete this task using python-requests.
getParams = {'method': 'getCustomers', 'params':{'where':'', 'limit': 2}, 'id': 'getCustomers'}
Result:
{"result":null,"error":{"code":102,"message":"Header missing request ID","data":[]},"id":null}
The return result should contain a list of All Customers and their attributes in JSON format.
Turns out there is nothing wrong with the code I am using. There is an issue with the API I am attempting to call.
In my situation, I was getting the same error back and was required to send a X-Request-ID header. I fixed it by adding the following to my headers:
headers = {
'X-Request-ID': str(uuid.uuid1()) # generate GUID based on host & time
...
Note that (for me) the GUID needed to be of a specific format (e.g. matching the Regex ^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$
taken from https://www.geeksforgeeks.org/how-to-validate-guid-globally-unique-identifier-using-regular-expression/). For example, it still gave the same error if I just sent "test".

Unexpected strings "botbuilder-location:TitleSuffix" and "botbuilder-location:MultipleResultsFound" when using BotBuilder-Location

I have tried using BotBuilder-Location to collect the user's location via the Bing Maps API. I have followed the instructions on BotBuilder-Location's GitHub repository and have managed to be able to display a map fron Bing Maps using the code from the example:
var options = {
prompt: "Where should I ship your order?",
useNativeControl: true,
reverseGeocode: true,
requiredFields:
locationDialog.LocationRequiredFields.streetAddress |
locationDialog.LocationRequiredFields.locality |
locationDialog.LocationRequiredFields.region |
locationDialog.LocationRequiredFields.postalCode |
locationDialog.LocationRequiredFields.country
};
locationDialog.getLocation(session, options)
However, in the prompt for the location the string "botbuilder-location:TitleSuffix" keeps showing, and the dialog does not continue after showing the map but instead displays the string "botbuilder-location:MultipleResultsFound" (Screenshot of unexpected strings). I have tried this in the Emulator as well as on Skype and Facebook Messenger with the same results.
Does anybody know how to fix this?
Thanks and best regards!
This is known issue and it's reported here. There you will also find a workaround. The team behind the control is testing a potential fix.

Query JIRA API for all issues at "Awaiting Release"

I'm trying to use the JIRA REST API (2.0.alpha1), to query and get all issues in a certain project at "Awaiting Release".
I can get a query to get me all issues in a certain project "TST" (with this string):
http://hostname.com/jira/rest/api/2.0.alpha1/search?jql=project=TST
However, I want to filter this further by only getting the issues with a certain status.
I've created a filter in JIRA using their JQL language, and it looks like this (if this helps):
project = TST AND issuetype in (Bug, "User Story") AND status = "Awaiting Release"
Also, I am using 'node-jira' (https://npmjs.org/package/jira). If you are familiar, here is my call. It always returns a 500 for some reason.
jira.searchJira('project=TST', {}, function (err, issue) {
console.log(err);
console.log(issue);
});
Here is the documentation: https://docs.atlassian.com/jira/REST/latest/#d2e1291
Here is the example page: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Query+issues#JIRARESTAPIExample-Queryissues-Request.4
Okay, I've got the following URL query that works:
http://hostname.com/jira/rest/api/2.0.alpha1/search?jql=project=TST+AND+status=%22Awaiting%20Release%22+AND+issuetype+in%20(Bug,%20%22User%20Story%22)
However, I still cannot figure out why that node-jira is returning a 500 on the result. Please post if you have any input as well!

Foursquare API error No venues or groups specified returned when adding campaign

Using the Foursquare Merchant API, I'm trying to add a campaign. I am able to add a special successfully. However, when using the special's id and adding a campaign, I receive the following error, "Foursquare2::APIError: other: No venues or groups specified. (400)".
Even after specifying both the specialId and venueId, I receive the same error. Although the foursquare docs state that only the specialId is required.
I am using the Foursquare2 ruby wrapper gem with my code additions to add a campaign
def add_campaign(options={})
response = connection.post do |req|
req.url "campaigns/add", options
end
return_error_or_body(response, response.body.response.campaign)
end
Having receiving a client object from the foursquare gem. I use the below code
client.add_campaign(:specialId => specialId, :venueId => venueId)
Any thoughts on why this is causing an error?
venueIds and groupIds are not individually required, but one of them must be provided. I'll update the documentation to make this clearer. Thanks for pointing this out!

Resources