newuser-496caf1c-d471-4f2e-88cf-7766c2081b93 avatar image

How to upload/download documents(.docx, xlsx, txt) on Alexa skill kit

Can we prompt on Alexa chat to upload documents like .csv, docx, xlsx, txt etc.? So our code at back end will receive the document and can perform analytics on data provided in document.

It will work like below.

1. Alexa open DocumentAnalytics

2. Alexa will reply and ask user to upload document. For example in Foodpanda app when you are chatting with chat bot it asks to upload the picture of food while complaining.

3. We can upload document within Alexa or Alexa redirect user to some url for uploading the document.

4. After uploading the document Alexa will say Document upload is complete.

alexa skills kitalexa
1 comment
10 |5000

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

I am not sure I understand what you mean by that. Can you give an example how should it work?

0 Likes 0 ·
newuser-496caf1c-d471-4f2e-88cf-7766c2081b93 avatar image
newuser-496caf1c-d471-4f2e-88cf-7766c2081b93 answered

@RokasV I have added details in question. Let me know if more information is needed.

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 answered

Hmm, this is not a classical use case, but maybe it is possible to achieve this. So basically, yeah, you invoke alexa skill, which from backend should redirect user somewhere. This bit is the most mysterious to me, I don't know where are you going to redirect user, how will you know which user to redirect (maybe with use account linking?), but alexa as a service can't do this, you'll have to code this bit.

So let's say user gets redirected. Alexa cannot keep her session open forever. There are constraints. It works like this: speech -> listen 8s -> reprompt -> listen 8s -> exit

Still that doesn't help, because you would have to ask alexa 'is file uploaded', because you cannot push speech to it on some sort event. The only way I can think of is to use notifications. So when file upload finishes you send user a notification: docs.

I would approach it this way:

1. Open alexa skill, which gives you instructions and somehow redirects user somewhere and close the skill.

2. User upload the file which after done uploading sends and event to lambda, which sends a notification to the user indicating, that file is uploaded.

I am sorry, my response is kinda random, but I cannot offer any more concrete advice on this, because it is not a classical alexa use case.

If you have any suggestions that would make implementing this use case easier, you can post them in uservoice alexa webspace: here.

10 |5000

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