项目作者: kartikag01

项目描述 :
Facebook Chat Bot Client
高级语言: JavaScript
项目地址: git://github.com/kartikag01/Facebook-Chat-Bot-Client.git
创建时间: 2017-04-11T11:37:48Z
项目社区:https://github.com/kartikag01/Facebook-Chat-Bot-Client

开源协议:

下载


About

This is a UI Library for Facebook Bot.
Test your sample json and check its view without setting Webhook

Supported Send API Reference

Type these sample json on left side message panel

Content Types

TEXT

  1. {
  2. "message": {
  3. "text": "hello, Developer!"
  4. }
  5. }

File

  1. {
  2. "message": {
  3. "attachment": {
  4. "type": "file",
  5. "payload": {
  6. "url": "https://petersapparel.com/bin/receipt.pdf"
  7. }
  8. }
  9. }
  10. }

Image

  1. {
  2. "message": {
  3. "attachment": {
  4. "type": "image",
  5. "payload": {
  6. "url": "http://thiovan.com/wp-content/uploads/2017/01/javascript_banner-660x330.jpg"
  7. }
  8. }
  9. }
  10. }

Templates

Button

  1. {
  2. "message":{
  3. "attachment":{
  4. "type":"template",
  5. "payload":{
  6. "template_type":"button",
  7. "text":"What do you want to do next?",
  8. "buttons":[
  9. {
  10. "type":"web_url",
  11. "url":"https://petersapparel.parseapp.com",
  12. "title":"Show Website"
  13. },
  14. {
  15. "type":"postback",
  16. "title":"Start Chatting",
  17. "payload":"USER_DEFINED_PAYLOAD"
  18. }
  19. ]
  20. }
  21. }
  22. }
  23. }

Generic

  1. {
  2. "message": {
  3. "attachment": {
  4. "type": "template",
  5. "payload": {
  6. "template_type": "generic",
  7. "elements": [
  8. {
  9. "title": "Welcome to Dexterous",
  10. "image_url": "http://www.wpwatercooler.com/wp-content/uploads/2013/08/cowboy-coder.png",
  11. "subtitle": "We ve got the right hat for everyone.",
  12. "default_action": {
  13. "type": "web_url",
  14. "url": "https://peterssendreceiveapp.ngrok.io/view?item=103",
  15. "messenger_extensions": true,
  16. "webview_height_ratio": "tall",
  17. "fallback_url": "https://peterssendreceiveapp.ngrok.io/"
  18. },
  19. "buttons": [
  20. {
  21. "type": "web_url",
  22. "url": "http:/dexterousapp.com",
  23. "title": "View Website"
  24. },
  25. {
  26. "type": "postback",
  27. "title": "Start Chatting",
  28. "payload": "DEVELOPER_DEFINED_PAYLOAD"
  29. }
  30. ]
  31. },
  32. {
  33. "title": "Welcome to Peters Hats",
  34. "image_url": "https://talk.openmrs.org/uploads/default/original/2X/e/e5ee1282b1a90eaca3af2f3ecd0a94c84a651c35.jpg",
  35. "subtitle": "We ve got the right hat for everyone.",
  36. "default_action": {
  37. "type": "web_url",
  38. "url": "https://peterssendreceiveapp.ngrok.io/view?item=103",
  39. "messenger_extensions": true,
  40. "webview_height_ratio": "tall",
  41. "fallback_url": "https://peterssendreceiveapp.ngrok.io/"
  42. },
  43. "buttons": [
  44. {
  45. "type": "web_url",
  46. "url": "https://petersfancybrownhats.com",
  47. "title": "View Website"
  48. },
  49. {
  50. "type": "postback",
  51. "title": "Start Chatting",
  52. "payload": "DEVELOPER_DEFINED_PAYLOAD"
  53. }
  54. ]
  55. }
  56. ]
  57. }
  58. }
  59. }
  60. }

Quick Reply

  1. "message":{
  2. "text":"Pick a color:",
  3. "quick_replies":[
  4. {
  5. "content_type":"text",
  6. "title":"Red",
  7. "payload":"DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED"
  8. },
  9. {
  10. "content_type":"text",
  11. "title":"Green",
  12. "payload":"DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_GREEN"
  13. }
  14. ]
  15. }