Am able to send image or Card back on /webhook route because sender is included in request object. But sender is not included in /ai (fulfillment webhook url).
request({
url: 'https://graph.facebook.com/v2.6/me/messages',
qs: {access_token:token},
method: 'POST',
json: {
recipient: {id:sender},
message: messageData,
}
But, my fulfillment route is /ai and the REQ body does not include the sender, so I always get this error where trying to send back anything but just text.
Error: { message:
'(#100) Message cannot be empty, must provide valid attachment or text', type: 'OAuthException’,
Presuming you're using the NodeJS client library with Actions on Google, after you identify a user's intent, you can send an image in the following manner:
For more info on getting started with Actions on Google, check out Google's codelabs,