I'm using the HERE Route Match Extension API for matching GPX Data to a route. Afterwards, I am using the road links from the matched route for querying the Routing API. This worked perfectly some weeks ago; strangely I am now getting this error for some of the road links from the Route Match Extension API (response from the Routing API):
"_type": "ns2:RoutingServiceErrorType",
"type": "ApplicationError",
"subtype": "LinkIdNotFound",
"details": "LinkId(s) specified in request are not available",
"additionalData": [
{
"key": "LinkId[0]",
"value": "-1224766809"
}
]
In the response from the Route Match Extension API, the road link definitely exists:
{"confidenceValue":0.6,"elevation":188.39999999999998,"headingDegreeNorthClockwise":10000.0,"headingMatched":118.0,"lat":49.67599245719612,"latMatched":49.67605,"linkIdMatched":-1224766809,"lon":10.035531716421247,"lonMatched":10.03558,"matchDistance":8.36,"matchOffsetOnLink":0.6588415883643146,"minError":1000000.0,"routeLinkSeqNrMatched":178,"speedMps":0.0,"timestamp":1532677148000}
Here is an example query link for the above error: https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!49.77763,9.95697&waypoint1=link!-1224766809&mode=fastest%3Bcar%3Btraffic%3Aenabled&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ&representation=linkPaging&language=de-de&returnElevation=true&maneuverAttributes=position%2Clength%2CtravelTime%2CstartAngle&instructionFormat=text&routeAttributes=waypoints%2Csummary
What's going on here? Is this just a temporary issue, since it used to work some weeks ago?
Underlying map release for RME and routing api could be different which leads to link id in both not matching. It is recommended to use lat, long for the routing api.
Routing api and extensions api map release cycles are different and you wont be able to change them. It is better to use the lat, lon rather than relying on link id for your usecase. Using the lat, long from your rme response I get a different link id in routing api. https://route.cit.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!49.77763,9.95697&waypoint1=geo!49.67599245719612,10.035531716421247&mode=fastest%3Bcar%3Btraffic%3Aenabled&app_id=<>&app_code=<>&representation=linkPaging&language=de-de&returnElevation=true&maneuverAttributes=position%2Clength%2CtravelTime%2CstartAngle&instructionFormat=text&routeAttributes=waypoints%2Csummary
Related
This doc says "With the Reference-Based Catalog Management API, you can create a custom slot type that references an external data source to get the slot type values. This API allows you to create and maintain a catalog of slot type values independent of your Alexa skill."
However as you dig into it, it doesn't provide some needed details on how to actually setup the catalog on an endpoint like s3.
While this resource was provided as an answer in this similar question, it actually refers to content catalogs (like music playlists), not the Reference-Based Catalog Management API, so I assume that was in error and it is not applicable.
So, for the Reference-Based Catalog Management API: The docs say it needs to be in JSON format, and offers ingredients.json as an example. However I used this directly, and it fails (see below). Also, it does not describe what the format should be to include synonyms. Please describe this.
I can successfully create the catalog with '/v1/skills/api/custom/interactionModel/catalogs/' and get a catalogId in return. However, creating the catalog version via '/skills/api/custom/interactionModel/catalogs/{catalogId}/versions' fails. I get "Website Temporarily Unavailable" when I issue the POST.
Here's the request body structure that I'm including with that post:
data: {
"source": {
"type": "URL",
"url": "https://s3.amazonaws.com/..../ingredients.json"
},
"description": "test S3 bucket"
}
Also, does the S3 endpoint have to be made public? I tried it both ways, didn't seem to matter. If it does have to be public though, how did you handle security?
Thanks for the help.
While the API call fails, I did get this to work using the CLI approach.
ask api create-model-catalog-version -c {catalogID} -f {filename}
The file should be JSON with the following structure:
{
"type": "URL",
"url": "[your catalog url]"
}
It remains an open question how to get the API approach to work, so any answers appreciated. Maybe it is a bug, because I specify the exact same 'source' definition in the data structure of the API call as I do in the JSON file used by the CLI command.
Here's what I learned as I got it to work with the CLI:
Yes, the S3 endpoint must be made public in order for the create-model-catalog-version job to succeed. This strikes me as a problem, would like to see the ability to wrap some security around these endpoints.
Here is the format of the JSON that you will want to use, including the use of synonyms which is not described in the official Amazon example. Note that you don't have to include an ID as shown in that example.
{
"values": [
{
"name": {
"value": "hair salon",
"synonyms": [
"hairdresser",
"beauty parlor"
]
}
},
{
"name": {
"value": "hospital",
"synonyms": [
"emergency room",
"clinic"
]
}
},
]
}
I have a 90-day trial and I am registered at (Evaluation 2018-06-29).
But when I request with my correct copied app id and app code I get the below error.
{
"response": {
"_type": "ns2:RoutingServiceErrorType",
"type": "PermissionError",
"subtype": "InvalidCredentials",
"details": "This is not a valid app_id and app_code pair. Please verify that the values are not swapped between the app_id and app_code and the values provisioned by HERE (either by your customer representative or via http://developer.here.com/myapps) were copied correctly into the request.",
"metaInfo": {
"timestamp": "2018-08-15T18:52:35Z",
"mapVersion": "8.30.86.153",
"moduleVersion": "7.2.201832-36299",
"interfaceVersion": "2.6.34"
}
}
}
Can anyone help, especially someone from here api developer support team?
Go into your account projects and add a new project explicitly for the Freemium plan. Then you should be able to generate a new JavaScript/REST App ID and App Code. If you are using one of the mobile SDKs you would generate a new id / code there as well.
(1) Copy and Paste
I'm not certain this is what may be happening for you, but one of my codes had a leading underscore and it was very easy to copy and paste it incorrectly into my source code.
(2) Domain Protection
Also make sure that if you checked "Secure app credentials against a specific domain" that you are calling the routing service from the same domain.
(3) Shell Interpolation
Without more detail about how you are making the calls to the routing service (curl, postman, javascript, ios, android, etc.) it may also indicate where to offer advice.
For example, if you are using curl make sure your parameters have surrounding quotes as & will be interpreted by a shell such that ?app_id=your-app-id&app_code=your-app-code is not interpreted properly. That could generate the response you saw as the shell took your app_code parameter away before curl could make the request only passing the app_id.
I'm attempting to use the 3 VM SharePoint Azure QuickStart Template on Azure Government.
Everything works fine except that the deployment errors out due to the fact that Azure Government expects the storageAccountUri to be blob.core.usgovcloudapi.net, while the default is blob.core.windows.net.
I've changed the JSON files to the expected blob.core.usgovcloudapi.net, but it still complains of the error that the blob URL's domain must be blob.core.usgovcloudapi.net.
I'm wondering why it is being overridden and how I can prevent that.
An example of the change I've made is:
"osDisk": {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://',parameters('storageAccountNamePrefix'),'1.blob.core.usgovcloudapi.net/vhds/',parameters('sqlVMName'),'-osdisk.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
Any help would be appreciated.
You should be able to reference the storage account and that will ensure you always get the correct address (regardless of cloud):
"osDisk": {"name": "osdisk","vhd": {"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/',
variables('storageAccountName')), '2015-06-15').primaryEndpoints.blob, variables('vmStorageAccountContainerName'), '/',variables('OSDiskName'),'.vhd')]"}}
We have some other tips for using a QuickStart that might be hard coded to a single cloud here:
https://blogs.msdn.microsoft.com/azuregov/2016/12/02/azure-quickstart-templates/
First of all i am a newbie at jmeter. I searched a lot of documents but unfortunately i did not find to answer for my problem. I have a web api rest service with following sign. I can't send dictionary format parameter.
[HttpPost,ActionName("DummyService")]
public Dictionary<string,string> DummyService([FromBody] Dictionary<string,string> parameters)
I used Parameters section and BodyData section but parameters are always null.
How can i achieve that?
Thanx in advance.
I believe you need to pass some form of a JSON Array to your web service, in order to do it:
Switch to Body Data tab
Put your JSON payload there like:
{
"Parameters": [
{
"Key": "Key1",
"Value": "Value1"
},
{
"Key": "Key2",
"Value": "value2"
}
]
}
Most likely you will need to add a HTTP Header Manager to your test plan and configure it to send Content-Type header with the value of application/json
(optional) Consider upgrading to JMeter 3.0, looking into screenshot it seems you're sitting on an older version
See Testing SOAP/REST Web Services Using JMeter guide for more information on setting up JMeter for API testing
I'm looking for a way to get the user's location, ideally longitude/latitude but address would work too, from the Alexa Skill Kit request to my custom skill. Also, I don't want to have to have the user link to an account on my app's side.
Is this possible? If so, how?
Amazon has now (2017-04-05) added this capability. See their blog post about their new Device Address API.
Using this new API you can get the address (either postal code or full address) of the device, as specified in the customer’s device settings.
From that you could use a geocoding API (such as is part of the Google Maps API) to translate the address into location coordinates.
As per this thread on the Amazon Developer forums, there is not currently (as of May 2016) a way to get user location via the publicly available APIs. The only skills able to do so, such as Uber or Domino's, are utilizing APIs that are not available through the Alexa Skills Kit. However, there's hope that it may be added, as "Jamie#Amazon" left this reply in that discussion:
Hey there,
Thanks for posting.
This has now been added to the roadmap. Thanks for the feedback.
Jamie
However, at the time of writing, no further update has been provided regarding the implementation of such a feature.
As #Tom has pointed out, it is now possible to get the device address in your custom skill. If you are using Python to create your skill, it's pretty easy to implement the new API. I've written a detailed blog post about it here. It also describes how to get the corresponding coordinates for the retrieved address, so it might be useful for you. In short, here is a Python function to get you started. I use the very handy Flask-Ask library for my skill. Thus, it is easy to get the value of the deviceId and consentToken objects. These are included by Alexa in the JSON request sent to your skill. They are needed for constructing the request to the Amazon address API endpoint:
import requests
from flask_ask import Ask, context
def get_alexa_location():
URL = "https://api.amazonalexa.com/v1/devices/{}/settings" \
"/address".format(context.System.device.deviceId)
TOKEN = context.System.user.permissions.consentToken
HEADER = {'Accept': 'application/json',
'Authorization': 'Bearer {}'.format(TOKEN)}
r = requests.get(URL, headers=HEADER)
if r.status_code == 200:
return(r.json())
The function will return something like this on a successful call:
{u'city': u'Berlin', u'countryCode': u'DE',
u'addressLine1': u'42 Unter den Linden',
u'addressLine2': None, u'stateOrRegion': u'Berlin',
u'districtOrCounty': u'Berlin', u'postalCode': u'10117',
u'addressLine3': None}
You can use geopy to convert this address to coordinates.
It is now possible to get the user's real-time geolocation (longitude/latitude) using the Alexa Location Services, which avoids having to integrate with a separate geocoding API as suggested by other answers. See the related blogpost for official information about this feature's release.
Provided that the device is compatible (context.System.device.supportedInterfaces.Geolocation exists), the location services are running and the alexa::devices:all:geolocation:read permission has been granted to your skill , you can retrieve a Geolocation object through the request's context, which will be equivalent to the following JSON payload:
"Geolocation":{
"locationServices": {
"access": "ENABLED",
"status": "RUNNING",
},
"timestamp": "2018-03-25T00:00:00Z+00:00",
"coordinate": {
"latitudeInDegrees": 38.2,
"longitudeInDegrees": 28.3,
"accuracyInMeters": 12.1
},
"altitude": {
"altitudeInMeters": 120.1,
"accuracyInMeters": 30.1
},
"heading": {
"directionInDegrees": 180.0,
"accuracyInDegrees": 5.0
},
"speed": {
"speedInMetersPerSecond": 10.0,
"accuracyInMetresPerSecond": 1.1
}
}
Please follow the below URL to Get location from Alexa Skills Kit (ASK)
URL:
https://api.eu.amazonalexa.com/v1/devices/{devicesId}/settings/address/countryAndPostalCode
Your Header would be something like below :
Host:api.eu.amazonalexa.com[keep your host you can get is from developer account during testing from json]
Accept:application/json
Authorization:Bearer [KEEP YOUR apiAccessToken here]
if request went success your will get response as below:
{
"countryCode": "IN",
"postalCode": "560102"
}
Make sure you have enabled permission in the Alexa app, and grants the permission of the respective skill please refer the bellow URL for more details of permission configuration
https://developer.amazon.com/blogs/alexa/post/0c975fc7-17dd-4f5c-8343-a37024b66c99/alexa-skill-recipe-using-the-device-address-api-to-request-information