-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add Facebook attachment upload api #899
Add Facebook attachment upload api #899
Conversation
Is this the same as #870? |
No it isn't, the aim of #870 is to allow to the user to send a local file, audio, video or an image instead of sending a cloud hosted files, for example if i want to send an image : with Botkit today : controller.hears(['doIt'], 'message_received', function(bot, message) {
var image = {
"attachment":{
"type":"image",
"payload":{
"url": "http://CLOUD-HOSTED-SITE/images/image.png"
}
}
};
bot.reply(message, image);
}); To allow Facebbok render the images, we must provide a public link in payload.url, but what if i want to send an image from my local /User/Doc/images folder ? With Botkit + #870 : controller.hears(['doIt'], 'message_received', function(bot, message) {
var image = {
"attachment":{
"type":"image",
"payload":{
"url": ""
},
filedata: FILE_FROM_LOCAL_FOLDER
}
};
bot.reply(message, image);
}); In this way, FILE_FROM_LOCAL_FOLDER can be a file from my /User/Doc/images folder. Furthermore, what if i want to upload an image that i can later send out to many users ? in this case Facebook Attachment Upload API is the answer, and with #899 Botkit will be able to upload (and just upload) files (audio, video, images ...) to send them later. |
examples/facebook_bot.js
Outdated
access_token: process.env.page_token, | ||
verify_token: process.env.verify_token, | ||
app_secret: process.env.app_secret, | ||
access_token: 'EAAShWXeInZCcBAGD9z7ffW3Dmflwh2X8otTTH1R1OzBniNe6vQPyGduijVwk68Of3r1nZAVte76LdQ00P2qSCQip5hbnqxpaGZAFEibAiDZCHHd3JE0caYzD3cHP7U3rEnSSghMcTITCesrgsWWDhT6SyF7dl5HwJINvht0HFwZDZD', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @ouadie-lahdioui can you take out these actual keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something is wrong with examples/facebook_bot.js, i will clean it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
👍🐙🍻 |
Hello,
This PR add Facebook attachment upload API to allow us uploading an attachment that we may later send out to many users, without having to repeatedly upload the same data each time it is sent.
🍺 in honor of @jonchurch 🍺
Enjoy,