question

newuser-72b09820-44c3-40ba-925c-761725a62565 avatar image

400 BAD REQUEST, Using flask_ask and https://db43c006.ngrok.io

Always getting 400 BAD REQUEST.


below is my code:

from flask import Flask

from flask_ask import Ask, statement, question, session

import requests

import logging


app = Flask(__name__)

ask = Ask(app, "/")

logging.getLogger("flask_ask").setLevel(logging.DEBUG)


@ask.intent("matplotlibIntent")

def get_facts():

facts = "bangalore is the best"

return statement(facts)

if __name__ == '__main__':

app.run(debug=True)


ngrok ID:

https://db43c006.ngrok.io


Error:

raWxsLmVjMzQ4YWU2LTlkMDQtNDY0MC05OTE3LTMzMTc0YjJlZDhhZCIsImV4cCI6MTU2OTI1MDI1NSwiaWF0IjoxNTY5MjQ5OTU1LCJuYmYiOjE1NjkyNDk5NTUsInByaXZhdGVDbGFpbXMiOnsiY29udGV4dCI6IkFBQUFBQUFBQVFBRXEyU1M3YTNScHlrRkhybStiSnNzS3dFQUFBQUFBQUQ5OE1XVDlHRnJTaDFRdUNlaXFtbXIrR0h0UDN1dU5rUmVHL250L1p6WXQwQkUyeVd1SEp5U3lNVVNSV21TelBFSi9OUWcydzRZN3NackxqZ1orSW5EUllwTi9hY3Y4SDE2d3RydGpidk15Y3BvWjE3b05YblJ6azBNK01FSVB1VmEyUmtuUWZKODc2TjNMVEJ3cjZuWHIrbUJ1QVRpSFVtNnhxUDJaQnhGYy9wcHRYa09xTWo3QW5QbmZ0WEQvYUQ5ZUUyMmFQcW1OUkt6NDdHdHJxc1VvbjJjMjBYaE9vT0FpNmFONlVqMHAzOG1kOGJFWlpyQlRDRkdFRzdGSXBCZVZoR2R1WkwzL3hvbFFzZitLeERPalRKWDBFZjE2Ujk0TUdOeVNzV1dadmNVUW9vL3Y3OEJ4VkFjb3BhZjdLMVIxR1pGTnlxbG1BR0FmMVFxS1ZpQTNqeHlWeG9rczhiMkx0eENDemEzVjRnY2Y3K3U5eFQ0VitxZXZDTFNWemYyRk1jMHBGeDdKNi9TUGc9PSIsImNvbnNlbnRUb2tlbiI6bnVsbCwiZGV2aWNlSWQiOiJhbXpuMS5hc2suZGV2aWNlLkFIN0NBVVM3WkMzQlRBUDI0R1FBNUJLM0lXVk9aNlFaTFU2RzZYUElXRVhKVUhYVU5ZWFE2UVk1SURESks0VDNHSFRLMkxDRFBKTkxHN0ZLSElIUFpYSkdXSFBWR1dKRk9WV0IzWjNQR0cyQlhUNlpSQkVSQ0RaUDZDU1VVQ09ISDVNQTVZVEhHQlc1M1BWVUlCNUZMSkhFMklRU0s3UDRMTk5KV0s3NllOS0pEU0dHSzNET1kiLCJ1c2VySWQiOiJhbXpuMS5hc2suYWNjb3VudC5BSEVMTlRBR0NHVkFCTlZXNjZVSE9YUzNZS1laUVVNTDVJUkdRQkRBTlJORjRUQk9XNVNIMk1SU1MySEFFR09TUElQSjZDRFlLUUFXRlRPVVRFWERGUFZHTFlZWTRCQ0FKNVFXNUNUNjZJR0taVlJVWkVTWUhaQkVGQkxaTkJNWjVNTjJERUkzTlM3NTQyM1RUTUJJUklUT1Y2WUJLUzVTQ0RaRjJRUlJCMlROWURLV0RZV1U0TjVBQUxESk1aQUxHVEwzVEFKRFJSWVhTQ1kifX0.Ag6lJsFXsSD4casMEuA6Z4Qdbpy4rItBzTzx9Z1B7aC62MxBQkzVKfCaUufjoJ8fQjAl2ibUAQtC8G_Ap-87jpfWnvmSzyzVaYCNBHLEGTRBK30XniNCU3PI1V20kdWm-lC_uorM1Q_FO9xHeY3Yz5uH0zEawY4Twrl-VSRPNdEbHoX30Ie2l_rh9CxfP7jh0EYAxt0zXQjCuox-lwn4Hg-zweLZP5D2Wv_ynh2g5HI0wgbLbRNBE3929umgKRKYtUYDFufpMKdvQqDPJRYCvx81Ki0vs7upMDMC5sBm7HFedoOMMivrm8zSy3EY9BVGP4rDTl7UldteDkca3JCDZw", "apiEndpoint": "https://api.eu.amazonalexa.com", "application": {"applicationId": "amzn1.ask.skill.ec348ae6-9d04-4640-9917-33174b2ed8ad"}, "device": {"deviceId": "amzn1.ask.device.AH7CAUS7ZC3BTAP24GQA5BK3IWVOZ6QZLU6G6XPIWEXJUHXUNYXQ6QY5IDDJK4T3GHTK2LCDPJNLG7FKHIHPZXJGWHPVGWJFOVWB3Z3PGG2BXT6ZRBERCDZP6CSUUCOHH5MA5YTHGBW53PVUIB5FLJHE2IQSK7P4LNNJWK76YNKJDSGGK3DOY", "supportedInterfaces": {}}, "user": {"userId": "amzn1.ask.account.AHELNTAGCGVABNVW66UHOXS3YKYZQUML5IRGQBDANRNF4TBOW5SH2MRSS2HAEGOSPIPJ6CDYKQAWFTOUTEXDFPVGLYYY4BCAJ5QW5CT66IGKZVRUZESYHZBEFBLZNBMZ5MN2DEI3NS75423TTMBIRITOV6YBKS5SCDZF2QRRB2TNYDKWDYWU4N5AALDJMZALGTL3TAJDRRYXSCY"}}, "Viewport": {"currentPixelHeight": 600, "currentPixelWidth": 1024, "dpi": 160, "experiences": [{"arcMinuteHeight": 144, "arcMinuteWidth": 246, "canResize": false, "canRotate": false}], "pixelHeight": 600, "pixelWidth": 1024, "shape": "RECTANGLE", "touch": ["SINGLE"], "video": {"codecs": ["H_264_42", "H_264_41"]}}}, "request": {"error": {"message": "An exception occurred while dispatching the request to the skill.", "type": "INVALID_RESPONSE"}, "locale": "en-US", "reason": "ERROR", "requestId": "amzn1.echo-api.request.dd12dc4a-e138-4ec0-88f3-185dc0a26781", "timestamp": "2019-09-23T14:45:58Z", "type": "SessionEndedRequest"}, "session": {"application": {"applicationId": "amzn1.ask.skill.ec348ae6-9d04-4640-9917-33174b2ed8ad"}, "new": false, "sessionId": "amzn1.echo-api.session.91e85a42-eb40-4fb9-968e-e4395e023410", "user": {"userId": "amzn1.ask.account.AHELNTAGCGVABNVW66UHOXS3YKYZQUML5IRGQBDANRNF4TBOW5SH2MRSS2HAEGOSPIPJ6CDYKQAWFTOUTEXDFPVGLYYY4BCAJ5QW5CT66IGKZVRUZESYHZBEFBLZNBMZ5MN2DEI3NS75423TTMBIRITOV6YBKS5SCDZF2QRRB2TNYDKWDYWU4N5AALDJMZALGTL3TAJDRRYXSCY"}}, "version": "1.0"}

alexa skills kitalexa voice servicealexapythonalexa simulator
2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rokas avatar image Rokas newuser-72b09820-44c3-40ba-925c-761725a62565 ·

I am not python guy, so I am cannot really help you with much, but most of the time "An exception occurred while dispatching the request to the skill." error means, that something is wrong in your code. Maybe an exception is being thrown that is not handled? What I suggest you to do is to double check the code and make sure that it is 100% correct. Maybe try running an example first, before customising it.

0 Likes 0 ·

0 Answers