[here-api]How can I create a route without knowing the destination? - here-api

I want to implement the Here functionality "Implementing Search along the route" but without knowing the destinations I cannot create a route and then I cannot use this function.
Any suggestions?
Thanks
Mats
Read the documentation

The destination parameter is required in the HERE APIs to calculate the route.
//Pankaj

Related

HERE API Calculate Route - avoid anything changes router behavior

Problem
If you choose to use avoidArea, exclueCountries or avoidLinks (and probably some more that I wasn't able to test) in your request router enforces fastest route mode.
Given is route from Poland to Germany.
Official testing client: http://refclient.ext.here.com/
First request (no avoids, no excludes, mode:shortest) was:
https://route.api.here.com/routing/7.2/calculateroute.json?app_code=pxIXqdtgOSwQDXSDfjLQpw&app_id=cgZPrYfgRePXzXC3PbBp&jsonattributes=41&language=en-us&legattributes=le&maneuverattributes=po,ti,pt,ac,di,fj,ix&metricsystem=metric&mode=shortest;car&routeattributes=sh&waypoint0=geo!stopOver!53.49012,18.80973&waypoint1=geo!stopOver!53.61957,12.43167
This resulted in a quite straightforward route like below.
If we add now any country exclusion (e.g. GBR, CHE, CZE) the route is now routed via motorways like fastest mode was enforced.
https://route.api.here.com/routing/7.2/calculateroute.json?app_code=pxIXqdtgOSwQDXSDfjLQpw&app_id=cgZPrYfgRePXzXC3PbBp&avoidseasonalclosures=false&excludecountries=CHE,GBR,CZE&jsonattributes=41&language=pl-pl&legattributes=le&maneuverattributes=po,ti,pt,ac,di,fj,ix&metricsystem=metric&mode=shortest;car&routeattributes=sh,zo&waypoint0=geo!stopOver!53.49012,18.80973&waypoint1=geo!stopOver!53.61957,12.43167
EDIT 1 BEGIN
I checked out the new routing API and results are similar:
Without avoids:
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={API_KEY}=41&language=en-us&legattributes=le&maneuverattributes=po,ti,pt,ac,di,fj,ix&metricsystem=metric&mode=shortest;car&routeattributes=sh&waypoint0=geo!stopOver!53.49012,18.80973&waypoint1=geo!stopOver!53.61957,12.43167
With avoids:
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={API_KEY}&avoidseasonalclosures=false&excludecountries=CHE,GBR,CZE&jsonattributes=41&language=pl-pl&legattributes=le&maneuverattributes=po,ti,pt,ac,di,fj,ix&metricsystem=metric&mode=shortest;car&routeattributes=sh,zo&waypoint0=geo!stopOver!53.49012,18.80973&waypoint1=geo!stopOver!53.61957,12.43167
On a sidenote, http://refclient.ext.here.com/ doesn't have option to test new API
EDIT 1 END
Question
Why is it happening? Is it designed behavior? If not, when can we expect this to be fixed?
Ok, I've got an answer for you from engineering. I'm rewording a bit so any mistakes/confusion blame me, not him. :)
So yes, the API here is ignoring your request to use shortest.
Quote from developer: Specifically in this case, when using "shortest" mode and requesting additional "avoids", routes more than 300km or so are not "good". It does not fall back to "fastest" mode but another mode where "fastest" route shape has more of an influence.
You mentioned wanting to avoid tolls, be aware that you can ask for that option when calling the API, so that may be a solution for you.
I hope this helps a bit, and thank you for being patient.

Create record via client script in a relation model in App Maker

Could someone point me to documentation that shows how to create a record in a model with one to many relation via client side script.
Thanks in advance!
There are two ways of creating a new record.
1. Via a client-side script
You can do this by calling a createItem function from a widget. This link might help with that.
2. Via a server-side script
You can do this by directly creating a new record, assigning it to the relation of a model and then saving that model. This link might help with this method. By the way, it's easier to do this in a server-side script, as the guide itself says.
Since you just requested the link to official documentation, I've limited my answer to links only. Please feel free to ask if you need clarifications!

(wit.ai) Is it possible to add keyword to wit/location using the http api?

I used the following method (https://wit.ai/docs/http/20160526#post--entities-:entity-id-values-link) to add a keyword to a user defined entity, and it worked. However, when I did this to add a keyword to wit/location (one of the built-in entities in wit.ai), it did not work.
How do I add a keyword to wit/location using the http api?
Is there another way I can add keywords to wit/location automatically?
Thanks for asking. This is actually not possible. wit/location is a built-in entity, which means it is trained across many Wit apps. Since this is used by thousands of Wit apps, we want to be careful with the HTTP API. Why do you need to add keywords for wit/location? You have 2 options:
Validate via the console some examples (here this is more where the wit/location is located in these examples than the current keyword itself).
Create your own custom location entity

How does one expose constants in a java google app engine Endpoints API?

Simple question -- how do you expose constants in a java google app engine Endpoints API?
e.g
public static final int CODE_FOO = 3845;
I'd like the client of the Endpoints to be able to match on CODE_FOO rather than on 3845. I'll end up doing enum wrappers (which probably is better anyway) but I'm just starting to be curious if this is even doable? Thx
Note that this isn't a full answer but here is a workaround: in Android Studio, create a very light-weight "common" java project and shove anything you want to keep in sync there such as constants as well as common types that you want exposed (e.g. an enum representing all possible return / error codes, etc).
This way you should get pretty decent compiler-time safety and keep these guys in sync.
Please feel free to comment if anyone has better suggestions.
This is unfortunately a Law of Information (ahem). If you have a message protocol you defined, both sides of the interaction need to be aware of the messages that could be passed. There's no other way for the client to be aware of what it needs to respond to. Ajax libraries hard-code the number "200" to be able to detect a successful request, as one example.
Yes, just use a switch statement on strings inside your client code. Or, you could use a dictionary of strings pointing to functions and just call the function after de-referencing the dictionary given the string you got.

Is it possible to read Evernote content without having to authenticate?

What is the easiest, lowest-friction method to read a note programmatically in Evernote? Given that you can share notes by simply generating a unique URL to them, I find it curious that you can't do this programatically as well.
Put another way, I can read notes from my browser without having to authenticate to Evernote. Can I do this programmatically as well? If I have a URL with GUID, can I use this to request the note via code and read it that way?
I attempted to do this -- to use the "Share" URL to read the note. It didn't work, for some reason. When requested programmtically, I was getting 404s for some reason, which makes me think Evernote has some safeguards against using it in this method.
Is there a way to do this -- to read note content via some service without having to authenticate?
Well actually you can. You just need to use the getNote method with an empty string as the first argument (auth token).

Resources