Not sure if there is a better place for this...
Ideally the API gateway would be enhanced to support sending binary response bodies. But judging from the forums, looks like people have been asking for that for quite some time. Possibly this is an easier, more palatable change.
I would like to dynamically generate images to include in home cards in the Alexa app. I have successfully created a lambda function that invokes a C program I wrote to generate a small PNG based on user input. I have the lambda function return the PNG as a base64 encoded string.
But I cannot get the API gateway to transform the base64 string to binary data for the HTTP response. Doesn't look like anybody else has managed it either.
So I can think of two options. The easier one would be to avoid the API gateway and have my skill return data URLs in the JSON for the home card. This works fine, except that the Alexa app throws an error and won't display the images.
The other option would be to write the data to a file on an S3 bucket. And I'll probably go down this route. But since I don't want to persist the images (after they're displayed in the card, they're not needed), I need to implement some mechanism to go through and delete the files so the storage doesn't grow unboundedly. Probably do-able. But the first two options would be a lot easier.