Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for Alexa requests #10

Open
RalfEggert opened this issue Oct 26, 2019 · 0 comments
Open

Better support for Alexa requests #10

RalfEggert opened this issue Oct 26, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@RalfEggert
Copy link

The requests that are sent by the Alexa Voice Service have been grown a lot in the last months. There is plenty of new stuff sent by the AVS that is not represented in the Phlexa\Request\AlexaRequest class hierarchy. So we need to identify these blocks and add them to the class hierarchy by adding new classes and properties to these new classes.

The first step is to pick all missing information from normal requests.

Launch request

{
	"version": "1.0",
	"session": {
		"new": true,
		"sessionId": "amzn1.echo-api.session.sessionId",
		"application": {
			"applicationId": "amzn1.ask.skill.applicationId"
		},
		"user": {
			"userId": "amzn1.ask.account.userId"
		}
	},
	"context": {
		"Display": {},
		"System": {
			"application": {
				"applicationId": "amzn1.ask.skill.applicationId"
			},
			"user": {
				"userId": "amzn1.ask.account.userId"
			},
			"device": {
				"deviceId": "amzn1.ask.device.deviceId",
				"supportedInterfaces": {
					"Display": {
						"templateVersion": "1.0",
						"markupVersion": "1.0"
					},
					"Alexa.Presentation.APL": {
						"runtime": {
							"maxVersion": "1.1"
						}
					}
				}
			},
			"apiEndpoint": "https://api.eu.amazonalexa.com",
			"apiAccessToken": "apiAccessToken"
		},
		"Viewport": {
			"experiences": [
				{
					"arcMinuteWidth": 246,
					"arcMinuteHeight": 144,
					"canRotate": false,
					"canResize": false
				}
			],
			"shape": "RECTANGLE",
			"pixelWidth": 1024,
			"pixelHeight": 600,
			"dpi": 160,
			"currentPixelWidth": 1024,
			"currentPixelHeight": 600,
			"touch": [
				"SINGLE"
			],
			"video": {
				"codecs": [
					"H_264_42",
					"H_264_41"
				]
			}
		},
		"Viewports": [
			{
				"type": "APL",
				"id": "main",
				"shape": "RECTANGLE",
				"dpi": 160,
				"presentationType": "STANDARD",
				"canRotate": false,
				"configuration": {
					"current": {
						"video": {
							"codecs": [
								"H_264_42",
								"H_264_41"
							]
						},
						"size": {
							"type": "DISCRETE",
							"pixelWidth": 1024,
							"pixelHeight": 600
						}
					}
				}
			}
		]
	},
	"request": {
		"type": "LaunchRequest",
		"requestId": "amzn1.echo-api.request.requestId",
		"timestamp": "2019-10-26T17:43:17Z",
		"locale": "de-DE",
		"shouldLinkResultBeReturned": false
	}
}

Intent Request

{
	"version": "1.0",
	"session": {
		"new": false,
		"sessionId": "amzn1.echo-api.session.sessionId",
		"application": {
			"applicationId": "amzn1.ask.skill.applicationId"
		},
		"attributes": {
			"names": [
				"Ralf",
				"Horst"
			],
			"count": 2
		},
		"user": {
			"userId": "amzn1.ask.account.userId"
		}
	},
	"context": {
		"Display": {},
		"Alexa.Presentation.APL": {
			"token": "handle-known",
			"version": "APL_WEB_RENDERER_GANDALF",
			"componentsVisibleOnScreen": [
				{
					"uid": ":1024",
					"position": "1024x600+0+0:0",
					"type": "mixed",
					"tags": {
						"viewport": {}
					},
					"entities": []
				}
			]
		},
		"System": {
			"application": {
				"applicationId": "amzn1.ask.skill.applicationId"
			},
			"user": {
				"userId": "amzn1.ask.account.userId"
			},
			"device": {
				"deviceId": "amzn1.ask.device.deviceId",
				"supportedInterfaces": {
					"Display": {
						"templateVersion": "1.0",
						"markupVersion": "1.0"
					},
					"Alexa.Presentation.APL": {
						"runtime": {
							"maxVersion": "1.1"
						}
					}
				}
			},
			"apiEndpoint": "https://api.eu.amazonalexa.com",
			"apiAccessToken": "apiAccessToken"
		},
		"Viewport": {
			"experiences": [
				{
					"arcMinuteWidth": 246,
					"arcMinuteHeight": 144,
					"canRotate": false,
					"canResize": false
				}
			],
			"shape": "RECTANGLE",
			"pixelWidth": 1024,
			"pixelHeight": 600,
			"dpi": 160,
			"currentPixelWidth": 1024,
			"currentPixelHeight": 600,
			"touch": [
				"SINGLE"
			],
			"video": {
				"codecs": [
					"H_264_42",
					"H_264_41"
				]
			}
		},
		"Viewports": [
			{
				"type": "APL",
				"id": "main",
				"shape": "RECTANGLE",
				"dpi": 160,
				"presentationType": "STANDARD",
				"canRotate": false,
				"configuration": {
					"current": {
						"video": {
							"codecs": [
								"H_264_42",
								"H_264_41"
							]
						},
						"size": {
							"type": "DISCRETE",
							"pixelWidth": 1024,
							"pixelHeight": 600
						}
					}
				}
			}
		]
	},
	"request": {
		"type": "IntentRequest",
		"requestId": "amzn1.echo-api.request.requestId",
		"timestamp": "2019-10-26T17:49:26Z",
		"locale": "de-DE",
		"intent": {
			"name": "GreetIntent",
			"confirmationStatus": "NONE",
			"slots": {
				"first_name": {
					"name": "first_name",
					"value": "horst",
					"resolutions": {
						"resolutionsPerAuthority": [
							{
								"authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.authority.AMAZON.DE_FIRST_NAME",
								"status": {
									"code": "ER_SUCCESS_MATCH"
								},
								"values": [
									{
										"value": {
											"name": "Horst",
											"id": "d8716f14eb40a0764407ff1ca2eea315"
										}
									}
								]
							}
						]
					},
					"confirmationStatus": "NONE",
					"source": "USER"
				}
			}
		}
	}
}
@RalfEggert RalfEggert self-assigned this Oct 26, 2019
@RalfEggert RalfEggert added the enhancement New feature or request label Oct 26, 2019
@RalfEggert RalfEggert added this to the phlexa 3 milestone Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant