Fetching Entity Information
While testing the previous example, if you inspected the intent request closely enough, you may have spotted something very interesting about the resolved slot value. Specifically, not only did the value have a name, it also had an id property whose value is a URL.
For example, if the city spoken in place of the city slot were Paris, the request might look a little like this:
| "city": { |
| "name": "city", |
| "value": "Paris", |
| "resolutions": { |
| "resolutionsPerAuthority": [ |
| { |
| "authority": "AlexaEntities", |
| "status": { |
| "code": "ER_SUCCESS_MATCH" |
| }, |
| "values": [ |
| { |
| "value": { |
| "name": "Paris", |
» | "id": "https://ld.amazonalexa.com/entities/v1/1z1ky..." |
| } |
| } |
| ] |
| } |
|
Get Build Talking Apps for Alexa now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.