{"_id":"messaging-api-messenger","_rev":"128-bfcfa9503bc475080c774050fe030685","name":"messaging-api-messenger","description":"Messaging API client for Messenger","dist-tags":{"latest":"1.1.0","next":"1.0.0-beta.34"},"versions":{"0.1.0-1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.1.0-1","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.1.0-1","scripts":{},"_shasum":"5b4d4dfb1c84d44b9c3699e4064572aaca3bb064","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"dist":{"shasum":"5b4d4dfb1c84d44b9c3699e4064572aaca3bb064","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.1.0-1.tgz","integrity":"sha512-3opQB5yo9OG52zxgPYwSEwTu3+Clk+ANqU0C7C53VeOthqqu9MzOz//7eh3HH6eOjykXfXcxIus4C39969oP5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClLTUgS72OHLk4i4RXJUdC8DXJ7gqz7tt4Y6hAtmSgnAIgU8I9s5p4CxqJl+pEw7ZBWO/apWQeoRyB3zndXYFNTNo="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/messaging-api-messenger-0.1.0-1.tgz_1494481504130_0.5749655240215361"},"directories":{}},"0.1.0-2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.1.0-2","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.1.0-2","scripts":{},"_shasum":"31ce492375f3589738047e70622e7ef12e406e55","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"kpman","email":"s92f002@gmail.com"},"dist":{"shasum":"31ce492375f3589738047e70622e7ef12e406e55","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.1.0-2.tgz","integrity":"sha512-J7BhmwxsY6+N1QYjDnEIpcFrPx8MRY0tHXhDyMXXFaw6mz8GYPPJMo+B0HBvJLzQxOSLbIcs9UIC8Aptn1Pq/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLMCF/7FVQGRVrRtK74YNAwxMGnVnZqDg8ANqwz8XyawIhAOHXziCVrgpBCffERFCRaNCa1D6qzqYF9BW1p0zlgxtd"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/messaging-api-messenger-0.1.0-2.tgz_1494584342030_0.3862760183401406"},"directories":{}},"0.1.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.1.0","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.1.0","scripts":{},"_shasum":"8394cd058fd6726962857034377474b3ccd6f4ea","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"dist":{"shasum":"8394cd058fd6726962857034377474b3ccd6f4ea","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.1.0.tgz","integrity":"sha512-h1wm0zk5fiaPlr9Q4Q6LRtfu4yXgEUkHpwHrerldeDJ+RGvSP9dBue63z4XnAF9eR+9dwVAPoDzN3/RqkW6YzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHRFGY3Ut+DBQDMblaRcfEm9WAAz64oSuQx/ADSdsNYgIhAO2vUuRx2hvO9CB5fANEnttRdIGkCHTlI4XD65O3u05V"}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.1.0.tgz_1498053770940_0.3449500370770693"},"directories":{}},"0.1.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.1.1","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.1.1","scripts":{},"_shasum":"a15ff81d3e6b115daed71e0a0f83e82c124be975","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"dist":{"shasum":"a15ff81d3e6b115daed71e0a0f83e82c124be975","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.1.1.tgz","integrity":"sha512-Oe6JPh8bMPIpLB1pPLhaqsHgtNftswzXw+RtchpbhBYxwbXGzYDW91uqlQZWWFgY2uCnC35erBLPeU2rppBE6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7xm9ocdOdiFy7qdoyNwotm/g/ZJ/4/ZwOICo3Ip2TDAIhANO79jp1HQfW+7ZheyjMSrFwKFecaW3+mmUIHTq/wshT"}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.1.1.tgz_1498117420253_0.7740317406132817"},"directories":{}},"0.2.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.0","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.0","scripts":{},"_shasum":"f1b639aea44c71bf50f0fdaaf5b228d008fc4ad7","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"dist":{"shasum":"f1b639aea44c71bf50f0fdaaf5b228d008fc4ad7","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.0.tgz","integrity":"sha512-QwcYl5aLCy/kIAUYOfEytuYhu/BQmh+jg82UIQdR5b6ULkQ3E0obwypCebFJc9B8VW4sbKfDu775+mCCJneLXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAMKCp83YWIjFunaL9+XMZiSYjTi6y5cjz64kyCocBN5AiBNx9PqGqi5yoxbHmZQcPtr57JM++NEhcGH8xbeVIFsAA=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.0.tgz_1498723683457_0.16664306493476033"},"directories":{}},"0.2.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.1","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.1","scripts":{},"_shasum":"b47493344ea249c552ca22157e9c0a65728c67fd","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"dist":{"shasum":"b47493344ea249c552ca22157e9c0a65728c67fd","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.1.tgz","integrity":"sha512-KUf4b8xjnsurGows2C4cQqXfJ8Hgs6Qk5yX4Ev03Df6C894AmBupfvFogO58EaHWe+/6TESX/WloZ3tXt5KDww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFIMLduvFzTmc+aZOD5QJCkFKfDobEnmewrqD+et0Q2AiEAvFIPlDUabzAh6ssFyeP/3eYkh62OA9h/ba4uz1MSS8Y="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.1.tgz_1499317638099_0.934784796088934"},"directories":{}},"0.2.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.2","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.2","scripts":{},"_shasum":"512f1f55528b854f9b27e94ff4d9196254b19c5f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"dist":{"shasum":"512f1f55528b854f9b27e94ff4d9196254b19c5f","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.2.tgz","integrity":"sha512-+0hODPmp1JtVdQ4WBl+U97Mgw8NTgClan1OIdvMACTaRQSpGG+z05H4e9aDsuTWaizZCdcpUq+BJWLfehqij2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICZJr0rB5UeT2YY13Q9OlKpWvnvWAVmJU84yq8/NqmdSAiB9SEOylD/15wGnJTSIRm88npiK1Kmc71XIH9redxzqqw=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.2.tgz_1499741073066_0.4375577066093683"},"directories":{}},"0.2.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.3","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.3","scripts":{},"_shasum":"c4f0e5fd2e2f6be550b622a7089aeeeb83fa3290","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"dist":{"shasum":"c4f0e5fd2e2f6be550b622a7089aeeeb83fa3290","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.3.tgz","integrity":"sha512-TFG4frW50Xyrsog86JMNpIa93ctNKSSgen6JMGPmgMR3L+R+DXRBbpbQFjtyAGFvgBZmBBXTdaTOCpPhyizKgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF5PwtKuXyD4rwvim2fJbTR8Xbym5mQ2MJtz9HnEneleAiEAwVBMzlG8lBAabl0jGJFxoOXCxysbHY12RN9RN7qfzqo="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.3.tgz_1499927735979_0.07849278277717531"},"directories":{}},"0.2.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.4","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-8psnmBVQSn24qSoEzYznQVKBhZ/86TJbVG9La9kmLoj7nz9134rF961tOYj931F/tuwu8YPcVYo4xXN2uFkJ0A==","shasum":"2de2a73cdf507ece69eb25e14f8e29b0ee68cba4","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcQVkKWE9eatacZi+EryiA9t8vZfka3Gj5Ehuf/AcpVwIhAP3RjLIELbgQlAedExE2KjNd5CL0dQMcMaRHsWjwPDCV"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.4.tgz_1501661720782_0.1816507640760392"},"directories":{}},"0.2.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.5","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.5","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Hs17D5+PxSdpeJxHLJ+H3Rl7iBdKE6Yr42aDJjLKlJ4ldqK9dvIiijl0Ar40EmW0A54ZrJGumt2pJATXxDhOQA==","shasum":"ef15c806084e4d6f3563c1e741d469f57a737cea","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfjIiR5TyYa0E5IIplfqjXIKC5Cc1cSHPVEbKzWzEK2gIgSoV8RLrYp0Ih3cpFVMIenJNDKXxOeGBqKTL2zdJJqsk="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.5.tgz_1502266181540_0.004975821124389768"},"directories":{}},"0.2.6":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.6","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.6","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-xlF4wphUp8suCKHlT3UyIB8mwiixTR2QATqw/DB6f7s1b+Zi6QbEhQMkle6iOHLnbCRxYgc5dDDczKnfH7brXg==","shasum":"19312c484a174b8223a45b6120891ea7c51cf986","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmV3XwgRrIanORYWVYCq7xTxr73GWlXOX9xZrUOyO7+wIgEWmFoNn6i0rFsJYQPcAdPIo+m9Tcgp9Dw1eRc0SEGI8="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.6.tgz_1502695621681_0.6831374131143093"},"directories":{}},"0.2.8":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.2.8","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.2.8","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-7kwQsziRZ4YwMmksvJcE+ch9vmbf4B5v8tnellC59eHXL+eNSqmke/ScLfipivhBpMWfnc3omfPB09HpM06TiA==","shasum":"ad3a107e77d2f2fe0524d7a512b949ad26f16c3c","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.2.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCw7gTHQ85gGeQDnjf0GY82WH2GAFvGbYqIXsf3cECvegIhAPW5m9NcD+6q9juBvr0IWjH1SYI57lwdurS7uzcFWztr"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.2.8.tgz_1503653996221_0.8626849032007158"},"directories":{}},"0.3.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.3.0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2","lodash.omit":"^4.5.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.3.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-+Rn72ybuwub8aCo+GvvsAw9fK7Cmyg5LNt3U8h9ZcKKkJobmpwfMvELyJBpCyUlX+K/6NYBIZTiRfnRtegLByg==","shasum":"b682f6a5b17d0c492a9fabeb4211dd340aa0326b","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8/gcpxO+W43HYPUfI3mKcaRUaZqek9T6eLxOv+zA87AiEAsKANNq/yL6PZgjp/1qeNR/oxNbIKrtqMd/qCneBPg3U="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.3.0.tgz_1503992208540_0.3077707220800221"},"directories":{}},"0.3.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.3.1","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.3.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-AjNuXqSkV1htrp7ZHpfHxJMkXqH9KFbKT6QU6aGQCaNrlS7z4ccWrcPKsBh5yqNouFxovz8oO5cwvgnxU9oXgQ==","shasum":"4cec8c06e7006b407360ed96aaf34197804eaf0a","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.3.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnHzAcBAM2axmsHvg6Yav+l1xGbTRLvNvLeLw8oS/VrAiEA8mPsI9UURkCZS6Rw1jnYLoVD81y6PgLDBsaUtsyhOfA="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.3.1.tgz_1504168682302_0.16131761646829545"},"directories":{}},"0.3.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.3.3","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.3.3","_npmVersion":"5.4.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-fbryh8V0LzVk2tjKJK7xs3fKszbHBAptaEBvFcOWwLmb2GrsN16wqFXO8yA6gHrWlJ/XmTsM6Nx+MZS8DqT/cA==","shasum":"cd64f662d21af410e94e50dc166bf0ef1047e431","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.3.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4M8ad5Qgbpsk1Xy7OyzOl96wS6+FahY0F4qTjnKiamAIhAKE7QxmenCC3F38RlSHVrvDrK1qzoj9IJ8RNNTPoC8AJ"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.3.3.tgz_1504770548592_0.1252396374475211"},"directories":{}},"0.3.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.3.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.3.4","_npmVersion":"5.4.0","_nodeVersion":"8.4.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-MJyRMnLHkijZxP9Hts+TVqqef6RI8EX+l5HOefgCgq86FxXj1ungToNn2uPCPBcHezaYxOA6mWFClaiyQXDQ0w==","shasum":"d15b04d7142c8f898ff1b48e2728e7d621a0c297","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.3.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDrIQD1N4uI7XIow5Arxv/s/R2Uw7vfg6xM1WEWtC2OeAiAMTLzBhHEYuwov5K9L7EqkmSdJl0TvJarz9cOdPD1wqQ=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.3.4.tgz_1505297683348_0.8435857524164021"},"directories":{}},"0.3.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.3.5","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.3.5","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Ts73Pwy1dEB0n3QejaiYojFAwpwBH7EleCyc7R7As47tlHqwBIbkT2eNKuURVTNCJLVkVOHSA8F0rtexfRR1Hg==","shasum":"3b5b8a960f5ad6c3c9568c82998de3902e720fa2","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.3.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5oQIwYTPszRehwbSw8fCwpvskrc88tSKjgjmS229LKAIgd/Dil0O28MBKCug33uPJQ08r7kT5xT7p1i641TlFfto="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.3.5.tgz_1505405718072_0.40966018941253424"},"directories":{}},"0.4.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.4.0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.4.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-gNMQn8fIPRVzdfADIe9zCMdUpx5JToFTRMnNw7oGVdmBsbQ7rIhcO8hHW3DPttcmB0BIOH7gBzcx/lLO2WiqCg==","shasum":"f69f34311f9fbca73fbfa9b848337a719463b4aa","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.4.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzc2tn3zNyBpdzFsPGUNYUF6KibTucMfdjQcW8XG9UFAiEAusL57b15sBX0Y2uK7a5pTc/29OBbF6fnDZmGVvcOgeI="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.4.0.tgz_1505817920376_0.9076520360540599"},"directories":{}},"0.4.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.4.1","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.1","form-data":"^2.2.0","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.4.1","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-thrs0Brud+7QGQMQWb2vhkSMi3k5JemxFctPTkbNA+4d174e/aUY5XyncCIOK4ofUryhEPjG9DASb+lOD0KCCg==","shasum":"b6aa79e405077fd999203595c4b77629ab3ec2d6","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.4.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDE4RXSDMzn+a0rE8A3mYowzvXzQp/Dta2NeETqWlJpAQIgKlHx5RFmZaHBEruMitRmWt+R8+58GNkjFlzDCBLJGqA="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.4.1.tgz_1505819880186_0.8827878858428448"},"directories":{}},"0.4.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.4.2","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.4.2","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-TaUtgADPGzDdXqjVtft4kmTzFPqiwJvtev7zN7PJnMfVH4haA3G21CGUyOyxNI+WGAVH5iYECVpNtAGQ1yEJJw==","shasum":"da3b8e88a9486847c49c2f4d0275f941ff4a2df3","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.4.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCT+ij25bn9qo0MBD7pQXeHC0o+PEWNwOT2r81zWPIICAIgXCcNA2BmsyhSRbncOTrRq6mzX0IENhCxNBWW5BKLjNI="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.4.2.tgz_1506044612663_0.008937139762565494"},"directories":{}},"0.4.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.4.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.4.4","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Qj2A0NLVWE338vUPYvhkm3ayUsl7T0tmSFKE6LwBCIh29/3T3i7yfDEywQsWbX3dUml97Ciq4aJIBxFn6JydRw==","shasum":"f1806da3d1951c3ebb03cbafd813b7346ac6330c","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.4.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGKjwaOBr8lPC7VgMr7NkhWheyFEqBYKfCul0Jh2HhkQIgeQe3OsSJb9ea0I2nbkdDx72RODcYCWSHdz84SL770Rc="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.4.4.tgz_1507709003720_0.10300820111297071"},"directories":{}},"0.4.7":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.4.7","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.4.7","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-7W75q/7+LyjxIQO4UnIvYzbROhTsL9g87A3iq/htLcqh+U7DSH9RqWKu2KuPNJYrUL9YPA1YAz71UpSxirp8bQ==","shasum":"d6b09998bbdefb478e913023cf0b448f0a415355","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.4.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4h8vkIGlREj0YP9qCa4of6ZhKaNOIeF8HSOCbiKFkVAIgIEnIKZ2yvVTKIZsRyRfZT6imH2a8hr6y+OD2yzg5fHY="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.4.7.tgz_1508140911938_0.7290875744074583"},"directories":{}},"0.5.0-0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.0-0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.2","axios-error":"^0.5.0-0","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.0-0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-2micqYiTGHiN316TBnCYds0yW266r30NmcMlMMASEVXEyV1syD4sO7Z4Xbtx0cU16mRClkuFs6NP0x0aYq0K5Q==","shasum":"e868db4d008e5040c7254016e24c769ea94ad9c4","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.0-0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhJWjz8Q0l35Ff09guaW3oDNA9HMlg7Fz2faPm3CrtDAiAyG/8PNKh2vtMk3/UnmBJ4HbcXLToVv9Y1PjqgHf9MlQ=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.0-0.tgz_1508482617232_0.572759869042784"},"directories":{}},"0.5.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.2","axios-error":"^0.5.0","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-PL8f3Wf1qBH+tG9Qh8kD+ThkzoROoXFetAo1DgdNaAjhF5G1nZGxaQU6OF8TJ5PU27V5/XSsL1TkfSvtKPZe0Q==","shasum":"0faf20c9f5f93db816119b23681b67ff0b6e4741","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo2oAtOVAxQ3tRByVYgjcYzx3SQgUbCvEV/nld4Z1ArgIgevI6ZN70D5DJEwCIfi4Mt4xpqQzd7K002KNJpBf+1iM="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.0.tgz_1508483918157_0.7850585747510195"},"directories":{}},"0.5.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.1","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.16.2","axios-error":"^0.5.0","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.1","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-tdpzFPyct1r2b6+K8VjjYX+Tl7FUWN3S9tQTDBjMUQqBN1i0tmIJwIKi8e7KMkpxaAyNSr+jyxbYzzs6mUsspg==","shasum":"4be7b9b2a757ebb2c3aab86abf7e64e10e3dc8f8","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFyA2OF8cMRBFsvmgsjzZMuaHHz5sxvRI6InwzPCg0psAiB05J+RyZagNWNEs0F6ZwwBeIaLojJfG+VfWjrpRAArPw=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.1.tgz_1508932846886_0.8972008968703449"},"directories":{}},"0.5.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.2","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.2","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-04xVmYfi9oNyyUfcyTfIzjUKCM7iswIt8jCY7+bmhRSg55WA2nuwq9mjHFmtttZDDmIejTigC41oMojdAnOK8Q==","shasum":"fd5d5b1679a65b0833dec7ed8455e6d84cadb962","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMS+iHHgHPQFWkXVsEZb+RRvgfy10+9T3AadhOjwF32QIhAJKgEvxHF2z4F9elK440brA2zoN2WQmHvJH/RjgNMHIG"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.2.tgz_1508990949778_0.33095297939144075"},"directories":{}},"0.5.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.3","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.3","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-2ItMhG2DLHvK/Br8obThxubZ+BjW/ZmT4o4FWaPNp2dgFBaBVCcck7n1Trpd4XY6b7Bh6AZdQuLLtd983vmSUg==","shasum":"85ac1ec65f9c49bbc7f86929551bf06b56eeb71e","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGD1GTcptMqOigthnpWighnm3YjNlB2msLMZ1JX/LDMIAiBns5KpUeOjEBkyO8Z5x6kMk/iCGPsSP21zNvSMCZok0w=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.3.tgz_1509003057636_0.6506974704097956"},"directories":{}},"0.5.4-0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.4-0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.4-0","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-ENz2lQ9yxMHjV4iCw0QPsHBWATeJ2BgVOG5i3Ql3AxCXekqGnd9ILZCVOAx7IVRu45e4U8cE5htw98HzDU4UVQ==","shasum":"3282aba56d07f754bc6765747923fab3b3ae79bc","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.4-0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCysSAIr1vp7SG7e7hJ+JDTrJuhIY/aUsVD73jpsFvBdgIhAJy89DckENW1Dx0xHqKYS5iKooFv4Khz7oJ+4GPIBRSv"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.4-0.tgz_1509338501220_0.12667350750416517"},"directories":{}},"0.5.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.4","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-IaFaztK1ldEphTNEY3Pd4Xoo62C4Q1bKoOyNKRg8hd26G4yT9t9DO0ygfmLFbvbXogCU32iPn7GnGynEynkTmQ==","shasum":"fe4108c422fe670aa5fec3ff145438dbe0ddf13e","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMECbCoQJImd1wsn5KjRoGqPnFK28/6lMvxJzZvnvW1AIgIjzGzhUIARyhvAvfa/lHKpY/Hyz4bX3ixrWjNEdGBMo="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.4.tgz_1509341097830_0.9946840549819171"},"directories":{}},"0.5.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.5","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.5","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-VT+dc4/r2OxEzkdoyuZm7lOhKLfZuofO69Hub5ispqPXJiG67AokoCWOlU+HJfZEWi2u/zcvYOHDJJUPpuDS4Q==","shasum":"54803f7383bb751172ff32ae9267133c2f1c7674","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4NVDC5fBlKk2duY2KG//nTkTrs42+Toj81qxfmt/XjgIgf+h0sMsVzB/WE7kumfUdOIt5kRRIHLWgqhEVRtemkTI="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.5.tgz_1509525690622_0.7537309660110623"},"directories":{}},"0.5.7":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.7","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.7","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-nXpnkJKFqYwsYCEB3eIXI+uxMHnpQQ92cG0Zysv1h1boFCg72lqM59TdBxassOg2YhRJU4rlE6DTmPeYEgOB7g==","shasum":"1bac9884c97d8b49fb8edca6af29fa8537448384","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPxaX6oT9KYxP+TMWdS97SYo5VcozjbHdOmj38Ryo7HAiA+MhyoiFbxiI+tZnpW8Llr0AIne2ftW8QV/YvYV7IbaQ=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.7.tgz_1510219996896_0.771945076296106"},"directories":{}},"0.5.8":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.8","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.8","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-CLNve+QfMesz1HiCf/jIZJ0Ea12fil0P8mxSvZZ3B4jUKQq6q25NELYhm2jpLI/K6QS3KdB1N4OYX8lh0dfxrQ==","shasum":"4f7ee6d521ca30dd061a4fc0f6906cfbfac0c585","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDNcSvXfPGIy6NjnMnaLSHea6bs3QTUtSmXgez6g9BP0AiAh+DLoV7gHsp04sKEVaECjvqvUoA4hMW3HTHgNnthQHA=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.8.tgz_1510553551231_0.5219503298867494"},"directories":{}},"0.5.9":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.9","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.9","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-DnpNsNSx881CvSe2bQBSFp2sxenQ7m7Umu73VQkYqsu7mIDAlSL65rxmdWCCPGnEbYJmLQRrldybBSofOvQ79g==","shasum":"6f11c7de09ef4539417dc8b55ee7522eeb407d45","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.9.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFHq8bHjSkzzTS/C/+oTni8D/MJOVFWp0IKQPOWZLUEYAiEA5e7tR6dbndtdtGCpxaL0h9Zvpxvf5Vqj6GxtNdVxtzw="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.9.tgz_1510726550845_0.8080280323047191"},"directories":{}},"0.5.11":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.11","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.11","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-jG4C2VwLmi1TrPCCLTIipn/DGeOa9k27dCtA3yUgpyL0+pwcc30+4LC+03NRnUNeW0jRRqPEyWh/cueuCfOtaw==","shasum":"424450f2f8d81f5d95417d1fcb4892a015263747","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.11.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChx9xbhAwEtJXzlaIfD5nA9a7JVVcW7j6STIOIgNZ/wwIgEtmeIknAc3LDf2+jYJ37HdJBRdzowdA0r4wErqq7T1c="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.11.tgz_1511337969275_0.9634778879117221"},"directories":{}},"0.5.12":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.12","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.12","_npmVersion":"5.5.1","_nodeVersion":"9.2.0","_npmUser":{"name":"kpman","email":"s92f002@gmail.com"},"dist":{"integrity":"sha512-YFND4G8NzvNnjb9umJtxO1qamaYfnMNc5JY791sPIF6oRIG1QV/mmf6k8Q4xrN+/B+dOU/sXixFXCmcuZMeYkw==","shasum":"f85817caf2ffa18fad6e92f36c589d85d79e9ee3","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.12.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEfDmDbKCiQQx9+bHhidtidY/4Jc4SP7NmnpVjxoEjlkAiEAg/5OM/nuQonIa5e9IZ+sJr57CvhY8G85bmsO0dWNhxE="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.12.tgz_1511433302826_0.10117728426121175"},"directories":{}},"0.5.13":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.13","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.13","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-lBFB2GjXrFv09zvH8DokEmxdLOm68UGaOxm56hjmd/UxlvWq8Z7YiCvRaTBC+REuuSdVZkN55QSQmfiKU5olOA==","shasum":"9a02ba3d05ecceee30300708011eaef973d5e59c","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.13.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqFA/V6QhV06VNpp+EaR6h1TQi5C48tZfGmPUHFnWAYwIhAPaU2xw14sVLmWRtfldiEIorVq/YKIkumTUZMqeBm8Vb"}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.13.tgz_1511869780450_0.1720109221059829"},"directories":{}},"0.5.14":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.14","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.14","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-kdlbjoJAAzOM0ViIEit+hqiQUJm7/nOlhjz6V0vOVIJbfacZZ1CRUkQQgSkpRYxVa305V7YJhq4LvciBAyA4Yw==","shasum":"4f49daee3e28a3d57ee957e44fe873f7af761d23","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.14.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxkfZQbhyro6R9th6VM9fPjvyucDIbb5vBBX8ZuwLTBwIhAPCa7t1g44a/Si2TvWRZtdjKk8I52U3GPbsmSmWHFSFb"}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.14.tgz_1511949899729_0.4826754406094551"},"directories":{}},"0.5.16":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.5.16","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.5.16","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-QgGaAS5sCkAVH79s5B90mnjxFKYaRC6m38GOafWnxXs9lMFtcHiWRrdqAAOh6HK8D+vMp2Bh8t3y+FBVj12LGA==","shasum":"795d810c46e05d2c5fcfed77ccb0d891318aa464","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.5.16.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICz7sZvYizevD+0NFLnJsX4Bo23e0Je+DwEWEc00RSVcAiEA5N87qByc8XMPN2xRts9CDuIzoDubAt2ElChgme2yAmE="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.5.16.tgz_1512460162174_0.5232660837937146"},"directories":{}},"0.6.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.0","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-fUtsC920ikoKoDaO4Y+AxSptD5Wd5Nk+DtSX8Kdnfd6oR/hNmxb01yU6JMA/+XPXE1uN3zEQPlKkw/1oSx0KzQ==","shasum":"2b2a15139226894801dd2112e3be2b2e6300efc4","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDPIZNOwPHa1SGmn12ukEpQ+xdOGDy5t4a+ppbmHWiT1AiEA620HqA5lmPuqOBkfhw68K25iCI+iZzEPsdrQkvOsoMo="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.6.0.tgz_1512620026063_0.00841114716604352"},"directories":{}},"0.6.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.3","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.3","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-VTHa/Ghaq7fdkQ2g9YAx7HrWq6BAI9kMkMBw6+j5k9r21aM8HO+0TxdFOXANejuoGBZh9epehZlfK9zSA9bbTw==","shasum":"de7b120cf3b70014367c402a1dbea7e5de0d6a66","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF+Xp6z4Fg5ueSPFI4XFvBG0ca399j+22zBAIBJVJwowIgMrIu4HtfeRL6hlz3IMFrojn2LW9uA4FOA9Mf3BsnBcQ="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.6.3.tgz_1513050811685_0.6956250816583633"},"directories":{}},"0.6.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.4","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.4","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-BLiAJA3rlQpctymQEoFIAppTmW9v2CsXKcZpxvZIXExRpqELCd34JsRQG7DzbjTr+OpFkl/uLidR+N6l1jncTQ==","shasum":"2155595e39203bcc12714a7a64e17d9b5321910e","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQhLRA/Qw1CkdDiPF567QpksfsaggVUgmVwbc1Lh+hPAiEA07M1PRGdXS6rFu/pM9P/VcjDYSlqpOvbnxoGuxk00tw="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.6.4.tgz_1513227860300_0.5749479632358998"},"directories":{}},"0.6.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.5","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.5","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-W5X6mE/sH3EFnJLyQtb8tmAIalKNMh4DgKdCaffH73xAgpiYVbw8H3ho1ffHeFmAT1PtFsHyLAcIMh/jxlGTBw==","shasum":"b5b70b4bba08d1e46fdae3abfc12a7ad5f2a1fca","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLCOxIHci0FMalzlsROZATqaSTCNGHx7JNuK2/Fk0x/QIgM2c5CJFj8jkGDHaIXvgV+5JHw8e147rk8GPD9DjRMHc="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.6.5.tgz_1513741027427_0.9649282642640173"},"directories":{}},"0.6.6":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.6","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.6","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Mg5qwmorSsPDca4xa1ZemMmmaWxifkV5JsfBGafRr91J41QDRZX/0zbEuxidvN7Rrt1NlMrGEm3DrcADR3RUdA==","shasum":"1013d7091fcec1b0141ba070f6ee2a5bce6d7632","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz6PeeFRcpdf+gPTaJG+0BwPmR9G0dVMfwshoS2tg82AIhAPZylv72hTmhkJQ2uTNHtHpss/Rj+Q7Ime8ZtyXqmXxe"}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.6.6.tgz_1513755206733_0.8498517128173262"},"directories":{}},"0.6.9":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.9","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.9","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-ERLDjI96DNfNwXjNciCH6cg0dCEz1Pu3p0BoVhP0PhiO5OV/gyti4zrNVih3O9zvMA9xAQ+85bo9Kf+8/qltGg==","shasum":"82ccc9a3b2f484cd30051de9ff07e0efc066d313","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.9.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdVMDr+ZRxCJ+fHcVZA+Nv6KkjdAzCNVEL+R7O4C5uxQIgHUPOrZNGNf+1NBpdp4kpTrRmcndtT1WUioqktZ9j5BU="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.6.9.tgz_1514433441269_0.11160333571024239"},"directories":{}},"0.7.0-alpha.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-alpha.1","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-alpha.1","dist":{"shasum":"142228e56d0f9cca5c1a930e2f53c81d03cb471b","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-alpha.1.tgz","integrity":"sha512-KsHIDpynXVyd7C94QuMa2Lkt6zGUqkq6te7tKtr6nGntzg7Rh+MEhysUmtPs23zTDu62ktotLj4+EI08Q4AJwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCZiNw6n8xM4F9WG+fwdONqvc6Nne6T0Aqqt1t8FTcOgIhAOuEnCL209ki7VlD6+YX/duA0OdGOXSVeVEbOLqsS0wg"}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.7.0-alpha.1.tgz_1516602989690_0.4614528398960829"},"directories":{}},"0.7.0-alpha.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-alpha.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-alpha.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-alpha.2","dist":{"shasum":"6b551bfb552816b98dc91262aa1eb1e8e32317fd","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-alpha.2.tgz","integrity":"sha512-iJkr/2bhblP/DW+n0qCwsxDN4GaoZ0to1AXsCHc4mYj7sf+OeD4iP6rQvkr8KGyQ94SZ75mgyci/rlAst8Wg4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDI+JRbZk/sSXFMIZDOfhusDZbDmIfcsBUcLUNddVpQRgIgFvGgnLA1/JF+pZI+Mb2LkiZqCLZTgaPTtLCQpRKbRvM="}]},"maintainers":[{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger-0.7.0-alpha.2.tgz_1517796321904_0.4231969085521996"},"directories":{}},"0.6.13":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.13","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.13","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Eghp8pfZbnvS/1rGcN680HW9D2YhP5Ncdt4K8aA3xogaAH/owN5UN5i/+A9LdcoztFhcQPrcK0nJSCNzOFFBUA==","shasum":"8023be45ab3c229c2f690ea765c13462a7eab699","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.13.tgz","fileCount":16,"unpackedSize":354801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFoh+JclUwKzDxRClCTwdEEXszLG0tQwNGWNwS4XhRfbAiEA0bg6Vwm0nuIwf8PjHgZUC6z8EFB7R1NNMZ3Ge/SIPgc="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.6.13_1518422608509_0.07240834133513507"},"_hasShrinkwrap":false},"0.6.14":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.14","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.14","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-iZ4TlF/FgztHadFX7QjmAadiVI9+ElaCosk/rs29ZA0POTDZgnzfQtS90Dcwar8H+I2FYKcLUqFTZ+S9mVpzmA==","shasum":"cc64e759487c6597e0be1c42e04c13ad278783ac","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.14.tgz","fileCount":16,"unpackedSize":354823,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiZTZ7IGKEYDRuer9uwsANBomg9nipFOuuuztsZS6dRgIhAOCFgPlWU3CDdAJ9ZxfjJUw7uVYDuYaTwXDjiCSqJd0o"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.6.14_1519111204669_0.8733565089886051"},"_hasShrinkwrap":false},"0.6.15":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.6.15","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.6.15","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-CVUC4wi7mOquG25/3ANRSvloEhZFmU1Kt9kgOx/8lqj9fPtBDS19u8Ec+VqpBv23N5dKLrYrsOIjXebz2jiLtA==","shasum":"e44e039481cf629ef6d868f9cdf30c7906c452c4","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.6.15.tgz","fileCount":16,"unpackedSize":358160,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBfzV5IZKc3hJrdZxOkZBsBcm7mpeUbO3GGC7lN8+oe0AiEA5d0Csn54Ghza89ftUcdMEDVBahllxHk/mW1P1paFgyw="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.6.15_1519636538326_0.13278883568308997"},"_hasShrinkwrap":false},"0.7.0-beta.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-beta.1","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.1","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-beta.1","dist":{"shasum":"c2149933a0a4fe49d225c96a146de368411e46b7","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-beta.1.tgz","fileCount":25,"unpackedSize":413491,"integrity":"sha512-olllfgSvmPLt13fXi5pelGuhrj44RPllxAjp0IXxwQTRmkcyzEyZxwa6MFEmU1CuhLBg5E2Is2RkS4My2hG6xg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXLtRcPZGkk8gioRkSFubnlpuMplxi/ZDoea7BMrQqYAiBt20dkalpgPTP7dTDa6jbSo94lV4x2y/HHAELp0om3rA=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-beta.1_1522054767748_0.6477178857222896"},"_hasShrinkwrap":false},"0.7.0-beta.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-beta.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-beta.2","dist":{"shasum":"afcd853de60f5d5a6f0ec41670b075f58a321852","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-beta.2.tgz","fileCount":25,"unpackedSize":413491,"integrity":"sha512-+SgT1Qqtdu18qeZwdGCB32DiH5xJy6vlU1VjnLXroOmPGRrwFBBrdu5qctqiNVA0CDtZjuLUadimuDGP0GbmfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDE9h9OxP6zz+/aNr19N9USecsw5OKznC1YOVenc7autAIgHZhHfY2D83zCyN8ARtdIKHLVd1BwqeHL0kGJYHLbGbs="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-beta.2_1522224539183_0.36280168842810157"},"_hasShrinkwrap":false},"0.7.0-beta.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-beta.3","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.3","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-beta.3","dist":{"shasum":"0d102daf027a29340134328c373ab3bfb4a27272","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-beta.3.tgz","fileCount":25,"unpackedSize":416846,"integrity":"sha512-s7+Ga3m/eIoHP7zKMWDIKg9Kum825ljopp0HexbjuPUDCKDqV8cFiye8Ejp/bkAQMzbt1oAR9Oddwgy3krg2kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDslxwwKYnf2TrucwMVXMMywQE7fhjWZaek4/E0r7BcwwIhAJB8eZUN21AfVkqopdWlNEJ3tgoPfIVnJcYxkAtYOjqI"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-beta.3_1522650419475_0.256572346449075"},"_hasShrinkwrap":false},"0.7.0-beta.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-beta.4","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.4","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-beta.4","dist":{"shasum":"c2db33fdde17b3a5727b8752658630d70b1e7dd3","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-beta.4.tgz","fileCount":25,"unpackedSize":425478,"integrity":"sha512-4w9DWil3u3xCCqTlMqEeMvrygnCJ/rE36Dk+KRnQZz2i9B1t5nW7ikkHx9Mqd94W5u0pgxRWkuxMk0JGuZ+D9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAjO7IV4VNII/aGPUMLAo0VL/X94/RQsI4J6GsCz8OJpAiAddBcC7RCUj3ybVlU0nMRfIn4vzQ7pLNIsuqH3PZ4z3Q=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-beta.4_1522737632352_0.6643106478755871"},"_hasShrinkwrap":false},"0.7.0-beta.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-beta.5","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.5","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-beta.5","dist":{"shasum":"b3e17d6d30b88a74dc7fd3b5dccc8fc1ca8f4aa7","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-beta.5.tgz","fileCount":25,"unpackedSize":425991,"integrity":"sha512-dsVM3AsEYr/f/mJSDyk0K119/GnQ3mR3xmbgbgL23ATfyFy6p/1qJMmbmRT1pzzLbpKk3q/TnCVWtK/xnnGKtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGJU4Ffpk79Q7wCMP4til0fmsEltKy9jB2TvJm5iKMT5AiBGty7WWtJDgfwDFxA3nvDK3czagXtoT+oWQ+IaU9iUPg=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-beta.5_1522748377123_0.21236027232379717"},"_hasShrinkwrap":false},"0.7.0-rc.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-rc.1","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.1","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-rc.1","dist":{"shasum":"4542935db49471c680a61fecd053575a46500393","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-rc.1.tgz","fileCount":25,"unpackedSize":427817,"integrity":"sha512-fig9w/RFgJjABuuq2irNAn9mWCTlkmFwmoX125GRhJR+Ji4P81xzKpuNq3wVPnaE3tcxQ8ipf3u4VfP2YYWEeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEiH5tHKRoovlRsSk996dpdYvvFVitEPurEqwhuZmlMQIhAL0FVFTB6MKzNvzahcJ7KCT+V3KbLzMTHjOdTtwbLlfe"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-rc.1_1523261660776_0.3804755864652254"},"_hasShrinkwrap":false},"0.7.0-rc.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-rc.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.2","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-rc.2","dist":{"shasum":"e51a25109f62e3c2d2fdd7a75981c59e24d58c7c","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-rc.2.tgz","fileCount":25,"unpackedSize":429117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1XXtCRA9TVsSAnZWagAA4EcP/0KiLE4a2p0Upd+QbLA9\nDjlAvZcOl6qhsgSFMP+coF3F5gjAFvrPZaBiiijRaesMea3S1Vf8eLbuPqft\ni6vKbYBGhraKsGUS5SmqZjLTViki2E2qOXd41yV5NEyyF4VwGVhMWXZa/ENq\nlsOQvrCH9Cc5p6aX3qSEvCpL+vf3fOUyYK20I3sPLcTZrnCL8sZ3ZPQkYWTr\nPB+4atsyh7o3+7EBEhkV4DNYMSl0YKLBZlj5ZHofPkofnfnf3qYY++MQ5z9j\ni7Dr+KQUpDPg7spzGfy72Eku33Ff+rtnKJ4MMJgS+HUQVf0JNRIjZE363SHR\nI9nVD1iYVWgcui8TDxGCBUrq4DhpDg83Gtte7EjLeqEybKmt+mtBGD27CGk+\nYzgBCJTPRyfYRgGfRcSjrFNquxcN3dn3Xh+u3fcLMvovj2U+GB4P2o6ZzCLH\nX45N9R1fqmS7bjDqyfkOTtkJsmGWzAESmZL9duhFharOu863/U3mmyUQ+HSL\nLK3Dj4kxsbYSy17muRm/JY+ynoIHST8J4RBMfJJ1YL0qnhONP0F1q6zblVMz\nZ7ELVPy20/Ye+CbtDCY12iwUAp2wJpXJBeePj0p+j+wRb7vKQzTPZHg/bSF3\nWvKwYlmlADqcI2Ke5a/NMmdyhGEOgOkEYCaZ1MWXX6LoNzUzeR9jUnnhnUph\nnTKw\r\n=l9kl\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-2dTsiT15UIqPg0jeRQHSzf6nY5e1SErjZJeLfDkSItrgB3m2rYr1t+NIXEQdhmz1LeA26dSYckZ/DDLcqvx+uQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv8OCr8213qrGv71V1TttvjMhZfkBWtm/nCsdGYADePgIgCjk1+4v0+mpkq904t2zulyidT1kGeHFXEi9GnQ03ZY0="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-rc.2_1523938795992_0.34981533523581687"},"_hasShrinkwrap":false},"0.7.0-rc.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0-rc.3","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.3","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0-rc.3","dist":{"shasum":"df6739083b9ed16df1eec7f9b136caf13f443bca","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0-rc.3.tgz","fileCount":25,"unpackedSize":429317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3qoSCRA9TVsSAnZWagAAbBoP/1LsjxlNGSl5I07EB9hv\nC6eAcqloHJ/SVbwgOYNj1oItyexwd+CQNp69VbwAh5toosgAFCa6lRqNsU2D\nqH59TyFZQRdsf5LIAtFEtvAscVXBN77ucoZW+SxKKmY7gH919RbTZmwPbUhB\nbr3fB2eOt2mmKvIYZNRjEjlhULTrPq+3PXF+GPmTPOB94RvPH/Et3KQTKhHC\niGOxp88c5VI6vhdR0YxQeOCwrPn850TeoGtc9UMTn5wPxIe+d4pAgj/FUXg6\n9SlqopxXjUsYh9viojewzZdCYv9aff/GqjLacH1wBLxcAbR/ladxfMt9nvGp\n6RXj2MOjzlIiIE5RleFESPan4qrabK31QuureqC/my++J1+mxvXJuNMeRx5f\n7sXRpo6mau+uLeVmXXVuxEZkqUfE2nckrMiVdhTPhP3mGd2whg8j9ifJ3or8\n/fi8KQHLNmdio5kQhwgixKxbiVcyNRmmp7KsNCLgwkpU3ieXGGEsS3Xb9j0R\ncO6zvEF4uqmgXA1YNJvfTNdPdG0+SziDCfOshg08uHqpt5YASznRmqqaRWPe\nLBYFqBwn9NKjnNAVKatinuTLkmLaT0UWaa0WF/fiY02ySDHz54Y0/Sgmbvyc\nkenXSPfKoclqEq15PW6TFYIlgqpXQCUWwI9t5Upb46NzZcGnDMSIIEHqb3EW\nMcYv\r\n=X0Vt\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-/a+VDXg1QTiyeBLKN6e/jOrKa4mYQzys0qd6SYjA16SEFiasT2C7DnOc6q6p/YUSdq/aAlWRuPPYBwwKBl2P7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRPQWbWUIaQ7K4ekbF6frWg8PDlvcZAqhL1L+CMSMx6wIhAKeNaaLPwnT64SWpwlsjXhpWDYvUQFI8SrXM5deU0ztw"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0-rc.3_1524541967639_0.9838398122676888"},"_hasShrinkwrap":false},"0.7.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.0","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.0","dist":{"shasum":"82951e1011652b2b714676f7c8f20a525413a12d","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.0.tgz","fileCount":25,"unpackedSize":429307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4yX/CRA9TVsSAnZWagAA7Q4QAIuSyg3d2/HW5LyJ/MAC\ntqIzTEg4DIAvq+0wI7aKME981vYcuLSZdUe7wKwpkNIvVSbfLNOHbw1nXAi1\nvbgA3ehWbtvCSLFHT65tcod3yuNCvbKVlpWUIHfZJ4W9jfmVYFQL+/6IVymv\nA2cB1OpnUwqdq2IBCp3J0oI8B/SqdkYKtYJJb7EItrDTCBVBzIp1YW3z6R51\ncDROAxBC04wLk2vsBWlb/JNN1mts+nYxXvWZ/A9L30VQrTbf8MGk77zbKOjj\nQr5UXqpDwMXiOP2WBnZ/60a/gHcoqSe+UpbBpabf9PmjojNCcAsOLeiMfYJd\ns7PGoM0dsRbzrHGrWGRPQSOwyuFBlzoJT3tUeO5neRwsmJssjCVtQ8tggbYt\nqbbsSUPvet5lYcfhpMGwFsM1aiegnTTgoYKcrcnYlPf59aZeY7i5GvUim7K6\nQ+fGGqgEcQwxoUSPrakIDOTcWjShqAmR7iRWY5HZaNZY1K3JrWqy1lVoravM\nnfiq+58GDGI+Ig98xZXHO/itkHv+QDEmcWN5jFizzMawbAT18mE1Lr/ibcKd\nJYcTMyzXthkQVL3DGrsLBYRkjPgPqWurPLCDCSs64vzENrPOgMMltPOPP6ok\n4GGFkGqAnXcZm/+Hi8TvurZRHAgNx7IQ2FK09CMwNiuPgY8ZSjQuS7rIzIyK\nlgJs\r\n=ovat\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-/9ixiwmBhgev6PByAPKfWjRyDXj5aVgu0KW6XD0bjqPXEtjRrMP/up1tijkz15RZSV5jHdino7gaJtvDXILYIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDERmLbRkRm1s/CaqW8fAe9CY3vTn6zm/VC/AemddbWNwIgLuIwNnT6Fg2Kjmqkih6qVyNnTQ/jW90YI6MkygZcjhs="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.0_1524835837209_0.4611304679383015"},"_hasShrinkwrap":false},"0.7.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.1","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.1","dist":{"shasum":"fec04ec20e02d0d7dc7363ffb43e6e74a1475e6a","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.1.tgz","fileCount":28,"unpackedSize":447568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/A0ZCRA9TVsSAnZWagAAz50P/jz4wmtJTO4Lwj3kJbMs\nvdcGg3v3FMyMFx68mKQrazxguGCrDppM7cmJxQ04XsoO4nhOWEzvSZxel9UO\ni5UOoJrgKvXgb59jFpD+3Pqe2qr/w5gdzzOv/vSkTc0yjvluR4YwlpVVLpI2\nl6YN0Sbwfrp+5UIERxu9tYz7m2ua+mGGub50UF+CcSTcl3uJGdAmmIvwW8gc\nnVYaXUX08Gk9pSXzUejoakc6wvJGP+FaNtcI/M19LWPnHur2Bv/9G/AO+VQ3\n4PXHz8wAIYu4oL8DyoR4RCdL9epc8QKWmTeQy8JVAdCn4GbnCltD/+sjQHBo\nRSp1Uasl19LLXea4xm8ce5TPQo9mlYffmtyuSk0lQk09MVdyhWp33GSASZdm\nxPKXbb5ttuuFP5hGeWNoeWd+PNE2CaXF97k0/uTvI5YXb6oiycu5QsUUsuA3\ncJWFibuY9gGmAXsK4+li52bmukSvGEUPUc7uBoDyXUvMHQNdYbrKhqn8sQt2\nU9q7PfEBVyomrEaALw6nvYWCz1xBpY9xhvYwV+TvUHj7xrB+BTjony6RFrhC\nF++aAW2PKX7jCpJ74ylYmV6vwYpCeK5Ti6KFg3zpmB0FiwP+itUf9mVO2NtC\ntoq3s1mJnX5wCTmlzw2GoIyrtWNALPY0U+cytYFJTynjSpbF+zAuugGXCn4w\nhW6c\r\n=Nhd1\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-ZuTSWqbJh1a/dcdr5eW17zn6jioTzsXDAOIE62fAXYJ6gJOAOkn5dKEY3NxbCKqGAIViJ+OVOx9MRyJ3yjOYZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDESuIGe88cS0AsdDBl0DvC0Drco9rAHW0ikH2GGqGvwQIhAKmUCpXMR36toddvDyRQqcoNwJt5cmTKZWd7BtQt4FbU"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.1_1526467862701_0.8446021204717173"},"_hasShrinkwrap":false},"0.7.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.17.0","axios-error":"^0.7.0","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.2","dist":{"shasum":"a52693a7a43a94a740f1d95b9d104a56d7beca23","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.2.tgz","fileCount":28,"unpackedSize":450830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGgHsCRA9TVsSAnZWagAAuFgP/Rloh4cPYELq256RCdRe\n9HkFWKaWiULGlSk8eOIuiWqdQRCzDOAms726JnZi9i/UJLESqrlmrTK4UlWg\n+pL5ni2NtnWZaL7b8GupmVXDWcXpV5z176D4sOxhxdS67bvA2l5BVAadhabe\n4c55He06P/qzO0fJ0PiogImT5VmxGHk7XVBkhqYCwvyhrCiNr++4XCMqGy++\nBpN91DkDD6vz+uqVJKaIabnVxBQiCnl6G9psunx1kCPpOYY3SoU3YbyjpO8Q\nx6yQAcwkpKMLyU5koPh4GO6ztusIG4xDWQoax1mUffH8JFtpJf4+1QFsIZ5U\ncOCo+wGbc1mgC4W7Si2D+sn4K1zj5o8RqnK7/O7+CUtcEwpZEnPhTofRvdof\nXADt/1IUobp42Hj+v3RN0/e7nIBc8L2ZTt7PIPsn6pzYmXcByYwuO3KoWXIJ\n7SUe9ltAwTlx5l7gP36Tv3xxQD6grGq7xWceqwt20BdKPdTFXrF3qnsWiXFM\nPPIq9qTbBEoZAZJC/vERt1dcirwdQIoBmpUfH7vsx68mtl7zgcj7MetGifXl\ns+CrB0yucRaw22qqSn9ilcj5loeuWhhrIIKq5CXD1BGFZQKgS+PKoukvFVSE\nYztS0FdaCia6qjbymdF2TIdp8JpEWnZwRrf6oPVzcwQpsecXuZovMwCZXrmu\nFqHw\r\n=n87Z\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-0Zi3rCvLgLKn5x472npgCPVyUR35gz+G0Obh5UjfEPnjMJvqQ5jOCJS8XLb6iVwrsQf8MRBfvABppxtkVlm+Dg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHKsUlK6cI3aAQ0wFqcf89RFKFiDrtRY0/3/I6f7XprgIhAPkx6lOYg0XH2HtNY3gwZ3962pAEwRu5UZbnFhQeB3EZ"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.2_1528431082652_0.3812385426536409"},"_hasShrinkwrap":false},"0.7.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.3","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.17.0","axios-error":"^0.7.0","form-data":"^2.3.1","invariant":"^2.2.2","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^3.0.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-messenger@0.7.3","dist":{"shasum":"cbad0dcf17f6b7b39f562884a0a82b691d37ef3f","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.3.tgz","fileCount":31,"unpackedSize":454622,"integrity":"sha512-NAoOW9Bzeochu3X2hSMNIN0Z7GNg64XPrQFs14YQcPLMKYCQ/rMyHJM51yacU+V/GsqleprLGSq8SSSjaF2uIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0Gr4cO8CKJx7+w/DuIwv0j2Y1tKxUvwZOcr7WXPtwNwIgFW7JPtyIqx3yoAcKLSkwTDpXK5sv1WRDa9LDiQuRXjo="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.3_1529380804603_0.7703978405793239"},"_hasShrinkwrap":false},"0.7.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.4","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.4","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-messenger@0.7.4","dist":{"shasum":"e713d5b0a81791688b6ee1d85107e7ff7e7265f8","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.4.tgz","fileCount":31,"unpackedSize":455617,"integrity":"sha512-7qdAhUpYrQMlTINUK93MzQLUlKD0BaWsnEkfRqCoxKIB4YknA0JIm0SEEl0DqcZ306abcUSZn0WdCJvZT3wQZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBRk/PiB8ofJVjK1IF08uH1nsTHMFUxrOVb3hKxIVikJAiBFT9YsJEQuXa4kfN/8l48C8X/ti4c8qevGjKhYjj7v7A=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.4_1531368907996_0.21912718553339805"},"_hasShrinkwrap":false},"0.7.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.5","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.4","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.omit":"^4.5.0","warning":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-messenger@0.7.5","dist":{"shasum":"5c0d5849f561b352cc6d6454988b1629f2124fed","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.5.tgz","integrity":"sha512-1UcdsrZ7opjkdVBQmQEcU2gOo2nKOtf2nm2fOeJilEdiC7SoziFvp7bxzLYGRIQnhn92kWRVL76TeNHhaV+LGQ==","fileCount":32,"unpackedSize":454221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZZoOCRA9TVsSAnZWagAADu0QAKNbNRMq2ZKbxb89wzki\njRki9P/zp8avEeKiT8T3BvhpBY+kpIQYe9hf5hD8IfUOlAeud3rklSZclhAQ\njfvlS6znLJ3CO27gnybwW+SQGAhaBQiOK+7/J3U23AWU0j98f8PEK4ABEfva\n1EsDxnx2RbI+8LT1/CUFgRvYp5ClwBkDPLRaOLG8MrHx1shyvH/GkkQGbnVz\nkhmf7LVVhF6h+RjdZ4FU+A9/dnDTyTwBVctFGaTPIJcUTu6Kv/V70L5/9N3O\nYqBhisdeg54vriU2Gr74g133zo44S5PoIWvUsY2ktZrSYz+qQyeB297zEHOn\nodGFJLSQmsKWX374YNgoNBHhrefKnd8hwXLzEKvasI8cWiwASmZJo96v7aoQ\nfSZRk8p9MrUKr6YVJfNspN3nnhotcS94guyJFsGxqYCJtC17e8DoMy4XB69h\nHqu2X1lC02KYvAlSEluzDlF3gVDiUAoEL/906tWtMkQldrykvVYjg+BWGo1A\nJQklN9xfxDZc9j5VXcsigY37krBozzFYsBd2u5xDnh64F43AGyKmHT2V3HvH\nHXV1kWtuBP0/ir0lHbnX2aPdgLQWq9qCZKIgE/jvbTTDSry/yesZ2VI8d3o7\nbrb4ak3uhNajYw86ADU4Jfy6ocOSug2KmtlbG1qascGv3dmCDzCtnsTIV2iL\nFu71\r\n=i0lp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTEUF9sarAdrT3jFU8sHOCyHCvXsmQlv1TQSpAWt+aLwIhAI67eEtYV9+5QSV5Pjq1quoNVRPiuI0EYjCZPMCNsu1M"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.5_1533385229902_0.4126255298591317"},"_hasShrinkwrap":false},"0.7.6":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.6","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.6","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","warning":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-messenger@0.7.6","dist":{"shasum":"13806a91aef537fb9a4f436a56e959763da3b908","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.6.tgz","integrity":"sha512-GlQ9oQ6Ll2qnFc72OGY2lMj7iGJesTwLK+qOBpdWyPhd8a4auJMJYfCnNPkgODd9M2ma/6cWRbGjXOGEuCgtKA==","fileCount":32,"unpackedSize":454410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfl3tCRA9TVsSAnZWagAApWAP/RHoPze9RRZqwzOXc+GL\nLT175rOH40UVeoTFHxjG3oLRpsqLPJdolLh9nK2NNVnD8e7sxXa3KZ9OwaBn\nmF8FB1ZbLwSMW+BeauPtjEJ7XAE7fdBHpekPiGX7UIZTVWEXaO7To7SR/OFu\nNNk55BTJw2XRxXLgCpW6ORMewzo45NOC+I8FM4JfZ9c7sndv5miNgGo/MMGf\nVNmFDWcSRD4zPAZs/2YsK1NvH79xe0NUT4cDa/hk4EceTnpDvNMsOtZJ2GOn\nGKOO5tcga/6C9/8GTI+txr9V+ULL3nsgLkkDWNGQvNwxkvqXePKBuLfIf1bf\nJ4wC3mqXXjRE14rggnBvcKERwN49HcigrvkHM5fv6ySZAF8G/YEldoULLA1L\nsnUfSlydbVmC7vmORajXt9kmbnoFnK48AJ9UKBpO3qEwktvgkNl6y1hINi9t\n0FNfHfZ0IMOBLB54vcr49nMd0uPq4Dtwbsk2ReYPHmyTkYTwa0pw2tg0IA0A\nGTTaHjGgMIxNA30STxP3RBF6XSc7ENI1JrKMQV/jYsIWHuvuTPGmju+ZSlOE\nazVP7Slth0Dh1VQljoYE5I7OSPKlVXDS8fRWVK5eTOCscJ450MaxAK7dXbg5\nrSByk3UyOBDI+5x5fETrvJgTMxenIUmrcGXnFrJjqdS2s+IURo2iWKsxlBMe\nGUED\r\n=RcH2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMD7UhCn7Aib61Wero/V3PC3+frL83ky7xAxBWLypuRAiEAo9AS/xTnAbJsNVTKkp2BKuuI5vUgHLuURMgsXW5YqdY="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.6_1535008237058_0.08922100696922475"},"_hasShrinkwrap":false},"0.7.7":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.7","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.7","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","warning":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-messenger@0.7.7","dist":{"shasum":"20738f4cea306371dc257befef6ce6693d7717c1","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.7.tgz","integrity":"sha512-kcTjF/l10+noZdbp3t7t4thXW0D3g/vWJw8/YoFIpDw5CSVf2NNFHssxwGje0S4uGmFnStMca/5pootpQzQfRw==","fileCount":32,"unpackedSize":454943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnh6wCRA9TVsSAnZWagAA/LIP/A+iBFslyGbm2zf6053g\nxsGvdyeSooF8HnFDsUwUwdAru8VKzvsxHt/c3QkbG3Dsl+lleTX2/nCUamSs\nC/8p2wZJBpEPW4WgJmKanz5NPSt7agdhw7mkNn1FHwgBHbYMCyb/9w1zt+2g\n7vMNclC1pjgjgM4By8z7PIB3FVOnXLrJsuDx0BlR236rdJKBgtDC8KJHcCR6\nBWotE8ZfyvqkjU1yDb66tHIM8RGSAWQNHUS8+Pf1IEMjveVMDUL+IyC44+hy\n/wWPGp19EXIG7xKWHeCtaRBmLo4cIm7GSmnk19V0eX/FICZSHpPgFNlQte6W\nw6HzITJjWwbjcaoEM4iKOof8pBTV5YANPpNrt2z5sh0SBR3WjDlW853LK4At\n+2nfSGiR2mrcAN3pZgyW1pdRYqhMwlH25TMF5wrz3MDooGiejJMjKPlQfDWp\n9y79krYle+q8UaL7+3awz8N7ezrEIwPA3uZSo/Rg+zjBSQHz86vYl8EnOTEJ\nJ82AI1RuVRdIRO6M3p2dYrxI6BiMeSP3HnPNJaCRTvpiju7eII/goDnQoAql\ndq5j+NmpGYNfFVHasCI06epzATc771hrXaeBrPPRMSQzZXhuxDbrW5zg1EbS\nXfA2zLF08eNZAX1U03ayxZN8O6TulAXgFlH2WekozZQboZQlkI05maZbuNg1\n5qac\r\n=P6T5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdnOHdWM7N20qPlWpZCSlsgZkWqYxGyOeaHtiw29ydnAIgJk92Q9NzYd6rnpzDZtmNLWJq/rvP6/mnTnNkN9N6xi8="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.7_1537089199580_0.5548258055057087"},"_hasShrinkwrap":false},"0.7.8":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.8","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.8","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"9bcc48ddb1c03d7fc0d883c5c8e0e5421cc3a505","_id":"messaging-api-messenger@0.7.8","dist":{"shasum":"8ed0ee750d3eed838c5accbf475f4a23d8bbafd8","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.8.tgz","integrity":"sha512-GknX6Gu5+aA4BE2tThQ6CmdGK0e6PSXNIxTmvzlPpdNzDHGco7kX4SPHcqwFthyUB0mZtRa7EB/yPCbCD/4NSA==","fileCount":28,"unpackedSize":460434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboeWXCRA9TVsSAnZWagAAChsP/0QDiAafSCf6MF6nqv0x\nDfd0LecWI60TtDE+etnd8+ndDMBnzng5nnYbs7Ps/lXWItxU/tmGK7ROlq+7\nXzn6taatv/PbO+ej85nPV/GZsWCbHDu915piIMRGtHfg0QAOZxpmLdTn1tk2\nzF1Iyk8AAe9dC27n5KDuR4zAntEkwEjGug/fMTJ2yf3SLENBZwBsJ8sxsnpk\nLdJjueZKuCGG9It4y3HzJ318n6U3+D3n0WObb7ZclLoGWzVn6qTaupgQVEJW\nODEQuaEa5j54CvpJ+nj/14zHTNRhX1NBqcMK4oNmfBLKjM6cxT+XlJ4q+wk/\nyOYitB4imLF0d7yAT3xRYSeAY6rwS1JLQ5OlmyPaJc2XWhgsnGvGwuA37Dku\nKM6mdp7gtjLJsRy4UT+GTNZQAYQ67mMUaJxpbjiesSty8WAz47t62MVKuJCB\nQustNopDeVXl8rTczmpHevAmjRrnj9YuhbeiJX3hhnWIw5dBsIK9EaC6rIpj\nZU3jzLQsSCZDYY3jSp0fxIU+7Y5RdCSfgTluxFjrcOvOBAf+oTL12B7ry2Gq\n+lIFUn9dKnfA3T+gPRT7/2gSFT00zUbUd/WkQdeJFnIiYEXZgjOXRH0Ye0f7\nzT+XVonRMZ0i4+cixG9H8KnOIrViIbiJVGYF35EFLTz8qiKRXAnh57twqjEl\n9N/A\r\n=90XM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGWP0+cbRU8bgy2mpYWmMKaUwMZkyLOHUjEPtRZIgNjzAiBybpCHvF3cES0wTK+EqzHgGOn0EeNJtmjQe3WQCV+BPw=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.8_1537336726085_0.8965826200509062"},"_hasShrinkwrap":false},"0.7.10":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.10","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.8","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"dfcd41f7b70c8421a31b5e5e50a0fe0196b36cae","_id":"messaging-api-messenger@0.7.10","dist":{"shasum":"3247113288e1d89b64f1067f5203efa6e19a0ff8","integrity":"sha512-gO/kLulUKzHxOYNPglda9J+f24CryfrJEgjKFEBBYri6xfailLDfSWmBRVITxTxPGGtiMwFXJPj2KbHvRi35Gw==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.10.tgz","fileCount":29,"unpackedSize":476418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvFs9CRA9TVsSAnZWagAA35EP+gKQZxOoHbpvC/UZGNAS\nXBH7o/n50aCviu59zRi2fppvgOhKG3t8WmrD44acryIGqmkPk1zo9NV5nJ/y\nkLT6Y+H3gWl7VS3QwTQDL55BnCn1XsrRIJcRhrkjPc6t15AeXtgm1gZbP5GA\n4ZO2MdBebYGV3eAe0xmoqadBeEBzyU+yvxPbbyCvNkrfG7LRWfzdoAaQTeQV\n3zg0vBwjD6mSC2b7Ub/2YE0JKwswVlUXVhUTKGAOWshPPV7vLOBe3stShiVQ\nDEvBdIzcyfFex/8TOfYAdJDC9hHleqr5VJHaHXtduuunsjm5s/r8a1VeKLtp\nqGFJZpg5c/EzJOWcXwggp0SuH1lGFE145CH1bg+8hngg2NpMY7eib5iuqjWA\nFWb1JNLNv/mlm4ZazhKRnnQLiigj80NlJ1AypHRUyy4VnW3qw3aKBdt+PHgx\nWjcTvJoLlDmIfRPLzSOJcbtZsMY15T5bqxsEF/nOT4rRs9BooxM8N0zgKpMa\nIS5c1w7+1JrOL7mwQoXfyFiYyKQPmPrk1/wwuH5REGYADzfbkfq9PGc7HuKD\nxMC9tfPZT5cOgrXmYpOLhj/6LDuo9oaE4HfraMha3VbVa0NOhgwzSgxCWC1f\nnFgoMHZkBXGtM18BMqt0oDG3YpGSipd1Ko9wQKPodMEeHuZiVDpieNYPTG/9\n+bbP\r\n=90s6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFw0pw4mdB0vpBsohBICgYeMnwJI9ABhPsJxjv7aEecEAiEAnm8vr7LJ2ZYO3Qy104CTtpI/ep2fjATfwDu+W9K9yrc="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.10_1539070770531_0.11169509460494997"},"_hasShrinkwrap":false},"0.7.11":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.11","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"8e43618226e9c46216372b813d24cae3bdf9ed9e","_id":"messaging-api-messenger@0.7.11","dist":{"shasum":"f2fea46b0c9431ae77292360f81efd418c53a9ce","integrity":"sha512-0emDahmxoZg5xNVp5BM5J9NG3/YYISB2CbIb7mL0zHCBA0YGyeZuiy9A/uesmjg+yV83w5qmf4k5Ptg9nkvyIg==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.11.tgz","fileCount":29,"unpackedSize":476419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx0xOCRA9TVsSAnZWagAAYAsP/2raYMSgQNUIJUH3Pzg/\ndlRq0gZGIGf2rXfiokOrLLosEjmdQm6YWB8Mt+mG79CqQwNEeVXrEL5JjyWS\naMMrdFJw6q/y5qYTnLTkoK1QA1OaRwHpRrp9DhGPc4DTF+hIlTmlJkEW/4hr\nvgVd660bbNyzJ2J9m9BoJNAAV4VBHLA9hRTevfEeOG6YP9gUticRT3jbOqDU\na+NoxIsb2f14q5VzjkeFr2uBkzTfS/I9Nb4mnGWfxf8cFZLDvA4fEI0a+x+D\n64qXvyeAMpY0a0PQ1jIwKyh74X3A3brwA9Fxnhie+yiXYm0vXC2Vfnxl+8Ov\nNykdVrWrfbbCOK8M9YgJBzzYQUfLZuEUNdbORKgiwwayUq4sL9cV47quhMKF\ncXBKm9wnvN4EljVIuLJMu81a4xJYyQdkcJDPA9sl28hFHmKhQgg2nO7nEBPQ\nCWe8V0CuTXNo2DVy/zAA0yy40LgYM/DwF0W4G4Jh09JJwIsuhRk1zK4OV2KJ\ndXuEXops11MbBXp2bLSErz80NDZ7Qg8XFD+StFO3wqgRKEuaOkqiYkpJWYY8\n5LBR8aK8KG4m9PpkhYjnFhikwysw88/Ft6oeXE5gpjzoD6kwAJ4Wv7BICnGR\ntncoQ2NBBKPID1X2qIHLsM697FswMLADhgnj21J3vwbXmq98XncvTY6g7OLS\nTjN6\r\n=Bsau\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdrJBu8v5ztb3JS/dAnQjROVZzISoFs73vEcSLcZRAqwIhANl6vUhAkYV+quZmy3HTT7QpIiCtI934FSOjN98GUAU+"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.11_1539787853585_0.5443902339481077"},"_hasShrinkwrap":false},"0.7.13":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.13","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"443dc95cf17e8c42e99b9646244bca5b200d4c82","_id":"messaging-api-messenger@0.7.13","dist":{"shasum":"bcf816579ff09269783c539a94bd63da2a48e472","integrity":"sha512-NKKpaHzwLPsN97kbHIzLToZR9tJyfyfcm0QdPBE+ccNq/iTa7kVGa9lnKTMoLD84NQBv6mQVnBkXfQF2JfjWxg==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.13.tgz","fileCount":29,"unpackedSize":476756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2DoBCRA9TVsSAnZWagAANE4P/RXyIdqxqXbSrPDGC3GX\nZTXmzyB1MH/i8u6/ASzOL933tTmJ9zrFousYBG7FT5pUkkkZoPew7QUMapj+\nnx37PgSla4HJQpHxBEkYEQPcs3r3sSLg/x4HUX9icUYT/YSQiA8Koy62E6ep\nZQT2DilG7vPf9yhQOUUegsvjsVddjickeIArH+I0dAixbC0+0XKqHANog69e\n6a5TF+ZYtqgHw2DIZoKuiQLGtcT8oiIZ7ewYpI6aD0eFxGR94jEHVhxncOrH\nUrWdtN2awtU19Pef19PVxHSkS2ZlDofN+rfUcP/EdUo2Cpq8oMxak5nk33tZ\n1sEekpYD1QZ9p6qKPDCuJ6eiwMxgZkKciNGTba9odJZO2l7t2+/6EkBRhCpm\niYMc2K3z36jVZ2yXoT35SKwZUw/XaV/Lc0SZEE8rilA912ZOHA1COJY08Rxa\ndce7wmFFFaeYSAMOLaMRC+y8E7fD+vSpi1mjs7oSpPJn15cU3AQsDknlxtt3\nuGkB2rQBeqASBNw74O/iderurqfYVpLYGu1OzMfkbmgVa8l4WHC7GgxBNAer\nzqDGo5Z0PYKQIxL1xbWXfGGwbGFrqn6AWvYUhVuqH+QNpa+/9ZzUTPE3EkjH\ngRNe5TFtveigkuyBfkcpRZYMAn+31cuXiewIgGjRDZe2V3tJ7DFtRDSnwKGG\ngx5B\r\n=ECXl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5vpfLdqo9kSZvjfkeizePyA0o6RPRE3W8sTbMSSHoBAiBs3nc9vvaI9SHu7BaarIfLE/+OiZmj1/41+AQigOCPVg=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.13_1540897277801_0.6431258228811745"},"_hasShrinkwrap":false},"0.7.14":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.14","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"b1ffdaa21bf135b669fdb79e7473cf68f6d5d273","_id":"messaging-api-messenger@0.7.14","dist":{"shasum":"9b0075bed43b20b807c7b3d4856f6a97c13f3a09","integrity":"sha512-DJsI9s9EWr3PhHTiH8vQKwCc22yvoSnwLu84V7D+dDPcs+ikOVM693nEaxbbqfRI8ng/MXxLc+NPydU0DWP9ug==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.14.tgz","fileCount":29,"unpackedSize":478345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4sXlCRA9TVsSAnZWagAAs0AQAI/9Zq6HHEunU4hnJ//t\naoRPKkAptcAKbxvn3iX5XrLYsmsnXgrR54c8tuAUeLDRM61FJVvJuWjkw84V\n08ZbxFb2NkVTj8aTOHDWk9Hmsz//aj4kAmKQcSYz5A4omyOiMIbeVD7eQvVV\nCRagz7rEprzyXWun7hhKt0aUpYc/3JWgyZOPdaqWtbWX2BvE6Pe5pWExcJQP\ntW/xbcRtJBj/wXzooqWfPnUQylgVtTQBYvJWEO32zcoXlw57ZqNiGOiHTSgM\npnuQmljPSsVxbVhOnnELzn9AVR+wQplwul9lahsFj1wnEKtt2k+7xhHBuEyB\nwr4aPqMjIXRBsd6UTcDGz+lzGTYjcJ77LyG3TA//JqjuaQQd1LmJUnKHYLtp\n9qcOx0lV2vUroB1ODOfJHYBo64jJeHvdmaxstr9nHfooUIWaVRTMrxBJw3nV\nbegZk2fFGQQNp/aobFm4qe8ca4UY1j2yK70IREQ6k74QiWkTx0U4GVz4KGsn\ndQhEUXQvlkmzCx7jbEIuEgAv8vi6KK4fSKA16NSflVTWV3kidiu1BiAPtrK5\n2LImJyTX1XXQRw3so/PTWGBOKkC1qVaSse9RsZahRT9vB8gWvBUB6LXPXQFj\nEQOcsQvG9ex3nRUtRT0JotqvdpFjmc31tm7vCXN26f4s9+EPqkPYVWwJd4DW\n9N7P\r\n=Gybv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCo8kkzxJMnBkZ/ImIdMK9Cm7ERqOrYF5pBg3qc4uVnLgIgRZiAexm/pm1RI+l1q5rl3MBNjjg6GxlS5jp4ifvPKsM="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.14_1541588452253_0.7534247633681803"},"_hasShrinkwrap":false},"0.7.15":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.15","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"e42f2e7c6d1ac1455b948fa1ef79815d7e7ba775","_id":"messaging-api-messenger@0.7.15","dist":{"shasum":"bcc3ac80ffa9cc35c9706aab6a4452ed83c2ffe2","integrity":"sha512-jVWLzL/3WP5KW9Di8nFkwc1q/TTzvIbh1BMG+Jfjo6kJjt7h5HCiKC+xrz2Y2yUVGVQ5zksIhpQ0f47ohHdn+Q==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.15.tgz","fileCount":29,"unpackedSize":482350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6Wr/CRA9TVsSAnZWagAABpMQAJSiQoE0Hxj+MFdnmyRc\n9p2ttIR710U+4wnm1mPqGKGcvlfbjgAyIX5jVRCLidFzGfNCkquoipd0BNjH\nlJAFGWJcmDqGR8KtQYsvsPkW5Ek1z0bsV7HFaVcx3msnOasWx2pSaCpfmD12\noxsrDEsreqU/SHtVeVVJpXBaZQzffIbM1E8gZZxW/arDDzHwzdKuTAsRMyv6\nhQcB4C6KIjuRBJv8hmMCaCBIrdIYR9jv00n2NvoSQxRT713VLPjo6oNfrGzY\nWCUhP9evTsW8A/J3QL9KG6NpUxh2QA4hB6grH1PDtg8Ct9pEwMxQfINX/CYj\n1453+LyesUjmghX2zGjrDFK+pwpbHPOjMqnUur4d2L5Mk7ZVL/RAJSFMf3bx\n8zLlPIGeXF1soUdB2K0XJW/063lX0RRiopvYb39RK8TT4VgdLa9iLhZfrECN\nj1C/kXvGuSTCJcw9qIDZZ8B74BieYItkCQdvDuSpkdxMU8OgbYbPvhDShhS1\nhE7PxKikMQ/NajVTLBD/oSdS1i8ojyO8z7rm1GILInkJZzVcJgc6Wqaqa/nx\n/ssvaIefCZLmTN3MlfYfJqC5C2duJEnkp9Th5eFGNZmJiCqxFtfYLaZJuH1o\n9zxoRA0ks2RCDlEP8XfCsoAWyGw3c/df+OLDkHUb4RKYQUBnKFKOibzyuGYs\nPOXN\r\n=fJ30\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVLaZTPvA5R0dGsjerSjUO3tqRMXmBBhM2Y5y4+ltukAIgf4ImPHE2nL5jXMcXbwr1qGpg2bQz7AEKCRXUdcjKkF0="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.15_1542023934387_0.3835587077993634"},"_hasShrinkwrap":false},"0.7.16":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.16","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"b90b31f540871bb6ea2ca00a358ed15a02c42e81","_id":"messaging-api-messenger@0.7.16","dist":{"shasum":"b030b71fa84d265ad7662b8d636599a1cd9e2a2a","integrity":"sha512-5V9phjvDGnBwcgWS09I1T8NEHS4znzpxAoDwjwAd4grlfVpq8m3sse4phT36MRCVorcuW/RxqHkCsFPnM+XK0g==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.16.tgz","fileCount":29,"unpackedSize":491201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcT+dQCRA9TVsSAnZWagAAH1QP/2Ho+6lG4vPhNMDUjPt0\nlJekeNo2eGTVEgpSXKJj1jjqd/j/xbM22H/3y1QYJenYtDWl4A7SFQv5Wn+6\nt8TuUJAbQVtlj3bUrim4bT5pSM5Tqd2iUM3RM4ZsZUmbIglKjlW2XEkEZ5H/\nOpWBTB8QDEV6s35dqwJNbs8y6SwfQzE113MkK8Xl55jalUB3Q2D287nsYnHO\nGZJjGYSFehkTAzAKlZeIa7sb4U3QYB1obV9S0/kjq1RaSUZMSB4XMk0p+QB7\nBewyRH4L9VgZwJ0YSiE8yfZuCWcioqA6bQUnSGu4kfSBao8JLVH5WO9tBq/o\nDMJpCu1l3wO+xiQtjoz9qamga/yHMQs2nZiN3HW98wOpcIDMv6uH3NjOEGEq\nZTugUFV7pFLV6OIswuWNSQzwlWKsQ++fBq4zzO0n1DqDSyJlbopVBXWfyWEV\nHWA4YiQRge3iaMAROccVQeUai+HT0tR9WeOFmwARg6hndELSlQZoAGOI6OPP\nQ2V8GKDszzCfAWE+2XCqIiJ8XWNaplD8IIhHjtxOFu4et1axfjUpBOpiFYs6\nADAMwjAdj8pUAKr0gu/oPbRE8ruCZIvTB2Lm1JeQ7vDJbAZY6miHOGHM/2jI\nyS/M8u7PwMH3DGP/8UKihMZbDxNImHi91jNimAeAAXcfPCmgyafr4jWzV53+\nUMey\r\n=s55X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDukFuGm9narkvBK1dJrqjm23YgKUnb+isyxYNMqhq8rwIhAMfksYd1+FhUO5ALaL+hron4uYPXlsgYQabL1LAM/YqH"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.16_1548740431855_0.29220239884591326"},"_hasShrinkwrap":false},"0.8.0-alpha.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.8.0-alpha.1","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"25786e1776d364de6a8a49e0f5b8a6a0da065ae3","_id":"messaging-api-messenger@0.8.0-alpha.1","dist":{"shasum":"57b04aab529d004ac56fdc4a9243b47a5f6dfa49","integrity":"sha512-oVlQT0bQKf2pjWlfz5G/QWlpgOPY5dk4DutfR4RN25BRS1r7qXNFisEdi8j+cZfxTgU2LUNwD4VBnbfRToiLFQ==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.0-alpha.1.tgz","fileCount":29,"unpackedSize":492699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUZgzCRA9TVsSAnZWagAATqMP/RFHUFWlIPS1s5e2Gi0W\n/54e555Xh2+YB7fzvYhEHCVOVvchsfFuc4HMlRpKwVgdtfS1EBPLIqRt5Dfb\n1BGkjT1DeAq5TTjqLEdxpdXyUkez1M5esjoEdSp2cs08vRS9Zm9JcS/u8Yuy\n59EGZO6I4KR6UuKEpBMKWgAP2Y9hLgKz2NIUVyPBXJvMb35npt5H4ajfkHBQ\nvb3qgi7xjyUvH2rjZehgUafEtRWn7e/fzOxwaoRmAbB1pFOebzHahyu38W7+\nOAZIYXbQ5OWGIahYO2RhQwtrRtm0gdb9uACFAzUn6UwESDlgYtezZsWikFd8\n3B7Euv49VeUAqMhnG1N7kBtkI4O0fNwfrlUKMns+NXcZLSZ2fDilPTQ0NHAA\nOqCRZOddO1xVCmsrnbdlN8uwd6y3wRvTjS0X6fWpH5M5agbZR4iSCrs2w2rb\n0C3c7qspFpbCXQLtf55C+mV0COW+YptxWenBHa6T6F8BbuvRduKXlNAkv8/F\nooRiH1PJ2bqmkLcOeZBvH0B8ZxgLBvRf/BJIfsu3m8IxXe5snGsjJ8SCD7pM\nFeaDIB6wWcv1OUyYjTeYy8L9s+eXLXPkBCi0WvjhJR7I7v4FnspdGqoL4xdi\nWZbxwKEMTNrw4jxo7LxSTjZJslu0EMbNGCredT5Tu/Y1N/lIwK+eaT9pPqkK\ntpUy\r\n=JnvO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZX+ywauaV3sWCwp2mjJhExRMXeRsGfe29NJOdd7qKPAiEAoNTZRkd3oldHQs+XxHOHxTGmIFbAXywciez9+lcrJvI="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.0-alpha.1_1548851249981_0.34833052801197995"},"_hasShrinkwrap":false},"0.8.0-alpha.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.8.0-alpha.2","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"e62a49823a44daea60846201318790b1cf0e8135","_id":"messaging-api-messenger@0.8.0-alpha.2","dist":{"shasum":"25ccf8c3ebecdd5931c16febe210e6e7ec41d9fe","integrity":"sha512-atIbzOivxE518bvmyz3mB/gMt3XcFYn70o4f9c4JyjC1yLTlWMKB8eN/Zf83K301i4PWS6Ubdh+a+BsmPs2wxw==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.0-alpha.2.tgz","fileCount":29,"unpackedSize":492699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccQI1CRA9TVsSAnZWagAAjgYP/i8Pa5hRPSI6vnapm17k\n4TrzH1KFphgKXbSOZro/NAeU/wkoLDpjcMvRBFxg4LVmCGVxdwMbJ/jBHSLH\noViJ8RPPgucohGTlSNV51G0Hi91AqnqxeEUfT72RaSItTEizZVdHgmyGbImH\nKKjttr2gl6u3CCFlM6O4hCMZIXuq/eXqT/mVHf7EbsFgHHgjJ/IdjgfoXKiI\nAMh321PrytmhGDOETb8ewnccrNs3WuEsMTJved/V5q32IWpWA46Gb0a0Hk5H\n0xB/pMt1xkNELHhLXV16f5py4fal6Oyd4+y5XQ11+evTYxRhOMv9he+iiiQb\nPXC0xY44a+upZumwkYgrjIsSK0nrZ7DCUN4ObaJqyiD6S/LwtChVpJFHwhkd\naJCbRBxEz6uleJzelRsRym3sL4rjzcyLgrqAX0eLF8qrCAeuv4kOTb0L43nK\nOVP4WYwo5sJ/cjQ2MhkPrVJn2IGK7sEXN6e3PRpXeFS/JOXQ6kaENNqtiUae\nr/WzWEP73JheestFt555Cw68EoY2mfJB8qFaGhyidQB7Ujq6t/f4ei9KH9Vu\nx9MLCOpi2jzsYxbkxGpafCZ3bpcTHnJwrKdGRxYseeRPP8k/WKEhZc0viyNO\nhZkh6vY0h+YdrOhLyADfxDBFitni2AmbzH6L4StE2D3CQ3LaSOC0s0W/5+9H\nby+B\r\n=luWN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxK8EQ8TM3m/GLLpjN/iB7JGtavYbQuucrwvXhTr4wiwIhAIIWqyHpOPkgZnLleVLHyObZKNPeirmhArg7/nyD38lS"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.0-alpha.2_1550910004392_0.048508722966632334"},"_hasShrinkwrap":false},"0.8.0-alpha.3":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.8.0-alpha.3","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"df6a99567f7d6b7f8f85372e8538a1015885249b","_id":"messaging-api-messenger@0.8.0-alpha.3","dist":{"shasum":"e1d13dd924145873958cd658a37efda74045de85","integrity":"sha512-AZ4Slr9GfEl53TQCxWoyFvJ/K7pZzc3lAZD8/aTE1z2HB8alJYC+Pb8rDPo56D5NHH+lpKOaJuc2LF4fcZK4XA==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.0-alpha.3.tgz","fileCount":29,"unpackedSize":493514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcf6j5CRA9TVsSAnZWagAAVZYP/i/2Cx3AsA99RohIbTUF\nabS+/lxMc5rHfFtNa6qzSlJ8ThowRMoM6gW3IqIVz7sGXPTskN/vfP0IQmbP\nLZk/M9oorPkNM/rT3PI9CP5drFLzFVggrHrMMG2pzlZ+Ix0TgdtE7TghKfLk\nFPhqRgq7Zkycu+HLS2UDHL1rEQUGu/8mm2n/XEdl2KimCKe2AKzhBVrlXW6g\nI1pfuy2Wad8tvk1OKxf/mHOHzrvg5UqTv/pkbw/N0FJ+6gCy+fG/41SyAEee\nySEGxysMUGPtjMfpOLoI7ICZ0+kdMl8dZMpqkkFmjveZlcO7f7ug6DCRk09e\ngzToD+xHIYpl0phjhMRsTvnpLQPeScLDeaJKweIEdKhSYpqnKknAcS9fe5/4\naal1laENflSBO06mwC1LBFtCUFhN8i7cyLnE4o5tD2dAbieaUzn9Hcphu0XU\nDR6iyqxXThfytCTQUfyuGwytQqHcGeZRzlgX/dy2f/fIVuKJEj/GGelAaFPL\n06jvKgNkG33bgG8mCbMN5Hc37s3MvQl1MAjj47+/QjcgC057HpCDRuy1k2hg\n/TyS22RN86S5tssXAlfDD3dP6XELv5vJTBdvEkdBxiWYP8QVR9JrcBsbY+yb\nv2o1OegDT3nOfQCx8uuV7VVqEQLduQbY9Nb0gXPCO0ivqPQTXfneJ76ZaaKt\ntWmR\r\n=NiGY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYe+24h3NXgn0Jwud5glye8nbTrnqHpyBv7bRZodb9PgIhAMo9v+JqUaW+SClOpp/UQhyPEkP/WYmjiIWns3EiMRup"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.0-alpha.3_1551870200888_0.13506154136838333"},"_hasShrinkwrap":false},"0.8.0-alpha.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.8.0-alpha.4","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"ffaa89b583a64f6478a1c97ae47366056d1bde29","_id":"messaging-api-messenger@0.8.0-alpha.4","dist":{"shasum":"2cb82722e5793c74fb0e786881c3a49cfe7ffb4d","integrity":"sha512-eC2ZESkFq9uZ7Q8gGYPl9DphSyZtmsCvcvmt5v8gpv12by/aS2ritXw+boyKM48xppbTzbaaTYFgg28PehRDjQ==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.0-alpha.4.tgz","fileCount":29,"unpackedSize":493506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgJ68CRA9TVsSAnZWagAArbAQAIYU/6VOXjpQq0nVsCWJ\nev57bGzPuFtqnmtjIZs6N9w8jq0EGjSQY5P3lDqROkP3jQu6II4nFYOzXrY3\nQzNBsa+9CXXOC6eQjFP3xODl1ramFWFDV4XEIRMyij23uEO59fP9Gn1hFNGs\nK+TC3e7eskdF/16VBPfRV+XCEbtpCa+8+Du7H8ksR4EU5EtKFDUZ+qHyDVfA\nJbMYgpOUb92DbB/2VwNEbLhtG+LZhJUgWb9AfGd6aZVk8Dp2F7DxAxM28QlM\n+md3R3Tm3SzX43Lhf49aRNOfCfFcQmbzzTY0hEn1Zs9w2ocdVoIwmCdmQtDV\ncIKQVPP5AMaFnRGINJgqQrtv5BKPmp3eAS88vgUgfYGQi5MYePrQL68JH6bE\nKdtTgALAzweVb1uTgGFlSzgQa79fDMAkIw7jcYXt7+O90VccgEHDZU+eS2mb\nXo3u7wyDnuCAW03GZ25WhIxiemDEbQGaiS6oojj4irN+ie82nkAixT4AbHJp\nh5KpqYBiuTK4qOVJA+AP77BoRVfm6034F4wLTDb4Fyyg4emzMTvJwXGw10Us\nDCkrhWA63695c0zN/viDa18/Htk7zzRB/pjz4F57pc2hOPjn3yjenG8eFiRn\n5ndYCFHDFlmePB+vgIWfkP+m//NWJp/yqHBFmTovaeKfOrXQT55OVBVLxtq/\nRuHo\r\n=Pxxi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBJMahQrBIOVvibahPx9EBBmhZBXUAfOs0vKEC3Qel+gIgUNHv+luz0ROCx0HVHYyVrI7lfJSfaVcB6gBLoblbvWM="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.0-alpha.4_1551933115429_0.6681078236264981"},"_hasShrinkwrap":false},"0.8.0-alpha.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.8.0-alpha.5","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"a05c4572475a587733b046c67b970103dac64b8c","_id":"messaging-api-messenger@0.8.0-alpha.5","dist":{"shasum":"ee16f23c959e764824d3af3df93a11c8c5132e78","integrity":"sha512-pZVl+VX9pkvilwsRhmH/Xn4tjABioFEViauir7aXa0DkeVWRqQn8B7004Ub1WrhvmIpzHhpmcayI5WRU98MbJw==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.0-alpha.5.tgz","fileCount":29,"unpackedSize":495516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgPoQCRA9TVsSAnZWagAAL/oQAIBIqQS+1jJToKu37Q+E\nMbZtdDanOq97y5mYXcdy9YC8Zjz/ec+MHMdA5IOErny4DxQjtRlgQlmQoSfC\nxtThegJnfcnhDnr6YQDcUbJZku3RZblXy3ajffx2gpLd7+79pndpxIheGgPl\ngT7m0WsuDfub9+vKEC7keYjiF8oK4UEhGnz1jnAETmLZMUrMGRFcZmnGIQ6q\nHS8+/Q1h8pHSg5c/8toQvPHNFVNqEKmxUHlefJJ/cKbcGEVrv7f8BKUqOJhd\n+dr84XycFiV8UGMTbttP4D2Xl47g0FjEVOEPmieJcz9sIHpkW3PqJwV5RyYM\nrLk8TXrheqY0ELE1mA1WwEXULd/KzOHDaqL0kOo6nqmLVT6Ieen55COtJz8v\nDb4ay0PzQdfPXwbpSrEpCyYEkvlZsKJPNWaa5k6Gawh7Ka1z/gxjHM3jsp2x\nfCNV6nGtGVFRMLDX1jos0+0is2TSfXzvvrKzl84ICRI9SHgsdFCEDJixQ+y8\n4pyie8ajRUtWftA27dSDJ9h5F0MWM3lAMLmtT+wUYhmLQ8haGVNC06t5qtdy\nB9DmqUxtr3n6OlwZajkBqsUgMqhgUEIQtRO8lAnUnfNSvXdlrKUB/cRiLOyD\nCf4apAawOEGFoDqRv3CN1DzCrSQ7KEQU2+y95kpUEFYsU62aueVdr8GV+XGe\ncjsM\r\n=CXav\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChJpN19mD9XYGO2qjFPIN4Iox/R2ZkndnSBgs86bo91wIhAPjRqvR80EETRIIK/AN76gBS7Nx6HEEGwxoCz49WDtOJ"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.0-alpha.5_1551956495168_0.3134155061487125"},"_hasShrinkwrap":false},"0.8.0-alpha.6":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.8.0-alpha.6","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"4cb66f703f9e2f5bf979d77a97342e95301fb7c0","_id":"messaging-api-messenger@0.8.0-alpha.6","dist":{"shasum":"145bf56109a298b51a02c33b15889249d2ae0422","integrity":"sha512-NJsE1n5GVM64Ow36fq38fiSM0L7ZQVmnpW++etix0ACfH1QeLmRRfX28erYHLDayR4Lgfe+dd2vKmTda+3Ka6Q==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.0-alpha.6.tgz","fileCount":29,"unpackedSize":495483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcge32CRA9TVsSAnZWagAARPAQAJQ78v2Kxe4JFc1nVIY/\nWerGKlu5wBgjCFhM++Po0QNPVAm0KutHnoYVDjibKupnpr6ULvt81nrd01RP\n+b56z5sx4EtvI6De1O8tYdJ0mB5clUvHcfMi3lU8bnMs5Ubb+1BgMQDWTzNT\nxMVYiTeSbnBMTkgRoHtzm8xj24brrrSK6jfChpRqyaaeXKD6PGTPv+/ilr4o\na75JPsRHmKf3VkdEz3CBHVsaA/FpTgN/Dpqc0fxbdjzZ1qFU/IPxzbWEZeo1\n6W+A+XGJhFu68PLXu4rdl+93jvZHW+27ljPwLMVVNo8WFHfwvy14n4daAKIP\nMr+Op3sCm1u51FTyM0NkX3FW/wASLNp3lx6gfWuD/z+s4zLxNglQwtCGmIy3\n97j1ZW47WxwkqMOQqQC0qy5sfBZbvLy8UGVyFTzPlBnBwPvFpPMBuJq0qcqs\nL0U9PBt3NdDrQ5quipLc5pYbsrscWoOvDvKATs671pg+QBMaloFzYYgd9awa\nbTfvi8NNgYZSBXuZrPq4uPjYRJZxH+cUYhN8wQPl38nmEJC7eW+8CsKxA6as\nFlmXVmTjGVOmITngDYcc5DWvtKTt8HM52phxXhatZSCUvqgWefQ7GttijpPl\nCjHKDg8EJdIH+yIO7jtF3FtkjeHBBpaYNOi3L5hBbT1wi29tsGK1pGxe1dxC\nzG1T\r\n=FknJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID2gxkh2hLDmdNrMYesDNSZ9VFTwnpucw/k9CQihMRoKAiAhqe8rRoy9Rqs6o9s4exAQj+ATvou8/QYy4TJ0pQeXwg=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.0-alpha.6_1552018933806_0.5412488432070344"},"_hasShrinkwrap":false},"0.8.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.8.0","engines":{"node":">=6"},"repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.19.0","axios-error":"^0.8.0","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"62a2ec0cb939605bf01a6054b9ccce9f9bb8e1d7","_id":"messaging-api-messenger@0.8.0","dist":{"shasum":"55ba1e89a58a2e1425895e62d19f6e7425aba098","integrity":"sha512-/Ii8D3z039n1D6oIxTdAV+oGs0il6E7EB4NpK2vptZrwcZzB9lRMXrmWTGgyu3tnwpWtca2zK177YvysGtqZPQ==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.0.tgz","fileCount":29,"unpackedSize":484962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdY69ACRA9TVsSAnZWagAAnFUQAJJeoZdcnIVoEZUc5e1L\n2/TrVwsag9OIFWS+sM/vgG0DItTGpaFP3WFRMW+SXzzHmqHjNnAn4AwEschB\nPfm2Ykl80jPVnCttQvdvxBw/1eZCKp3FhNDtIRyic8sDSqodgXJFEQP6NHJy\nLHHdOsw6sItl1YA7X+AYXfTEfLfhcvq7jcwfmRt4dAk4ZUOUD2IHCeVNHLPX\nRKuKxbzHJ299frBGwcUgeXPioHrgI2HZ9Ei/cSRWSX8POO7LzEM3CHHYoKlk\n/WBTMZdOGc8e3tVfJAJBn8h3lNZUdRJ2PSgc9nHHbXfl8VRE0+WNFrLdeTw2\ndFIgRur/ozKGhsAA68xmSgSO/DoQuWr36BL7VLwoIdFz1UD2s7BeBBjugebB\n9f3Dn5ygnEyBYrlkE70GZDvCxkyu+VXjbXrHvyhQD9HIavV8RhQeBCLotMSM\npYKUqzDA8+Eey709XoG4PV16Lq9YoRhumt58S7ZW0q31C+48SUIG/it/pO3U\nkeNaNHUS2uvlJqDVHzYyWHgCbLAl39TkfKthLfZ1V4XQ7OpCMyqpTEUze9oO\ndzSFHXdmnhidqwzIaHXrC9Y3UrUQfX6Z724dpH26VK2sdR65TbSCc+A+aV/2\ndLz1dqmTccNfP6NFgdpjdsaTfI2L+GcacP8OyF4K0tVYqffY2IZct/dAv8bl\nto0v\r\n=mWoo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjqVjSyAODe5CA5XyePoCrPgy8u8m56ToJDDQkNikAAAiBSMUiCcVeUd9Ur9DlGSJC3lLcSoYGWACSR5BcZ449YDw=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.0_1566814016057_0.13737693284009045"},"_hasShrinkwrap":false},"0.8.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"0.8.1","main":"lib/index.js","browser":"lib/browser.js","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^0.8.1","debug":"^4.1.1","form-data":"^2.5.0","invariant":"^2.2.4","is-plain-object":"^3.0.0","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"622f5664634c26e752e4e54bd32dbc773271390f","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.8.1","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-K5BOuxl30WGCGPBgNi00CVXRKDqQxsgrWDBN1nfOX4jO6JZkFQ7RxSlK8Bzbb/DEcLceVWlMfFr8E4sxP2BXIg==","shasum":"168eb6f7b7d36051b6e4cc19c298ffbf2d24acb9","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.1.tgz","fileCount":29,"unpackedSize":487349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZKydCRA9TVsSAnZWagAAv8sP/3SOfDjayPrs8AendDOc\nhm+qZsCKIKKfem6Llei8tNh/zYGzSrVRqTgTDHJGPSgQJlGMnSC1VwnsH5Ib\nqE6heAhsaaQrVebGgqX0PjgKi5MM9JRCSCZHMbF+9657d767zYsgsora8INQ\n6QkUvkOxUCiGp2iHA3Ettpp4Rnu+2tSazm8BGEj4XRRdIuy3ENCGBPxe+MYM\nR08OYKkd9I0N47A18jgwLj2AAIS3S/JHMPtbi/u+D9YPb1T+STF6dyM/kyJ9\nxZiSfkDyn4il+x+DFm3GWhKwFl+f8MRpmWQRiRE1lP4Ff6WrDzDirjv/u0K1\niztIJOybIW9me17uwJKiZzd4aoK4D9f+GSkXOxjCioYWyIx3TzUsD1YRcYRG\nhD86PQmrvE/+eJbjQhjsbNEIruEWzqIJz2z4V3+JvTa3Y5f2rArLbhbd7w2v\nY0C09I7slq8IyjTiWF2RRovV/D7e2mGvnH7nRF1QZLN8k6DtVZ6wSmr63s4+\nuSCuaSoOvpQttw3U+1L/gkf8q8Kp0L2yF5vwXUWXEFdWmpU4EQcmplApuDhg\n4BDz7/t7Iyq35ri2kuk3U1NRnx9Wu7LZog7Ma2sidolCl4l1s4TPxJmdbDrg\nABdSI3MF9tMbcGZBUq+afhdYBOTk7m+qoWea85DO8eZ8KutVgN4+YBpgshJv\nt+pV\r\n=rPjN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaH25q+g6w+WNS6DvEOxiTHnXjF4t2ujLyJebRtL2V1gIgC8EbHx3Ch5eexu9FTRXsoJjYAxblbKpN+lg82ciEvVE="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.1_1566878876948_0.9126840277486812"},"_hasShrinkwrap":false},"0.8.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"0.8.2","main":"lib/index.js","browser":"lib/browser.js","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^0.8.1","debug":"^4.1.1","form-data":"^2.5.0","invariant":"^2.2.4","is-plain-object":"^3.0.0","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"c17141765b6417272bfb1a51b19c0b6ae2c7137b","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.8.2","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-wMG77E88P9tfkP5uao1NC9xiumfti0wKGAKtdzSnLTrXWFkZiAEwaf+pcQpNK68SEt3S2iJ22/LYneYEDeAjlw==","shasum":"293b447280a10ed6887e4498c16cd22f10c25ad0","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.2.tgz","fileCount":29,"unpackedSize":487389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcLZACRA9TVsSAnZWagAABAsQAJIQUbGdSdAtrAaaJFq0\nxEfR2zmOtnocMXxq5DtpodyGHbZnoyhG9EhormG8sdwrwpowVVDCUIe8O6V/\nripDI0ENKrlNnFREDfzCj99uCFt5C7S2UH548TABLqjDd5ojeepD63OdomTm\nyCYqh/rwl0uIukezqUopKBV3S5I7HXvflFE8pJiFVhdxzf4kUSd18JUwiaM9\nu0JusqWDy52gSUkOQBwmpSv0ALm89bro90jqwdhsL0D8o7+Tzx64OqsYbu5I\nHw7svjXsAj6nQM0jqkIwpWdvH87BxktU/fRyPuLp6KlG3uqtqukjaZ05XkE+\nuAHUo7O6zZqi49GWxPgQVvu5B8tHinLAk+r9QoUojhr4Zw3GcRCAQbYpQnSW\n+SZF/8fsx+HBZU1Uemg0m1zSyJhjdvMIzQ0Ts93HwLR6b2zb8/4HHoB864Hx\n5pQ2RSouYx6jUW/xd+tCTE/zXOKbZV50fLx4NsCKut8DNU0o7cyEMWJvt2uq\n4h3k0i+uT87NyCOLpnc+lSlbAHrbc3FLd5IFf94KzD+i80pYSNswha+JCAQH\n8PFHzQ3AYq6WUT/a5dg+X/8YiwB/5YdjLscy/vQU1IDVVOjYkelMztUDjDjp\niRZUBZ/EbOsWm2nxY3jHRDR3RKbnQ+XW4tPIHLK+sfUDhOgBFsEW5KJ28UhS\nr3Zp\r\n=lIHz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL2tWfUBbCfFOPeN8oqj+PIWiREcQiUKHopIjkSjLxzAIhAKql5E1EjF0MEr1FZDub8mcMBt1/YRBWd9GMDkPq2p60"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.2_1567667776022_0.11739978195210488"},"_hasShrinkwrap":false},"1.0.0-alpha.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.0","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-alpha.0","form-data":"^2.5.0","invariant":"^2.2.4","is-plain-object":"^3.0.0","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.0","url-join":"^4.0.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"67490b1b2e7e842f4d1670d944d58a2bf11eb1e4","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-alpha.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-rvp0AvjoAGwMqCi/TCiWSLijl9hhUna7XCq2Fk1Ks9a4oOgJdaVljzX82jBgKOXTW533uvHhyE1FnPNUOA8Knw==","shasum":"50d0936d25f903f69c7de5063f67da35b2b7a461","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-alpha.0.tgz","fileCount":52,"unpackedSize":698374,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeMI0CRA9TVsSAnZWagAA3kcQAJn3VYnIzhhGtYCPW8c4\nSSMzpX7J5ZIZLj7DUjHVXs4yWsCAF9kpd4A1QdD9ruKpbn1580We96Hg1qv2\ngjPIyvklzNl05BdVbC9gcXCRyM2g3d9d5jSh/jfFP5FthYIeiLF4zmyeggKz\nBiDQkt8aLjxpaXSFFgr6BjJVjjO0u1mshXqyQjQpyVIDy1fQdwVWUck3/iSx\n57tlR/2b82pmxzCU/2QaD7BUMadrg7WpZwke10CNFT1kXkS+rhAPQZ15E/dN\nMRU57gmJZGhQTNxDyA2K16ciQffICG/ADdB61fJXAXGe1OXR6IbXuLe88CEw\nkC1E6wohE/7u6P4Ev/HZftRbpgq0mihYNPU43HiaBA8EgQFnMYz/t2oI8Wmf\n3HN84EFFg9Kf9XPvy/JttlUxta33l1vkr8ZKtUYCEJCLLZIfJ2jdZ1QKjdmm\n1CQDTHwOw6nADMaJp5YtakNToGrHvvXAOc+aHBWvUB5hRPtRpuggk9dZRMin\nsRGSijgx5gna8eavjIFAYO8QlR2zaJHvxakRE3z8EmoJXVTR5Nwo51x9Gb4F\n97VgvAznQTq+/Woa3cSYc7UHcZoNFPGV/2kpg+2jxHQSu9W3AC8iFERQGeIq\n4HXpVJ0iB/AJzCzMMOomfueJ0SU5cjwksyznjCulgGTZjVF3YTy+iYF7VQnE\nq6i+\r\n=LeV6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhofZnrvzAeCmwpx5sAiR95RQgPLpfSLBYkyXqZrQZlQIhAKljXH8XPJwcEt4plxXrA14EpYIvLbG7tJ5OI8cJZYPm"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-alpha.0_1568195123374_0.17699096490128885"},"_hasShrinkwrap":false},"1.0.0-alpha.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.2","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","form-data":"^2.5.0","invariant":"^2.2.4","is-plain-object":"^3.0.0","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.2","url-join":"^4.0.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"7581219e17a1b1d9ab2f600e14f75b9714dd6fa0","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Payment Settings](#payment-settings)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<a id=\"payment-settings\" />\n\n### Payment Settings - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/payment-settings)\n\n## `getPaymentSettings`\n\nRetrieves the current value of payment settings.\n\nExample:\n\n```js\nclient.getPaymentSettings().then(settings => {\n  console.log(settings);\n  // {\n  //   privacy_url: 'www.facebook.com',\n  //   public_key: 'YOUR_PUBLIC_KEY',\n  //   test_users: ['12345678'],\n  // }\n});\n```\n\n<br />\n\n## `setPaymentPrivacyPolicyURL(url)`\n\nSets the values of payment privacy policy URL.\n\n| Param | Type     | Description                 |\n| ----- | -------- | --------------------------- |\n| url   | `String` | Payment privacy policy URL. |\n\nExample:\n\n```js\nclient.setPaymentPrivacyPolicyURL('https://www.example.com');\n```\n\n<br />\n\n## `setPaymentPublicKey(key)`\n\nSets the values of payment public key.\n\n| Param | Type     | Description         |\n| ----- | -------- | ------------------- |\n| key   | `String` | payment public key. |\n\nExample:\n\n```js\nclient.setPaymentPublicKey('YOUR_PUBLIC_KEY');\n```\n\n<br />\n\n## `setPaymentTestUsers(users)`\n\nSets the values of payment test users.\n\n| Param | Type            | Description                                                  |\n| ----- | --------------- | ------------------------------------------------------------ |\n| users | `Array<String>` | Array of IDs for people that will test payments in your app. |\n\nExample:\n\n```js\nclient.setPaymentTestUsers(['12345678']);\n```\n\n<br />\n\n## `deletePaymentSettings`\n\nDeletes payment settings.\n\nExample:\n\n```js\nclient.deletePaymentSettings();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-alpha.2","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-Y8jyNDum7JJMZ6mKetHxCBebpQStpcnZsJ/bfLuK5j2PWGqYbjLudkDpFP4EDUfzEEAr0RqGYj0oU4ZrpdccCA==","shasum":"8a96f1c215609d2ecbde23753c90f377eb08f9e5","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-alpha.2.tgz","fileCount":52,"unpackedSize":732234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlugvCRA9TVsSAnZWagAA1WIP/RHCSwBNqug2IQrPktgA\nwfN7YeIE3vRy2obU5rEIax41sVp0efoglKYGDnM4rm9uMUDMxYFYLlEKey/K\nN0lPeX899/LG975w5tuR5FNyv25VuCZRH41EcPbJz9s/WQ5RRROm4CGpDhGi\n0kgNd+mk5wktx5zBpIR+7NRQVbVIG4Xyp7fMs2/PmFjCwZ2Tx/rJAXOYIUBa\nr7Nf6pCLkQszILG4PL0fw/uuC2SJj3+1mW3GJoqr9AlitnSam8WFdqdp6C5Q\nPRMi9ylpaIWk+phQXEZB3577m4OStq6MOLsgYNr0evCO5wbATXl5XbAMLeXv\nmeiMeizITpFXGl+BPCDbazGvwt8+bmngIXQYDGheZ2huSsihFzNxFy54HtAl\n7ZExNXfM4EgLJoRDOjRGk6GNr3bGBDQpwdjwVD5qBM79JF3p3/ayn+1SiaZv\nOjkwS87ZSQYuMqillkzO8OMYDMKFFyqP438/dFb3Xhbcm7m6zuq2vUzQOox6\nay+WnjBKySkJ/OvXfZiye6oQOKILEllLnA/mC0DepZZOSVMu04Hdv+0cHTc8\nLzAkXmERI51EH+8ZhukrGCc54NfnWwwLqLzO3TPVHD1q0hjPVRPepzV9Csm8\ngxf75GditFw63Gkk8U4B/vQmE+G+1bYFAj/Lwo1Ezwij3VwMnrmfff1njG/E\nCqjk\r\n=z2sa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFdcpKkBAl6datD6KVjGYOMkhV5xK9aqU/Eq4e7ncTBtAiAH/WMU3TAtDfb/ZaDEwAYf5ZRtr9rmU9iOU+siCy59Bw=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-alpha.2_1570170927397_0.17641140800420918"},"_hasShrinkwrap":false},"1.0.0-alpha.6":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.6","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","form-data":"^2.5.0","invariant":"^2.2.4","is-plain-object":"^3.0.0","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.2","url-join":"^4.0.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"7e2f8be9698b03e5b16a58e6b6ff5c094d514e62","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Payment Settings](#payment-settings)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<a id=\"payment-settings\" />\n\n### Payment Settings - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/payment-settings)\n\n## `getPaymentSettings`\n\nRetrieves the current value of payment settings.\n\nExample:\n\n```js\nclient.getPaymentSettings().then(settings => {\n  console.log(settings);\n  // {\n  //   privacy_url: 'www.facebook.com',\n  //   public_key: 'YOUR_PUBLIC_KEY',\n  //   test_users: ['12345678'],\n  // }\n});\n```\n\n<br />\n\n## `setPaymentPrivacyPolicyURL(url)`\n\nSets the values of payment privacy policy URL.\n\n| Param | Type     | Description                 |\n| ----- | -------- | --------------------------- |\n| url   | `String` | Payment privacy policy URL. |\n\nExample:\n\n```js\nclient.setPaymentPrivacyPolicyURL('https://www.example.com');\n```\n\n<br />\n\n## `setPaymentPublicKey(key)`\n\nSets the values of payment public key.\n\n| Param | Type     | Description         |\n| ----- | -------- | ------------------- |\n| key   | `String` | payment public key. |\n\nExample:\n\n```js\nclient.setPaymentPublicKey('YOUR_PUBLIC_KEY');\n```\n\n<br />\n\n## `setPaymentTestUsers(users)`\n\nSets the values of payment test users.\n\n| Param | Type            | Description                                                  |\n| ----- | --------------- | ------------------------------------------------------------ |\n| users | `Array<String>` | Array of IDs for people that will test payments in your app. |\n\nExample:\n\n```js\nclient.setPaymentTestUsers(['12345678']);\n```\n\n<br />\n\n## `deletePaymentSettings`\n\nDeletes payment settings.\n\nExample:\n\n```js\nclient.deletePaymentSettings();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-alpha.6","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-H7r5dVGpgzZ7e0P9wYFtUnC/JiI7qr49X+Gqcg26lkQnQUhSxkUCJxpnKUenv/NKFMXGmX+QiSm08cysBUo39A==","shasum":"a5de5280e2c5cdba74a244dfe2c214ca85abc3b5","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-alpha.6.tgz","fileCount":52,"unpackedSize":732276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyUj+CRA9TVsSAnZWagAA0yIP/3iG9lZ9DqiXxdU50WBE\nelBqQO5B/FUlGon0uboDPp8ZVietV6T02P37sYM4xxyq5pHRpP7dVWK7qXX1\neoQDBg0r7Y+8a3jSiMl1WR6nhZRXWip+uBKYA79i550B8J7cKpTZsR6OSlVZ\nAFRtXt20KhyzHjfaRw4wi6BzsP7M2nS/HzSSYe85uZFiymdDkQbI7lRTKq08\nI+9v37ThQUCzpl2BZ2SxJLN8YfamAb3aTiXvmc5NmrfjFGbS7G2lvMcjplUO\n/6ILT35qODjx8B5bmmF3l5e8zd8APdji1eRYloZm+0ejleCs0L57okS43+7m\nuTki8FbveOZ1uLJHrxlKgZa2NSKsd3QEwQ5KAgmAXVa44iK+2NQZ3dZKG6Y9\n3FRdnTHU18EHweS2v3NkifTlJljk4dSfp/QYB144CillZhFn3yd1G7HzTluh\njYsT2cT6XXhyJ9lJ7KAJ3ZDRGZlMbOk1aqlZbLBxiWpsB0ooUmoSKUD1D/sZ\nheGKuDcJvBfE/4gvLn0zIdmoeNcdo5MpVwUxqa/6rKBnxWBBbEdS3U3P8kEQ\nuEJEQFcpl6bEhrlcSFlqu+3nt9r/8lAiCgo/iEz3F9UfXwouXNYDIfz+u+dN\nim+YtjQRWhaVQRivo2tQEMKZtLWce/LzWA5fRZhgyETYWPQg4eaMg3iLJ5qf\n4cqx\r\n=5x+t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFRS4EPF6wOrSTZIaMt2nST6h1RT8zO0dJZuNLqBmWo3AiBpwDS/K83POSyZ3+E06yGaruA+SGuxEVNym6S6S6dbGA=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-alpha.6_1573472510341_0.4916551326126788"},"_hasShrinkwrap":false},"1.0.0-beta.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.0","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","form-data":"^2.5.0","invariant":"^2.2.4","is-plain-object":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.0","url-join":"^4.0.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"96eaeb0fc0b1bf8799d17dd93aa4c59f1eeeb0f3","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Payment Settings](#payment-settings)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<a id=\"payment-settings\" />\n\n### Payment Settings - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/payment-settings)\n\n## `getPaymentSettings`\n\nRetrieves the current value of payment settings.\n\nExample:\n\n```js\nclient.getPaymentSettings().then(settings => {\n  console.log(settings);\n  // {\n  //   privacy_url: 'www.facebook.com',\n  //   public_key: 'YOUR_PUBLIC_KEY',\n  //   test_users: ['12345678'],\n  // }\n});\n```\n\n<br />\n\n## `setPaymentPrivacyPolicyURL(url)`\n\nSets the values of payment privacy policy URL.\n\n| Param | Type     | Description                 |\n| ----- | -------- | --------------------------- |\n| url   | `String` | Payment privacy policy URL. |\n\nExample:\n\n```js\nclient.setPaymentPrivacyPolicyURL('https://www.example.com');\n```\n\n<br />\n\n## `setPaymentPublicKey(key)`\n\nSets the values of payment public key.\n\n| Param | Type     | Description         |\n| ----- | -------- | ------------------- |\n| key   | `String` | payment public key. |\n\nExample:\n\n```js\nclient.setPaymentPublicKey('YOUR_PUBLIC_KEY');\n```\n\n<br />\n\n## `setPaymentTestUsers(users)`\n\nSets the values of payment test users.\n\n| Param | Type            | Description                                                  |\n| ----- | --------------- | ------------------------------------------------------------ |\n| users | `Array<String>` | Array of IDs for people that will test payments in your app. |\n\nExample:\n\n```js\nclient.setPaymentTestUsers(['12345678']);\n```\n\n<br />\n\n## `deletePaymentSettings`\n\nDeletes payment settings.\n\nExample:\n\n```js\nclient.deletePaymentSettings();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-8ripuOZeMb3sja0FdmsVIZnB8wq5tE/JWUigW7QPoK70bjCy10bnbmA49q+AiomKTS81TVYqesRJtMtFMMhPqQ==","shasum":"2969e982ef0900d12ac923c0c0ff27d299ce3e73","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.0.tgz","fileCount":46,"unpackedSize":685612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzP/5CRA9TVsSAnZWagAA7PMQAJgLUWLONtdmPFlZSAVr\n8iI9U1bu6nSeoK8DgGfACbnQIagBPHlq9Ze/rRTX2cBKOYXlsQ3NoJIbycwh\nef/vv6N9TimiNi6AKbuv94R/pmtPtboSCh7ggo9NBAcqxAno/REoGDIV1Nej\n6Ect3a9BFE1ZqfFygtLB6xtCQvjo8X3ltS8vsuvfd7DIXC9JViG+NqgfFApG\nraOEtBn5ZZT1//z4rXEvAbs9oZdSFhTezcCpCcoUKt5O0AAGTyY+2jhlxpjl\nMgj/OIPf3SG/i7g/ff4ToBBbIyo6dl/yKA8UEn6r2KLX3jrQwLTfOV5/2RHI\nuCQaumErdGFZaSg0DpNSdht6LA+3HX0ME3iGZBbqzo1j/0H9xnyhEgCmxA2X\nnP1MJwzYF1aszSmjJhgvDD/PWXvZdEgMkc4f7Mzwe9PLWr30qmNdw20uLKs0\nmj291v9AyHqxXYwJrK1swNYVf5QrW8r7ivJ5robaO3h1mUW5uwe1/vFAWkeW\n4E5vVQXiIR+tJYi8f6ov1yKjivtXtFcaq7jlOA+9TguQfSbbWQFFECbOlQPi\nomUouhmjIxMaP68j32yD3T8bE5SRj2JcQ/y5VgXhq5PTee7QPejNtLViPJHa\nxPCkm8aoJFEa54bjzjllalaOFR3gTyv0VakzWPnMKqryyRnb0oVxHfykvDWF\n9TeD\r\n=WCo5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6uHRCBy608KqPdrk0sCHmAYL03T7qhA9ysAfdz99COAiBijM0JcQeqjE2yrkCsIKjacoofMi7bxIP8xZbugtlykQ=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.0_1573715961278_0.21611682984440406"},"_hasShrinkwrap":false},"1.0.0-beta.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.1","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-beta.1","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"c92c8cdb79d62893a7c07f5208a5234f7bfc00cb","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Payment Settings](#payment-settings)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<a id=\"payment-settings\" />\n\n### Payment Settings - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/payment-settings)\n\n## `getPaymentSettings`\n\nRetrieves the current value of payment settings.\n\nExample:\n\n```js\nclient.getPaymentSettings().then(settings => {\n  console.log(settings);\n  // {\n  //   privacy_url: 'www.facebook.com',\n  //   public_key: 'YOUR_PUBLIC_KEY',\n  //   test_users: ['12345678'],\n  // }\n});\n```\n\n<br />\n\n## `setPaymentPrivacyPolicyURL(url)`\n\nSets the values of payment privacy policy URL.\n\n| Param | Type     | Description                 |\n| ----- | -------- | --------------------------- |\n| url   | `String` | Payment privacy policy URL. |\n\nExample:\n\n```js\nclient.setPaymentPrivacyPolicyURL('https://www.example.com');\n```\n\n<br />\n\n## `setPaymentPublicKey(key)`\n\nSets the values of payment public key.\n\n| Param | Type     | Description         |\n| ----- | -------- | ------------------- |\n| key   | `String` | payment public key. |\n\nExample:\n\n```js\nclient.setPaymentPublicKey('YOUR_PUBLIC_KEY');\n```\n\n<br />\n\n## `setPaymentTestUsers(users)`\n\nSets the values of payment test users.\n\n| Param | Type            | Description                                                  |\n| ----- | --------------- | ------------------------------------------------------------ |\n| users | `Array<String>` | Array of IDs for people that will test payments in your app. |\n\nExample:\n\n```js\nclient.setPaymentTestUsers(['12345678']);\n```\n\n<br />\n\n## `deletePaymentSettings`\n\nDeletes payment settings.\n\nExample:\n\n```js\nclient.deletePaymentSettings();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.1","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-PeJReiQV1kAkKXaNMq2bUGOCfw0ZlPkldyGoLHqtSZEbkgkkVynN/qHiNR14eJpLL1wvsccIqzbxahGFLshuFQ==","shasum":"7e23b32a8b2b5e2c9092341d07e84a2943af9c05","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.1.tgz","fileCount":46,"unpackedSize":680520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0BYQCRA9TVsSAnZWagAAubkP/0fg8GAHqqL/7imdjTzm\n+hBbsx92WeHMGor16n17WLmeVy2Gnk0WbBvCYM0qjfBCy3fWiYd9+CcYEKZz\nrd0+2HVS8vBpEPbo2HUXM6qWOM5rNIZ4g71OeWDY/2hA3sWbRzGwjgVDJwES\nY79lU50ysVRLBE1ftxY3VTk1vsJB6ZaT/uhlj1r6lJunge7iR0G8kOBpURwa\nSmdt+df4ZmX88kYTlHmFOIlKeWhcWzmrmGbqAI60nenwldGUxUhRBLE5AMNy\nuMF1GuQ1nASOg5anV3q1tCCpuFoD1Rv3u9zww1iayRKFt/Flrhc6psBeMCDd\nV3+ZNw4npX74qsOe8gS5PyAl70Xo1Re8qSw9TK6vXVo+Wy1M+qOI9TQ4Alzj\nSIlaS5mYt+rW9A3gTbkYxNeoEoBc8HZURie0mth0wmldhdegesrqZ2fkitX0\nYmxUqiR4QFktQlvu5Pp+GaOZjuWIx0aX4UjVzw/+FUsf2Ze50z0ogpvu/0CX\n5DZcA9jhO7C8rItHtmVxxFuNfANGWp9v8jFuTRPLD8WqecKLA46iSxLyEGqY\nvnQH6NxhfK0T7dN/6IWOgykpQ2XE+gP00CG/z+an9y2T5xw1j1GqoRtwjNTG\n/WtnHzo1oNX3XtN7p7VcjMk1LWmGTtmHKMzSsIHALV4lhO3SlPtja9dLuIGp\nmMlj\r\n=AoQJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC5U6A9N+GAocadlmSYJ+kSX+gFxypkRx4MwWrBd5xHgIhAPCYMd6srsvZH/9v5dF0MDe3Okjtz7sKYxZ4qQVgMfDQ"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.1_1573918224276_0.2494514179972258"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.2","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-beta.2","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.2","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"142b0193efd5babac07cf7280545f7ea202deaea","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Payment Settings](#payment-settings)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<a id=\"payment-settings\" />\n\n### Payment Settings - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/payment-settings)\n\n## `getPaymentSettings`\n\nRetrieves the current value of payment settings.\n\nExample:\n\n```js\nclient.getPaymentSettings().then(settings => {\n  console.log(settings);\n  // {\n  //   privacy_url: 'www.facebook.com',\n  //   public_key: 'YOUR_PUBLIC_KEY',\n  //   test_users: ['12345678'],\n  // }\n});\n```\n\n<br />\n\n## `setPaymentPrivacyPolicyURL(url)`\n\nSets the values of payment privacy policy URL.\n\n| Param | Type     | Description                 |\n| ----- | -------- | --------------------------- |\n| url   | `String` | Payment privacy policy URL. |\n\nExample:\n\n```js\nclient.setPaymentPrivacyPolicyURL('https://www.example.com');\n```\n\n<br />\n\n## `setPaymentPublicKey(key)`\n\nSets the values of payment public key.\n\n| Param | Type     | Description         |\n| ----- | -------- | ------------------- |\n| key   | `String` | payment public key. |\n\nExample:\n\n```js\nclient.setPaymentPublicKey('YOUR_PUBLIC_KEY');\n```\n\n<br />\n\n## `setPaymentTestUsers(users)`\n\nSets the values of payment test users.\n\n| Param | Type            | Description                                                  |\n| ----- | --------------- | ------------------------------------------------------------ |\n| users | `Array<String>` | Array of IDs for people that will test payments in your app. |\n\nExample:\n\n```js\nclient.setPaymentTestUsers(['12345678']);\n```\n\n<br />\n\n## `deletePaymentSettings`\n\nDeletes payment settings.\n\nExample:\n\n```js\nclient.deletePaymentSettings();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.2","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-bjhsA+I6SwC3v4P7PdjU70aIwGMQ1ChBYAeugYqeTYXUm6KFz2rW2Pgpq41Tj5mtD1Z2yKcSoO/NKfebdio3DA==","shasum":"f76158bf1aabf304535fd399b9564549f8f66655","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.2.tgz","fileCount":46,"unpackedSize":680520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd04OxCRA9TVsSAnZWagAAFeUP/RP7v01nEB/gxHp1mkH5\n7nUAMl3aBcMXKLBRjhMJorO0JRdXhgFZn/kD1Qho94Yw4gbNUtX9iCWn8Q3c\nZOoo6/boZMSCn9KACCtQk1cm4mg8ECReHS8zgJysD5+mk3Iqcg9H72tR4PBs\nJ4wJWtKoK9dsqKxTl5I0JrPVYkQKN9LPKwbFgrI/J5MbsY6FNgG9HwB/IXg7\n6jC6VlRJFjJUkqEHufRT8hCXFmWGANqV0U0JWfd2qOr6oGEfLqyKwLNKuTTF\nah9qJYadaCzUDIV+vOQnz4tX0i3Ee+N14fcpHL5pOA/GnvHj3dXR88c9eWZk\np2yMeSjHb/KoRVa80KzKoWo5Dx1MgihtIYpcgw5eJiSkwV+ioPirT1c/q+7Y\n4jYQkjkKMrjqo0IqFXvcbtJU2erNRETeTaBUuG18fJhSwq2uOQ7jtzDeVsMd\npUOMj5kAwtAzwmOIieApNF4FJvHh0A8Jl/f3y+Yx9383AZyXDsP93+Lho3r/\n7rF7OllL+q/8S39R5UrcxdGIkJyu9XZrdDxRZLBs9PQ/cVREHMf80QT76oRn\n13e19hQf3bWx/cToSBQ+025WN/vLkJylBGYFaRXx7sfbtz+mPhG0xuOW0ljD\nwn4GaF6Qn5BZVUEB5t1t8GNmJnjc22tzC18mCjenXtkEuK6kvDWcqNe0mxW/\n/G9S\r\n=5Z/i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDf5VwEptT62AbVzJ8qcWuWnWEwYoU39oUe1Sl03FnTUAIgSRmLpF89xNpSBpw9fs8hu6T66RSspF1tW+SXkt4fr3Q="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.2_1574142896627_0.03705940412794928"},"_hasShrinkwrap":false},"1.0.0-beta.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.4","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"file:../axios-error","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"file:../messaging-api-common","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.4","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-6H7/5RO9TEzjEcDWAzBUL+Tn4Mum2WqgIwoMkow5NDgwe6+rtWZHuApo/xdjYy1+k3AL85LIQ3GsG+XIH0lazg==","shasum":"2005ac519c7573495e256befd0057226e44220d5","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.4.tgz","fileCount":45,"unpackedSize":680747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd18T+CRA9TVsSAnZWagAAqCIP+wUUc0V6u4iPSWpvDnvJ\nAW7wl7POhnSoVEw8K3nvhwSh510JgBKBAraUenH4q0wn2VNKbVMYPCfVcD3p\nA57hJiXvmcWU26jSq/ZUaU9ZOvVSnmotp2Acr0RCtlYsVXqIMvOB7OSuA+0P\n/Sjswb+ToF42YPjHIboVfkuiZEyPyoDKtzXObfIrQPAZNV8j5ZuK1JiFkgQu\nG/HEDnmLsdqAX5VdLoLulWD/cCPswABJIeFymjZ4KG5I85yoJ9No1kWUS1I8\nCtua6noF23lNrt12o9F1Jk3Dvk2Tdmh6wLCuC4D0sEysh4/GK37zt7WyseJH\n46jMSZ3HH5DdtcGV35dIlLXy4Jq/BizdU84OwT19hjYC2rTCbLklOz36cwx0\nKbHFlE1A/UQ9MgrgVWV98pv8rhuYqU7wE0WlKgXCt7BF+KryviubSWcarq20\nSlxPJFYTj57CX17h9NgZ2rtM2ch1wG1FYqvLUorHGmXV+gz2hUVdzArV/1n1\nx95edSOVkoQSd+4OwGAWP64hbQ7CNX0SPvfwYRNTbUQovpPq2jbxHyqn7sk/\n8VjypzLFrmecDo/IzCWBFQItn+qfXvb8RE8z7urVKOAdBWFIOeenU+wImssE\npc9bb24QlbRdIk+uthb+dtJSNM5hTVaCI75MnEBjPtuuiWMzZhZyEqejGYri\nZ9yl\r\n=Ee13\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOGOOzCoJ8f+78w1bIyWCbANVQRktwZMgL0T0SpeQNwwIgFdd7AbeeMoqCrSjfmA3eRzZPdo/Q/JL7nYRZCT7PYBI="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.4_1574421757811_0.793517479180216"},"_hasShrinkwrap":false},"1.0.0-beta.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.5","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-beta.5","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"701efe776414a93d93d709198a72fc80991f51fc","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Payment Settings](#payment-settings)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<a id=\"payment-settings\" />\n\n### Payment Settings - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/payment-settings)\n\n## `getPaymentSettings`\n\nRetrieves the current value of payment settings.\n\nExample:\n\n```js\nclient.getPaymentSettings().then(settings => {\n  console.log(settings);\n  // {\n  //   privacy_url: 'www.facebook.com',\n  //   public_key: 'YOUR_PUBLIC_KEY',\n  //   test_users: ['12345678'],\n  // }\n});\n```\n\n<br />\n\n## `setPaymentPrivacyPolicyURL(url)`\n\nSets the values of payment privacy policy URL.\n\n| Param | Type     | Description                 |\n| ----- | -------- | --------------------------- |\n| url   | `String` | Payment privacy policy URL. |\n\nExample:\n\n```js\nclient.setPaymentPrivacyPolicyURL('https://www.example.com');\n```\n\n<br />\n\n## `setPaymentPublicKey(key)`\n\nSets the values of payment public key.\n\n| Param | Type     | Description         |\n| ----- | -------- | ------------------- |\n| key   | `String` | payment public key. |\n\nExample:\n\n```js\nclient.setPaymentPublicKey('YOUR_PUBLIC_KEY');\n```\n\n<br />\n\n## `setPaymentTestUsers(users)`\n\nSets the values of payment test users.\n\n| Param | Type            | Description                                                  |\n| ----- | --------------- | ------------------------------------------------------------ |\n| users | `Array<String>` | Array of IDs for people that will test payments in your app. |\n\nExample:\n\n```js\nclient.setPaymentTestUsers(['12345678']);\n```\n\n<br />\n\n## `deletePaymentSettings`\n\nDeletes payment settings.\n\nExample:\n\n```js\nclient.deletePaymentSettings();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.5","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-UGqvVzvShIyETY+w3iOMMpqkNs+jt3hB2MFVtqekeOMZUjVpQ3SYI0cnbs89zEisMCiGPNU5MrIWy/xtDd0fsg==","shasum":"3c4f6c396c2391faa3427293a798f62063496c42","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.5.tgz","fileCount":46,"unpackedSize":681899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1+qjCRA9TVsSAnZWagAAi3oP+QF0ux6jSb3672MvWFtO\n12MsdZ3bN9KNTD9Rb7y7W8pMzjP09Y/LJz6LCx2CFNYbIpz6G6sOvlOCfIJr\nN/vtUl7l031E9hmCwv0zFKiFIMdpuzU27msoI6xoWwvCmXiLZ6+4+Eku+z7z\n07BkZoKVEgo5ie05tgfFKCixePKbwKOQWCSZT53mkM6qRWUfNCLufVw4MvnF\nwcvhsRc3WESRvRWQKp1/V+9k7G+9V2kziKNs3zFmc7tMdbxjuxSE26nL6y7Q\nUb956YAPQLummO6lhV0uCHAs/UkktRlt05/iuVnADpMPhcF9n8H79zdyY+sW\nd2hDCxAgyrmzqie9z8VLm2jeaxLp6imjpW7eZKPdeqQyHPgE6KkqJTNrCpnc\n2RzzLKRpS08p0iz2s7yD1qtrdh8ajFN3EB61uqeEjMELlWlqkyEKgFhfk4cG\nnMDO8cip62dxMoCj0OxJ3DX6yTxFi2WCi+3kV07iw3ng7tgNQSvXUfrnoSDG\n48vF9mTzykYp3KHU60+G7iF8KtSLEK+sC9bQh8oEUxGUyVzMg/wYrps5MMNI\na4nC2BBxobV9La6uSLOmh5ZPyPYC6KzRqma0TzAVjyWMxUlALVTIbNuXgWF4\nOLWiwxcy0VuVW65ohcF9LBmnIzDpLcahVVTFSAsrnkLxbW9Cj2jTL2TegxG6\nqrtu\r\n=ZRcY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLnvZV+yPwiB77Twa3/dO/LAAalLXNw/cOKJthHgL+vwIgA/+OfVLzCuTEN+CvAESh3b3LesbkJO+6dbHIe7p5p64="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.5_1574431395007_0.36234138463848065"},"_hasShrinkwrap":false},"1.0.0-beta.10":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.10","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^1.0.0-beta.5","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"9ce7ddd82779b579beab4256d71ccd4599e6c58f","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Payment Settings](#payment-settings)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<a id=\"payment-settings\" />\n\n### Payment Settings - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/payment-settings)\n\n## `getPaymentSettings`\n\nRetrieves the current value of payment settings.\n\nExample:\n\n```js\nclient.getPaymentSettings().then(settings => {\n  console.log(settings);\n  // {\n  //   privacy_url: 'www.facebook.com',\n  //   public_key: 'YOUR_PUBLIC_KEY',\n  //   test_users: ['12345678'],\n  // }\n});\n```\n\n<br />\n\n## `setPaymentPrivacyPolicyURL(url)`\n\nSets the values of payment privacy policy URL.\n\n| Param | Type     | Description                 |\n| ----- | -------- | --------------------------- |\n| url   | `String` | Payment privacy policy URL. |\n\nExample:\n\n```js\nclient.setPaymentPrivacyPolicyURL('https://www.example.com');\n```\n\n<br />\n\n## `setPaymentPublicKey(key)`\n\nSets the values of payment public key.\n\n| Param | Type     | Description         |\n| ----- | -------- | ------------------- |\n| key   | `String` | payment public key. |\n\nExample:\n\n```js\nclient.setPaymentPublicKey('YOUR_PUBLIC_KEY');\n```\n\n<br />\n\n## `setPaymentTestUsers(users)`\n\nSets the values of payment test users.\n\n| Param | Type            | Description                                                  |\n| ----- | --------------- | ------------------------------------------------------------ |\n| users | `Array<String>` | Array of IDs for people that will test payments in your app. |\n\nExample:\n\n```js\nclient.setPaymentTestUsers(['12345678']);\n```\n\n<br />\n\n## `deletePaymentSettings`\n\nDeletes payment settings.\n\nExample:\n\n```js\nclient.deletePaymentSettings();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.10","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-y0Mi0OneGPS1MsjtI6rRUNVYuJtcvDWjJI+E0zd3EVHS79B6/DSPVkK10FsCRe0VyzM/P9RhSaNyMgVt1s9Aqw==","shasum":"ced74a88af54b5a0d0e09d383692401257a988f8","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.10.tgz","fileCount":46,"unpackedSize":696068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7cmsCRA9TVsSAnZWagAAsyIP/iAZ77ArsVbppbDFw1TQ\nupkXoJ1QrZd/tVofUP75aQdqi4IOgKhOCjyedMFDiq3v81DRNAi0PhZovaUy\nBSPj6Wyggfdfr8Co3hALoRngz6Pdu7u4cvb/bwaQIAgHpXvVMNOEcRVamx0O\nmqxK8Ap+5l6NWX+1gCumGDSh4IFZEE2jHdI7QwQ61jH31vzengly9Td3bMoy\nQ3zHUEh2iIuUmEx0G9En6OVYDJb5lrBnUETt5hzhB/RTr9ryuFENn2mowrAe\nJ0VBcDrnNxf/X/2dSJTYbCZOi/12sIO39H586K3OoEiY1yHHvNftyUTWNoyn\nHVYZXEEKLe3P+SdwnoukVvR6TPQP4jlQhXdbavCT9w4zK1svAJWxCSswCZ3D\nrLh+su8srGmpED0LORcxadsxY4a8a577xztnsKEzChqo08FX+54SBVLETWCK\nm5fdPKGthxKVeX/wyM4ITmJZP6AqIDdbw6q9imKHkapO9jFbkFtsgIQO89Nj\nCkJLcn0N4SSgJmHWciySn0oc0Qm7ymovwMCY/wAlGU4o3b9aAyzz0SM2mjpp\nfp74kaXrh8fp6X4b+0IPAs42ZkO/WL9H8DtWoiv6v2XfxmdxMaTmP2anVerp\nB1SC4i6KOrNOnO4rM+sv3unYwTN/dfYNiq9aI1QEZZJjvhdbixQqKn2cr2fb\neUQw\r\n=TMgg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7SpcgxhJge7Fk3+9om2ZhFEkzUBnbFgyod6qJ+5/jhAiEAyl8bvLNcZ317r7i0PtEDfY5Kknc8ddlddAzlvukgcOs="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.10_1575864748337_0.21615015906905133"},"_hasShrinkwrap":false},"1.0.0-beta.16":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.16","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.16","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.16","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"e0695dde8d2b01d1a068f4086fbd7988bcf9de4c","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.16","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-CUDSwiM3QmUL1Ojj03MbrQG6QjzwBbu16g1XmGFm80Kkd7xwj8ispS2CSALMvcO6e+tve7YmbmPMwNXyYuoiVQ==","shasum":"c00ddb921058c0408a88bf5156b95e4657fbd15b","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.16.tgz","fileCount":46,"unpackedSize":685540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiz1vCRA9TVsSAnZWagAApYAP/iztZN/7HBvcL+JegeKg\nQdP6fqC1C4cPdFfQPqlOUUqTE2nNZkszQ8iFNVELCbjir0Dk+t8RhIHRcFEO\nuCrsmlBix2rEVdSm365ck1O9UjALyWHs0LAbauyHnVkpQia/XHp7iUlkXR9Q\nHPFFDrIxuqjbiKQoTESfEReT/reQg5AFOpZ5I6k9cJnePOTJnHzktBgxRhs3\nBiGNziSJASB8xlmzCUK6ny93zuQOf6aqYaINMwJj25wd/Za/06O1mGu0OInA\nKsC1eZfxCy8v8zy8li84yNtViBhUuKoxOu6CHomr4KGRmp5xepYDXmxyNsE8\nktJJr6VRmVF/1eTQwJ4Vpl5y3eU3xSGToUBENwrZuMMn11D0WpUmO45JOUdC\nQmL2c+jO/2MYCU4KqGPQ2u0mGvnZtSNKSUm0a5wscjHnoKoDTttStPJzG6Lv\n2PrCKw+N6xH/wn4wEC9R0O3Aa7f33MgJ9aNSl8hCwFNkLC60BLJCCYF/y38U\nbrPJlHRYPt73igrabsjak4AgU2oBy6N6ZVBmzFASQAyMe8ZHWmjs3pi4fo9q\nbP34VOVrlMGIbh1tug/i3xtNSYM/ZF54aVKfj/5y1wvP1nDZw4BiO3ZEbc6R\nNRdqIsXewYpdgm+WdRSJVJGTo7824ty2/QGEUQkDG1qZ+GJUOp6kQ0Wf+39L\nxJ9w\r\n=OJLJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsB7an6JXACN7ZW6nN9vmd16TaS49JwY9jS1fcP6KuvAIhAMf88FWv980zlPNB4Yw7rHl0nhFlXXBikv6JmtDx1bnX"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.16_1586183535535_0.2901315814412506"},"_hasShrinkwrap":false},"0.7.17":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","version":"0.7.17","engines":{"node":">=6"},"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","main":"lib/index.js","browser":"lib/browser.js","keywords":["bot","chatbot","messaging-apis","messenger"],"dependencies":{"append-query":"^2.0.1","axios":"^0.19.0","axios-error":"^0.7.17","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"e5228dddac20dde2da47d053653b68013ceb3974","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.7.17","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-4eaRhkPHy890xh7RL31fw6cGT2qeRyfzVlFQwSJwm8yXnItzNh5SlbkaH3BvNM3t5VAygIi4h/nnQ5i6HnRCfw==","shasum":"03f73f7317a7e31e862818349cfb0caa8792dd77","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.17.tgz","fileCount":22,"unpackedSize":425047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejV28CRA9TVsSAnZWagAAoQwP/224PqUpH2Uj0C8ZiM6m\n43aOvkY5AqQt9pLGF1WLB8igp2nhyOMycyZ6tcM9r0XGfnttU5R4hvMgo1Z6\nnT4zaTfvAu/asIG09U1WES6cA8EX6VrfBCN0ZF8rcgS9apVno/Rnj1bJsj9v\nn6XL0SGooD1N1Nk2gU356hcPGx0SuGCX0U4Td6aWWJ5STHlPKjHOPkq+LqGM\nDRQ6pD7SMQu4wDj4vspTlJTC5bSMzZbVR7Tt63sVRTRIqhyWyOrUs+phRu8b\nZ/zTfpFTqDTja19lr6AUPOeEBe/a55F6+j/U0lB3VjH4XafPwvLawdTv3SaM\nC5Fw7T9prMtzp5++DCNgoKiJOv0KunrIjCdbQ59DpTTFv2MB6ZR3tgzVKUfx\nyxuFC4ETjHEe+htDLA4iDizuozchXTuyADGHFpC+JxlRdMoFvfUeimWrQdnp\nVCCJkDQcHVxbxGPD1StAkoFoizz65P+KLLp+dJPRibNRqCkW72QJ1OapJoRT\nRzDbmi4bhSMae6A6EB6/WblDxfhada0WRXcyGIujwCZppUsYSEO7/a6b5KFO\nWraguMCn3lkkHdkdc6G/qx8gd3ppipXFR0Vw7L6+R5d58iqJspPYmY1isW8Z\nw5pmkwMQK6ANFILAyuMfsvqn85jhSWgxAlfzXhNzb/QSkbKPc4225S3u8Z/c\n8utg\r\n=J16q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE55RaqlslZbiLj+3IDmGp6eruhM914ntouZeEqzJRicAiEApWcCPb96cfLCJaYc11pvmbq8Ig38kNTz2AFEjphxm4I="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.17_1586322875709_0.8485812618749404"},"_hasShrinkwrap":false},"0.7.18":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"version":"0.7.18","main":"lib/index.js","browser":"lib/browser.js","dependencies":{"append-query":"^2.0.1","axios":"^0.19.0","axios-error":"^0.7.18","debug":"^4.0.1","form-data":"^2.3.2","invariant":"^2.2.4","is-plain-object":"^2.0.4","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.0","warning":"^4.0.2"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=6"},"gitHead":"4318450a056e285e70093a80fc0bf79910665642","_id":"messaging-api-messenger@0.7.18","dist":{"shasum":"53343cb0bc11d414b91455e9d7aff297ee33a12a","integrity":"sha512-Eu7eZ8KRqcvt0EsT2EZWZ2uBw6DZ5b9kJC5/DtG0TVCQD/dzvfERy0geRwANF8yZ8/L0rLCRoWaOIrCfMZ0cKg==","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.7.18.tgz","fileCount":29,"unpackedSize":491201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejV9XCRA9TVsSAnZWagAA6z8P/iQtWVurBd4TeHB3hEnK\nRhlCuwlwzSWNCX11SEfJBncIKkJh07RWZPjjmCCDYBmDFCZbHzseDx9pIg58\nakXuQGf7N+QSC6cOU4ILwP/fJzwBWxw1kVCXX/3iwGkpd0cdljNIXJR5aZwz\nnN+llddWMAxMQ0NeGg4M4eN7tPK2zNPQaK05Jyj0kQUhKvHg/Is2mILTelDI\n610hEsemebPGDhZqWRjruAqL8Ym4wQsk1HzhQDk2OojY9YglHdhXsrc8XjGL\nL1JFtpsW1FiqfvqXSjO1pioA2WpDoJcqxYUvUu1b04BiWQz2nm/dcNsSJ/VC\n8Qlxqe00uwQ5h+Sl0a95iTck8xzrGoOe0wsSdy4QoQkV1avBPlVPDnGU2Gau\n4St/Ha13TG3x/OP9wSOpoXrgKVkU9/S9XPU7PV1pCSBpNnzwyKDzGjO8Q6Vr\n1G8RxlJxdoHl+k1jsMzT5Pm/n0Al3HUQkJVLzydgygk7vKYFiyFQReuyaRwz\neUqQK7Ab4wNZGiMlz7yvnABxJvRnz99+CTRHVVyTtAuTGKddBNAfsp5mExZP\npkoQB3br4OxEbaUTWREJY3ha+asUG8HSBRveenknYAU38FxiHP8UM1J28tKn\nhWObx/rLWrxz/C3H3PU/mTaAOxrYD2a5EyMbeItEAJumazZ81XzKzamm4KWd\n8+T6\r\n=trB8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD90FJ52/yjeqGQOTCVvTBD3GGUhIiFlC8VZ2IN1DzhygIgWDCfdbUg/8p9nGSPu4H8FnQtNZk32QmXgGykdoIqnTA="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.7.18_1586323286458_0.6567424557268156"},"_hasShrinkwrap":false},"0.8.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"0.8.5","main":"lib/index.js","browser":"lib/browser.js","dependencies":{"append-query":"^2.1.0","axios":"^0.19.0","axios-error":"^0.8.1","debug":"^4.1.1","form-data":"^2.5.0","invariant":"^2.2.4","is-plain-object":"^3.0.0","lodash.get":"^4.4.2","lodash.omit":"^4.5.0","url-join":"^4.0.1","warning":"^4.0.3"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"44e4ae3a8cc4ce7c1fbb5a482e6e3a3286a227a7","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@0.8.5","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.16.4/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-F2fw+9uZLdBLAXQoObRXG3Ys80EVUztz6H8ALFI1cFw54/nC57pWV+NIqVXekf5nru2uZ3RNaAURezXiPSWHrQ==","shasum":"298d381532f4f7e375e83a59db3506d4bd765b36","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-0.8.5.tgz","fileCount":29,"unpackedSize":487389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejWLoCRA9TVsSAnZWagAAc8wP/077dxeMkxrgDSbFnTsm\nCJBxPFmD+ahzMRS11LN4RfSzRceWVhVFoDSs5gXKlA2gvCHzGAWZHXGiX+Pc\nEPpwgQFVqkk00dqMc3mjQTzHLQXCB0Yd+rITpO8WqwvEsLM/hHsuX0jV/bGv\nfEEGUYAzXolcWWC1P5K+1wOSwDGahALA3P5Fzq6t9WAauySsi1/2BAFO14O+\neTdPVwIxuNYSKtplILKs1Wo8nlWbVeEQAtgyyABKIt4ffhemKV0HkLSG7mQy\n+nvezs8867oPjzolShyVAqu0gxUbVstbFIHQp7TZiYXoomzh7BUXz0eY8SGI\nZoqeQlkaRpXrTD+dJA6kh7iUFSwZeRvkF+DO+dqklUOjxKFg+YcPqVFcqrWp\nfgpKXMmQRzd0f3Cv730IB6mjWJzOlr3Hb56RqBpOwaYnUiudAuBR+N9PMYZW\nwAvBzUc+YDSOSYK5Wp2wQ3UcUWWPdWPpkEvBXGQu4Zt09xd12FV8+4bBNbOx\n8osbbDJbj7xMXUvcdKCme32qA/pFbDoOgLrUJme32lB8gxOnHN/ZR04a+iVV\nVmp2gQjSKKvOLI9/k5qkL7LPR0k7PNUAr2w3gwVdSoRo0c0zKBSuVPcW8oXd\n6C7sYGODcmtF7WM2DeBUaRkgfSi/NQAmHxX1KUTePBXLM3uiWWY9W4nCog0i\noiQw\r\n=bQrU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJkScvTUxdDkO9wJC5TKizo3PLtFaqJV1EBMROeOboAwIhAJkjNXKVjbp1DKweh7CfMoVrfyXTzBYM66ek/qx9roQA"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_0.8.5_1586324199855_0.18766425801321063"},"_hasShrinkwrap":false},"1.0.0-beta.18":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.18","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.16","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.16","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"7d803786ccc34105e4cf105c5d25b3354e1cb283","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.18","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-2epVMxyGReG/mmKn0ugYEEZr6sHrdtz7Np4yRs855zqTOqzNzLYvfDwpEUwNbbGe0serDsyt8s4s2tbr5FJPbg==","shasum":"50ef461dc3743712d7bb459bf5c0d6e1893b342e","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.18.tgz","fileCount":46,"unpackedSize":710122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelILhCRA9TVsSAnZWagAAflsQAIM5D7VNo2uzKp3Xe020\nxi8/T9+vlgVWy1HoyKCwCdLkFh2al/tMl78fbZ8/ZsJOzH5HWp87JMIOdntK\n1xtkYQSU8ZtwEAe5GYjaNt3mm3Tnqr2n2E3MUfA2JAdybE7gFYU60g4Oih05\nikpreoyzB5KhIiFphYVJiHXfML3v6e4WYxS0e1Od/60iTUq8L/TiQnc17xCc\nNkIhssZ5pXHQ78YVOTDLgtnzSr0Hnjag139gnnvCL0zMg2z8IkB8ATe9THpF\nL5x5SuBvG0QwkC8vpwhtkgxE4miUhPPoC+eS1D7ApeYzbtqV226idOhPujV6\nHQZiRKJiQ0Gs5EwwB1WryFftFv7q0E3Yu8gm2VRLnwlq9ziAd0wfaaf6aNAc\n4qzbNNlruu75z29z3Jk792u8koCqFMCoTi67ccIU2/XJ2c1401jsIxKrrWBi\nt3FNa5UbLVKMyUUHkH3OXL+9qrUm6iMRZ6227bri7Ael0rOuevIA2fLMZL78\nFPolGXQpJsXkANVaIlowrfXS8PDIiD+rkVjz1qT6GXq3A8fvMmrI/slD01zw\n/9SCCBiTGkpsyaawkmu7qTJZSXsRMXoxHldTYMxwFNPi2pej92fcAhtY/OdS\n2lJojb5hxvADYd2I1jHLwVEXOac0b/O+QP//CiIKlmd/czAgTAAJKpiMc+C/\nb6K1\r\n=tq6F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4/KeQZLkQEnsp5bwCcms9R2QQOv0S+OA3DAXCBZ12QAIgXwP9fkGUA7mP+FOfGuB8Dnn2MQUaZUTSaD2uPZXWSvA="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.18_1586791136597_0.9309100191510575"},"_hasShrinkwrap":false},"1.0.0-beta.22":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.22","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.16","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.16","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"59e66d7aa3f77afe06ae1404eb625851ebb0ee26","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.22","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-Mx3pd8WB4LNEyyENBTRliYUd8yVE0kR+UXNxT/T2G0lSMog3R95lvuULcg+I9fvdWVzVWI8dakjdUfLwgu+QFg==","shasum":"e9eb53f76a430416acac7e0c145490c1d9e1a993","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.22.tgz","fileCount":46,"unpackedSize":710228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuAEJCRA9TVsSAnZWagAA34EP/3CyNCuUUjavczTYVar1\nJ3Z7cWBNWW05GgCsWghiDf435V/6zCYez7bkVT32jy0+1NzHHSRXNuB/Ypf8\nWtM00Z2IY+MsqHUjJ8Z9PF3CvO8Dyb3liZsNS6+Odric3xZRd+chXJTC/9DD\nrfkQm3hz5VoEqhk+5b8ANotclsdXwjEFZdRe6QB7SK5M/IqJDP9Fh+vIN3Lp\nlzU+39s4ihk22DrQv8Vm++GSZr72sASlaH+/vXHT4TUksrql6IStOH4O3Ho3\nDYkv1uRO6BKURhUGc2n7tsd0JJ/OpDOe1CjAGXx/YI4ZQ9abUAI4jjfCHVyL\njnrqjRqbghX7wZtJN7GGj/ZJ5Xpt1/r7QklDqUf6DsOzqavErHOxfOODxtEd\ndVM3/5Rk3MunJ3YFrl3RiMi2VNUXQ1EJd8J9VBQ3z4sVugBYkwmsFtEk1v6W\nyFWSPO3zWu7Py8HqxE5djWhDIkbfVkOO09TvqrEYl8DSeU2Rp+VSFuY1QzK9\nbJ6kVd/+IAPiMYlcYktw64BR/yZIgcvc6OQ0m1ykKO4bytdbHEhLOqH3XLhN\nAQtpHYX5ahMEPY81+qhwA4Rqy7/jggNMv9ZWfSDext21iZI14CmOSXoq/oI5\nNCuusw1Py156sUVQKsGCgQkFsuaPlBMm/Q4HqvcX1Iz5cyxaBADtAaHXM+le\nXLKr\r\n=2STP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHQPpexLvs4hKZa5uWBY43BiQ1vfj5Qr/SpMMO1tgWqAiEAtZ7GEWxcmgjGxTdy42DFjb3J565rGIQGJZKrX5o8rHM="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.22_1589117192478_0.9748959103779868"},"_hasShrinkwrap":false},"1.0.0-beta.23":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.23","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.16","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.23","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=8"},"gitHead":"5de733d62d61798bdb1d4b19b363bbe216b324e8","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.23","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-Yqj79/TuHNlObeTAdua9aIr/oDZiSj+uijzaW7DVRB8lnsvZUSXONGsle/zuS0bHFYb8ghvkg6eNUNGqJn2VNw==","shasum":"360109ec9a036459792a288bcd3b831343be5dd7","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.23.tgz","fileCount":46,"unpackedSize":715927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewlXECRA9TVsSAnZWagAA924P+wUKRY7Rr0nowIDzUpCO\nskwVbj4p9uOUJrELBfr05aVH3I/EwLyYpQmFRN9xPrjD1RIzADOtHbPx4InD\nuqD/Mc3AJsNMprH9kzRo+Ta3TyrkGLA8+LC1ljC9SckfTq+tUWPioaMYGcsJ\nyibLUcCCzCj+WtkDlfbnr073xbq2VAR7nPsWZR6EMoMG5IbCAYL5AN5lzc1U\nqAwqJvyyj9EMSpNDkBJoWSQY3OG3ir6GmKuUUPBnq+iK5F5uJiPgotn8vpr8\n9yByWM9Ey+AlZpTJHwLQhFRPHcjuUiuk2HbV5JaHY37pblLecH26UnEkKM7A\nfDQ1j7jD6BgMlzqjGd+G5R1Vd9LwioteUksIpXHwX/XQ3f6Qjji2ibQiS9QF\nXoEgJBnKnCHY3A5S2XBMvmjpaVZtGYZvOMc4ghKLpYTb9YditMNlKv+Noka9\nUCVe6D6YfSZqvXmRdj333WlEdXaieD0re6ZirT09IW8jxZSWU7bOEwdHODUY\nPWPSDwTVk77SVHyiWRkjuWp/m08SMXzracNLtefqTeokZYx9pSjUrqC1ywbA\n19YvOgcrrJShl/VrlsHePXs2+R4REWCg4x2VyG094MSAzuqjFT8otgyr1Lw7\nH4C4vQTRKXI7abGy3oWX7rYinu0xPDeAiOU0YBCM0tDiy349ZYlAJyPPWAKn\nLU9r\r\n=3dPH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcsW+E4/6vub0HA3naY86bsRuirBHTiKUbHHU4nEObzQIhAIbO6d8S7+whnMw4OvDppCUkRH30qkwc/gipMW0POHmj"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.23_1589794243475_0.5960947751174435"},"_hasShrinkwrap":false},"1.0.0-beta.24":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.24","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.24","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.24","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"18258941a920ed2aabf7b12f17e10e8c14238c15","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = MessengerClient.connect(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.24","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-C7XSemuJdgyvfmwikuOjHGqUaf1PAUm+Qoj2s7LthSprQXby3RiBUN7OCUTqHlV6vWAcfk79KQgkLY42t+5tVw==","shasum":"4a987e6b06f598833ae6bc143348337b9994d37b","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.24.tgz","fileCount":46,"unpackedSize":729971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4dEQCRA9TVsSAnZWagAAHXYQAKOa3UexJwGVwy4pMEp9\nRK7ygYENOIn8YLMc4aHNruUlAQtjIn/gY4EPuXPGI1ZZ3A38f+Gts5ghtn6c\n7Q6hchrOseZy1UG5LbFebUxl6vN3Zydk0H0j9HKcqoFHyOZFKtHsCS0l8VJq\nyxB6V/Oo4yVq45ZyX+fVkt1f/yjmsYES7/494xAC2tscno8VPXtHGhOf3Qq/\nsK8Ev54u3b4mnLNIHC4bdODsjCfgEt0DM9QF2d3fIgfTuMEuFWMLJKmwIEtJ\nsHw6GmEprB0VI1iREzZQJnQYwrsR8sBTYVkUBsJIkEoHPcLCEBnIHsiZ587z\nOtFrAzptK5d/CBu55nnNzMxjTOw67lkT4rSnAf9KuzUwoZ12ff10/bzZtIkl\nG03ajQCxi/j3y5F1L219xkJpUptJH8lucU1zc8OrqwrCkDWyoNxm7DB6Oqem\nroXplq7cFfBkO255dzLHV8HJtPi0BN0j2yMVyemmgyJ9WDO/dDJjh7OOQ83L\nEGwde1QZm31isgf+5YttcF7B9BYn4vufBOj/rFK0Qw9WpY9RIB2jdiapgq+t\ncvdFXpeb4mMNEtNRamxXqsfUkuv9HBxgWfaWVY0YkXXkmDiz+osHr8vgM5m0\nHkn8QTi2wpauISIg3egoa4qiO29XFr7XZh5GTBz8ldZBrQzNpCcrGFRjcRzV\nFI8B\r\n=/c6Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6dt6+b9Kmhbo658LPr4bnJVdYJOiqWZOnzeFI8Ve+jAiEAmnZxGdd+5mfOiOxk1IBSnf7unFtnPzoGnr2/FytdDmc="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.24_1591857423591_0.765266072963402"},"_hasShrinkwrap":false},"1.0.0-beta.25":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.25","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.24","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.24","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"5cca124548cbd6d36cafbdfb3ce6856fd338dbe3","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = new MessengerClient(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch(error => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then(tags => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then(result => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then(label => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then(result => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then(result => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then(result => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then(result => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then(broadcast => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then(user => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.getMessengerProfile(['get_started', 'persistent_menu']).then(profile => {\n  console.log(profile);\n  // [\n  //   {\n  //     get_started: {\n  //       payload: 'GET_STARTED',\n  //     },\n  //   },\n  //   {\n  //     persistent_menu: [\n  //       {\n  //         locale: 'default',\n  //         composer_input_disabled: true,\n  //         call_to_actions: [\n  //           {\n  //             type: 'postback',\n  //             title: 'Restart Conversation',\n  //             payload: 'RESTART',\n  //           },\n  //         ],\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then(menu => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then(getStarted => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then(greeting => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then(domains => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then(accountLinking => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then(targetAudience => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then(chatExtension => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then(code => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then(threadOwner => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then(receivers => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then(counts => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then(counts => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then(result => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then(result => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then(persona => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then(persona => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then(personas => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then(personas => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then(pageInfo => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then(page => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then(data => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.25","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-q2951j62/jj0fh0fqBbrwKGcd8AfE/BXePW21ZizJIUQTaKfimXeRIf1MBviWmp3EwYwKbMF4slks10fI0FJ6Q==","shasum":"b6bb96a7a4bc4b29c83494ec53117885d71bef13","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.25.tgz","fileCount":46,"unpackedSize":738010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4hXXCRA9TVsSAnZWagAAfLUP/jiYierk6wkjyosEjnzE\nQPZ/1vJD62K+T5DASLbg0vw05KIjgY3n8lj2FSPdS+Y34rIkCZL62V0uKqFE\nJ1tqU84WGkVyXZYGmFLFQTD+rxkIomwZixUz5G+UNuBI7Bor3X7S1nhYLm32\nblgepxR936hh9Azwg3vqRN95RRkve4AuF1R+HRuOMw454bJclS9H41MmIIhs\n3vYED9Zkpq9PYgPEfHQHhavgyfosMFTUPTfZsMF2iXLix8BvFhcBm5ievfTb\nBsAFvGq1f+y1PVjELIF+GjQ+TqbaYA6pf0sdPwc+vUk+8OgdhlOrHH7+UaZ2\n38DRh9NUJC97F9/dVvTsPSuq0xngU+dJRWVj09Y2rf9hMwrh61+rtJ+lsvky\nxzZJ4DN+4tBZFlXh/xImYdAMoeqavsnN91qhF4K2xWsZ+Zdk2itPIFPlmBkw\no0kuxwR8lIZj61AQoD03KuM9JSBc2xJuNCRczkN2IXSQmk8D9nJ7GzV56Jrs\nbFNH7g8EeIBP3IZJIPFYEAp8ykAQexeQSQ/UY7tT736BoTqpru+szlNAVb66\nvGpTBV9ea6TU4rXokrzMMCJ37lDlKK4ADLWq61AXP1KQXNH+mCu2pSR18U3X\npLbPH+fC2SUTVQ3gZ/9HnkuxKmDzMgbcrQBctY+v8ka1mAdVpgG2bibyHPnB\nL0VH\r\n=Xwam\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHTTjqVah0LKgdgoUedoTyKJ8jqsKcsHuGCuHdz7LsXZAiBPBDXWz+MEU99+Eaf27weMWptjCiUoH5shjjkZjbR9SQ=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.25_1591875031192_0.8853200019602381"},"_hasShrinkwrap":false},"1.0.0-beta.26":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.26","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.26","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.26","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"a22b819aad9b425d5d0d2bb45aada31f0ecee42e","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = new MessengerClient(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then((tags) => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then((label) => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then((result) => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then((result) => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then((broadcast) => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then((user) => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient\n  .getMessengerProfile(['get_started', 'persistent_menu'])\n  .then((profile) => {\n    console.log(profile);\n    // [\n    //   {\n    //     get_started: {\n    //       payload: 'GET_STARTED',\n    //     },\n    //   },\n    //   {\n    //     persistent_menu: [\n    //       {\n    //         locale: 'default',\n    //         composer_input_disabled: true,\n    //         call_to_actions: [\n    //           {\n    //             type: 'postback',\n    //             title: 'Restart Conversation',\n    //             payload: 'RESTART',\n    //           },\n    //         ],\n    //       },\n    //     ],\n    //   },\n    // ]\n  });\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then((menu) => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then((getStarted) => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then((greeting) => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then((domains) => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then((accountLinking) => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then((targetAudience) => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then((chatExtension) => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then((code) => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then((threadOwner) => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then((receivers) => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then((counts) => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then((persona) => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then((persona) => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then((personas) => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then((personas) => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then((pageInfo) => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then((page) => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then((data) => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.26","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-zS5jTbOW1MCHh3gkF6G2Vh+DWxn9I+u4zU84SDLa5+0phSoAw6TnpKg+I1cM2ngggTwG9C0bM7sBszilmqfEHQ==","shasum":"80d8195f685b6cf666ddeb39a54ded3339b3cdca","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.26.tgz","fileCount":46,"unpackedSize":753064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6H01CRA9TVsSAnZWagAAS/YQAInVVOm4u6ukab05DAQc\nEt6PEbfpd8UnOQPlJuESjFwdKi8T4smv1XOBr9VvxaD9QtWxOduJM2UT7dg9\ncYhRoQg4AAinBNH9ORZTb2VAXDc2MXN10GFB9bBtq578GaPG1Y2z+ESlvvC0\nJFNKEbyOtm+X8M1v71YLOd66PvSLpWv6Fftf/yJG5LBJ4DQtmeKATf+vT9Y/\niTck5yawFCBksJVCsu57NWsJ5t3V5V5nUSIXELt0pCjkycy6aeUSLUmuji2/\nG6W740yrPu33D5asU6C37YXK851lS+X31UlY9sCUGLP7RErxwIRr6OLpo+1V\nv3+o9mL42U0JPNj0bsKBN5QZ31EsNqDByTahNQkzMEgPeAZtS4uBRkJ6YTC2\nmHA7aDG36OU9IQqZJ5uZLnlun3/6bW8oOelrUfSbs58FHhDmPtQ+ngBSpQ6f\nzxFq7OQE8iwojLuwQsK6X8bb+Yh6hAfPD8juaufCl6e9vah87KBqu6dylU0w\nMSHBrLcV6xKA5xVO86Rci5pJP2iaaxEZ5feD8qGPfd61fCDqvZwEH+GC1wT3\nHldvDcywX978NqrLHMNCLw8Qi4+YpHXB3ZG6wV68YUrro6mXo3v/36ihH7sC\njyFeUjKbHYC1KDd1N7HHeO3hecRZOtVWJebaMKWFoLwT454FEoMdj9uZY/Yu\nqXek\r\n=VnUe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDg4sE0GLh0kyILlqCFRdfnqZUSp7OO/RSx1/SMutLfwAIgBkCYts3qQzey5JB2vmGoOPDvavanrFvTEyqt4CSyrhc="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.26_1592294709096_0.381819877570287"},"_hasShrinkwrap":false},"1.0.0-beta.27":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.27","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","form-data":"^3.0.0","invariant":"^2.2.4","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.26","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"38107f34a63c32cf0a1c7994c4c39a2d6034daa4","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = new MessengerClient(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then((tags) => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then((label) => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then((result) => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then((result) => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then((broadcast) => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then((user) => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient\n  .getMessengerProfile(['get_started', 'persistent_menu'])\n  .then((profile) => {\n    console.log(profile);\n    // [\n    //   {\n    //     get_started: {\n    //       payload: 'GET_STARTED',\n    //     },\n    //   },\n    //   {\n    //     persistent_menu: [\n    //       {\n    //         locale: 'default',\n    //         composer_input_disabled: true,\n    //         call_to_actions: [\n    //           {\n    //             type: 'postback',\n    //             title: 'Restart Conversation',\n    //             payload: 'RESTART',\n    //           },\n    //         ],\n    //       },\n    //     ],\n    //   },\n    // ]\n  });\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then((menu) => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then((getStarted) => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then((greeting) => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then((domains) => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then((accountLinking) => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then((targetAudience) => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then((chatExtension) => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then((code) => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then((threadOwner) => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then((receivers) => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then((counts) => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then((persona) => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then((persona) => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then((personas) => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then((personas) => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then((pageInfo) => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then((page) => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then((data) => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.27","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-/oL4QCFB/4TP8TPHF/d56ihOyuEtZnALT+h8y4NKev4aEcYPfzmKBpZ8xIeKQYDXYPCH3MPhfFlwE2YbuRkG8g==","shasum":"4a6253d8fe9d853f85dec99e8e0fc68171023acf","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.27.tgz","fileCount":46,"unpackedSize":753843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8ZeqCRA9TVsSAnZWagAADBUP+wUa258U1q2lYuMLahrl\ngBUye8y93RCi2CWWxA5kZEHrqXjZciGgykDIT0QmwaSSdOmL101su1TudQIc\nxNzZZdPKwlf4ZfPcc/bM4OMCRWAKa2VMytrGKRGTduwysF1fJWildl6EVs8Y\n+HhFkZq2LsvEpmfDRVpCHqZ80MQgP9s5syQR6fgq6RWHXUwqFa5O7aTw5PJ1\nl217Dwd+DCCmQFus4tLp6KkFoS2Z6JGs9Q4hHn+DjcfoSOBizFJoXJpazEK4\nEQNVKRuP0dfOy3WDyNM2t7wWyCaeSYAQLWy6ZfezXAl+MwuDwz1r+jrz43gp\nQksK8d1iiTtF27VhMbivA6dAuUF9jZAxAqrl3YTN9Vf/+HfGkDvlVJ8UkHK1\nNqy7WSade+++TTeINa4/ZqfwZJxIuHasuDC2BtMQ0X+ZsiDahi62FU2DDsHm\nwwUMLDgkzVa6bZRX0uzC5h/HrRF3QVUkiS5+7fcw/8GEM8yQSPF8lOh4GIHO\nBzdFLJO1lC5Rd3JHz84F6Rd/+Ecxp+WXaH+OEUZktKWI463oJ18L5zAPHYsL\nghAxUiY+kE2hffmch1lUBei7BMtQIFqFo/QSDeSNSWsvlSaX/lkCqejaNm+e\nPGFiiY+Gtegd+Q2nUmR0p3hGCt6XPZUHBWRF9DbIvWt+S72JNFsIzKEbOMtA\nbrZ9\r\n=lxIO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLrFCQfw3UpP3ugiBqeROPGV3fD2H7gWgqZycBuds2YQIhAKdPg4xPUQchnVwbf4hICu+fbI3jzU0DkIJsJ2YqIGeB"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.27_1592891306174_0.7579363224886648"},"_hasShrinkwrap":false},"1.0.0-beta.29":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.29","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.29","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"3389b14efbdcaf968ed7476820edaaaa95da0772","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = new MessengerClient(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then((tags) => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then((label) => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then((result) => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then((result) => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then((broadcast) => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then((user) => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient\n  .getMessengerProfile(['get_started', 'persistent_menu'])\n  .then((profile) => {\n    console.log(profile);\n    // [\n    //   {\n    //     get_started: {\n    //       payload: 'GET_STARTED',\n    //     },\n    //   },\n    //   {\n    //     persistent_menu: [\n    //       {\n    //         locale: 'default',\n    //         composer_input_disabled: true,\n    //         call_to_actions: [\n    //           {\n    //             type: 'postback',\n    //             title: 'Restart Conversation',\n    //             payload: 'RESTART',\n    //           },\n    //         ],\n    //       },\n    //     ],\n    //   },\n    // ]\n  });\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then((menu) => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then((getStarted) => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then((greeting) => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then((domains) => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then((accountLinking) => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then((targetAudience) => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then((chatExtension) => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then((code) => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then((threadOwner) => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then((receivers) => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then((counts) => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then((persona) => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then((persona) => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then((personas) => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then((personas) => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then((pageInfo) => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then((page) => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then((data) => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.29","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-YsyobDFvQjyATZPQWgtoPIJ3YyyELGiToc1OeqSDvQkRoBj7G/4GFFOJ1TRwj2re5ussXFKjSovclP/DmRIsIw==","shasum":"e743b9c51caa05581087c806cba15fd79dd2bc0d","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.29.tgz","fileCount":46,"unpackedSize":754226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+W9DCRA9TVsSAnZWagAA6UEP/0Ti0qS5ggdCO7ojLzUI\nT/Gz1/tp2eNb+Wd2S7OMuBvVk4VneoO7GdLxm1cwH5X13kmb8h975/6+4YHd\nMARxb2ny8XJIJMEOehKkE/utWnt0PFGeaSuYmI5I5Leze+NYAnP8lCJnQkGH\nXlJs3HSEgtLdhDxwSkeEY4LRR3OaixRCGMpkEb7SJ9c5HoY0JT0nsQOVYRkf\nHgnSSC7IJSji/B/TJUknr5Nkc5fUtslOZHoskzm42k6CayMDX0vpVDuR2sre\nZdfHMrc7FtAERmDscYi3yi/HoSl37cPZUxv8RxdburRYwwKPlehpvjpa4EL1\ncFNu2xLKWBLn8p47PuRGTr4d7lfBoIqrrLQYYP+0i99fLPaU0X6MIh4/Ek7P\nVgk470F3eGudEgjskof9M14OzERIEVBFlZBytQm1qlPpqQUMsH/eXCFIkaYK\nZkYtGRsXlG+u+3zjDvDpwGdV7pGbuNChvvW374OGjAFFHzf33idQRAfAI6Nc\n3B+yE8sttkkT9AZzZry/ruvTL8NwMGO58vJHbBD12TIqIk+aeqNpWh8p5u82\nvklT5JJIZSNsPSSK0WMxlxnuy59JMiK15V9YEeFb+LTaqSzDKC4Odvg4Jo70\nDVlmlpZf8zFU1+2lICDdmv890vLZ5tsO/o/qxTuIN7iApM3/8xMrPoARU0X3\nY4Xt\r\n=YKFx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+BysDcy2qmwFJzC1luDKAKALPEvjbM4ntCdgDuV2SDQIgGceiO27ZQ6a0Zcu3EthgSb8w+m9JfRgWqrdQTWdVug4="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.29_1593405250956_0.9377866455655228"},"_hasShrinkwrap":false},"1.0.0-beta.31":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.31","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.29","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"ddc04126fec6d8e8815ca85a54750ea74e6d8f16","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = new MessengerClient(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then((tags) => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then((label) => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then((result) => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then((result) => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then((broadcast) => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then((user) => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient\n  .getMessengerProfile(['get_started', 'persistent_menu'])\n  .then((profile) => {\n    console.log(profile);\n    // [\n    //   {\n    //     get_started: {\n    //       payload: 'GET_STARTED',\n    //     },\n    //   },\n    //   {\n    //     persistent_menu: [\n    //       {\n    //         locale: 'default',\n    //         composer_input_disabled: true,\n    //         call_to_actions: [\n    //           {\n    //             type: 'postback',\n    //             title: 'Restart Conversation',\n    //             payload: 'RESTART',\n    //           },\n    //         ],\n    //       },\n    //     ],\n    //   },\n    // ]\n  });\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then((menu) => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then((getStarted) => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then((greeting) => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then((domains) => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then((accountLinking) => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then((targetAudience) => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then((chatExtension) => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then((code) => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then((threadOwner) => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then((receivers) => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then((counts) => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then((persona) => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then((persona) => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then((personas) => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then((personas) => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then((pageInfo) => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then((page) => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then((data) => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.31","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-UWe9vjOKAO2w3MGW53ZJAmml4bS8UsnH20C10xVm35WJufAjWvoVu8/PkEhhn7c2X3P3OHNuBxgt+/EY0z4wFw==","shasum":"1bb2db861df7c2310d70b93bdc853f35af481f4d","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.31.tgz","fileCount":46,"unpackedSize":754246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/AKxCRA9TVsSAnZWagAATL8QAIIqAqVipsSnQDoImKy0\nzTjGQKPr7iI9GizRGrz2HHPW5xWQZPJQcPaLBpsO+U8tpcyipIeY4j5cpYah\nC1hj8VgIqQ6j2r7HRaJ/h1LzL+/eRL4eLySEvrzPLfO3uL8ZzpEPmHrdJaVp\nT/e6+n3Pzi29XIpL+Ze6wm0BrvYMZi11+Iq/xgHUH3Bx0JMvuzgJ5r2V5ZhH\n+lQuKm3cpxjgoby4wNXTTucIW8t5yENYj2RtK60IFii7F2DjAJa44jOOY0l0\npZCNKYX4ruCpMiXTtHd2V3mTWn8Yz+YwQpU3QCvLyfaKYP92nHLRqp6b4/LW\ncE3acQzIwW3sYQCzg7wtksuCh355g+9vqs7CYrtaE6GyFKJzwaojCfH+UMYo\n1cVVJb1EcgYgEM2aaN86OVeEaufuM4vvSVKOJyivoPYR+5CdzpZ660XpqclT\nnib6qhcQhNOx1hnJHbGcIbyc75RNZkpltzu4CjrkT4w6KHR2ZlFpcYJyK+Jw\nRNoOMqCJU4LUruPMif9Myg4lYGWKBve7K3eyIBSqE0JFudm1nm/Fre+48Svg\nNn1X22tBB+xud+yrftd8f/hrAaUGFfwL52n3B1bb4qSVmvv53mwItr03LAll\nTUsyVtudyeEg20TeAuatlzZgdA/xYKR6kXFuLqhe1KnH5aMIyInUp/x0jJqX\nfqQr\r\n=xKQi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFstvBMeIcsv4W4Jba5Q8i+j/RZsehn029uImO6FVa3wIhAJIaPFIi41cwbjgS5yXU46sMINarPl66j6ObgBbHP3qh"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.31_1593574065013_0.07153812269122062"},"_hasShrinkwrap":false},"1.0.0-beta.33":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.33","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.29","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"a3f7afb4cef3784c3459f6be0810e0518b1bb384","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Tags](#tags)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = new MessengerClient(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"tags\" />\n\n### Tags - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags/)\n\n## `getMessageTags`\n\nGetting tags list via an API.\n\nExample:\n\n```js\nclient.getMessageTags().then((tags) => {\n  console.log(tags);\n  // [\n  //   {\n  //     tag: 'SHIPPING_UPDATE',\n  //     description:\n  //       'The shipping_update tag may only be used to provide a shipping status notification for a product that has already been purchased. For example, when the product is shipped, in-transit, delivered, or delayed. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'RESERVATION_UPDATE',\n  //     description:\n  //       'The reservation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in itinerary, location, or a cancellation (such as when a hotel booking is canceled, a car rental pick-up time changes, or a room upgrade is confirmed). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'ISSUE_RESOLUTION',\n  //     description:\n  //       'The issue_resolution tag may only be used to respond to a customer service issue surfaced in a Messenger conversation after a transaction has taken place. This tag is intended for use cases where the business requires more than 24 hours to resolve an issue and needs to give someone a status update and/or gather additional information. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements, nor can businesses use the tag to proactively message people to solicit feedback).',\n  //   },\n  //   {\n  //     tag: 'APPOINTMENT_UPDATE',\n  //     description:\n  //       'The appointment_update tag may only be used to provide updates about an existing appointment. For example, when there is a change in time, a location update or a cancellation (such as when a spa treatment is canceled, a real estate agent needs to meet you at a new location or a dental office proposes a new appointment time). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'GAME_EVENT',\n  //     description:\n  //       'The game_event tag may only be used to provide an update on user progression, a global event in a game or a live sporting event. For example, when a person’s crops are ready to be collected, their building is finished, their daily tournament is about to start or their favorite soccer team is about to play. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TRANSPORTATION_UPDATE',\n  //     description:\n  //       'The transportation_update tag may only be used to confirm updates to an existing reservation. For example, when there is a change in status of any flight, train or ferry reservation (such as “ride canceled”, “trip started” or “ferry arrived”). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'FEATURE_FUNCTIONALITY_UPDATE',\n  //     description:\n  //       'The feature_functionality_update tag may only be used to provide an update on new features or functionality that become available in a bot. For example, announcing the ability to talk to a live agent in a bot, or that the bot has a new skill. This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  //   {\n  //     tag: 'TICKET_UPDATE',\n  //     description:\n  //       'The ticket_update tag may only be used to provide updates pertaining to an event for which a person already has a ticket. For example, when there is a change in time, a location update or a cancellation (such as when a concert is canceled, the venue has changed or a refund opportunity is available). This tag cannot be used for use cases beyond those listed above or for promotional content (ex: daily deals, coupons and discounts, or sale announcements).',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then((label) => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then((result) => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then((result) => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then((broadcast) => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then((user) => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient\n  .getMessengerProfile(['get_started', 'persistent_menu'])\n  .then((profile) => {\n    console.log(profile);\n    // [\n    //   {\n    //     get_started: {\n    //       payload: 'GET_STARTED',\n    //     },\n    //   },\n    //   {\n    //     persistent_menu: [\n    //       {\n    //         locale: 'default',\n    //         composer_input_disabled: true,\n    //         call_to_actions: [\n    //           {\n    //             type: 'postback',\n    //             title: 'Restart Conversation',\n    //             payload: 'RESTART',\n    //           },\n    //         ],\n    //       },\n    //     ],\n    //   },\n    // ]\n  });\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                                                                        |\n| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`, `payment_settings`, `target_audience`, `home_url`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then((menu) => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then((getStarted) => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then((greeting) => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then((domains) => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then((accountLinking) => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then((targetAudience) => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then((chatExtension) => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then((code) => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then((threadOwner) => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then((receivers) => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then((counts) => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then((persona) => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then((persona) => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then((personas) => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then((personas) => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then((pageInfo) => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then((page) => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then((data) => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.33","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-iGIUzaqRaddt+Wt7mz5hyo/5dQaq0WHkEDoSRctVmYnEyIgZtyvIVsxOp9RKWPY4U5KDjkMwLjgt7y8/TD8ttQ==","shasum":"8856d174a400fa1401afb9f7aef8aba53a216189","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.33.tgz","fileCount":46,"unpackedSize":755033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfF9++CRA9TVsSAnZWagAA3oUP/2JTYQNazPJNV99Octbz\nepWVprJ82DBjYo9JhYcOCAkUQtYkAT7z20puHF9x76sIcmiD1Cq9lAofOL/J\nd2zN7cJfRBtxNRxHrhw4KSrQGAKkJJItSRs4ggQ1jbIH8T/Idp170b345sru\nKUYECrw1gW6ZinSl5yUENJFBZRyKBqwQj1Cf6WeM4YxcwBNZVekROFbqfzS4\ntlQlje8N8JvF/OYsp83uJoUDA/R7SfnlcvU2ShPU7lJFNBi6YkLyl+OPGaUU\nSCIlkWIDzYlnOAcwU2axVTlHGOZYKO8C9Fj3XMjp/RAArAlR9qqHfBr2mIGm\ncdFvnlUmB25MC1PBgkK/dFA+mzGE+YmMW0gyAYBHrqP3RoWymYvLba4Qfe4p\nMBgR77EQ5yQ5sZ4sa7X+/csN/J+8F7DIKcTyDGxtn3wYlOcIPuyPHSKcdS7s\ne66EHXLgK7TVR7zoZ81l8555/c3LV+BxKJCS+4Qd24WMzCGJFUcMKNXFGAUy\n1sW6JpdmmvTxQXHcmKJnejiDx4y5JmejZwHSCNq9kuZ6UkckNM1sndOi/pa0\n8uDu9AWoCt2Ym7Ae9spzES8UJie/rIDDXssV4M6FQMBUTku8I/yDMkA4B5Jv\nkZycVxFRQAEiOCdSwDah1JXOgTby1BzqKTdsZNHwK9I/BG8I2nrhgUCPfi+F\nBIs2\r\n=VhTE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGyq1Ciax/+ApH4QBmDDH/IVvkrfxqyLOBvfMHaNEUnwIhALqPTnaJaVzrhHjRCgyvPBHQNmvlJldjHjSsLmHh3tta"}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.33_1595400126491_0.9951848542305717"},"_hasShrinkwrap":false},"1.0.0-beta.34":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.34","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.29","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"dffb3adafba268a22ff08614dcdf9716ff7bb406","readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/y8/r/R_1BAhxMP5I.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Message Batching](#message-batching)\n  - [Broadcast API](#broadcast-api)\n    - [Targeting Broadcast Messages](#targeting-broadcast-messages)\n    - [Estimating Broadcast Size](#estimating-broadcast-size)\n    - [Broadcast Metrics](#broadcast-metrics)\n    - [Scheduling Broadcasts](#scheduling-broadcasts)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n    - [Target Audience](#target-audience)\n    - [Chat Extension Home URL](#chat-extension-home-url)\n  - [Messenger Code API](#messenger-code-api)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\n// get accessToken from facebook developers website\nconst client = new MessengerClient(accessToken);\n```\n\nYou can specify version of Facebook Graph API using second argument:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '4.0',\n});\n```\n\nIf it is not specified, version `4.0` will be used as default.\n\n### Verifying Graph API Calls with appsecret_proof\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set `skipAppSecretProof` to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly `console.log` on the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n## `sendRawBody(body)`\n\nSend request raw body using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| body  | `Object` | Raw body to be sent. |\n\nExample:\n\n```js\nclient.sendRawBody({\n  recipient: {\n    id: USER_ID,\n  },\n  message: {\n    text: 'Hello!',\n  },\n});\n```\n\n<br />\n\n## `sendMessage(userId, message [, options])`\n\nSend messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| message | `Object`                          | [message](https://developers.facebook.com/docs/messenger-platform/reference/send-api#message) object.                                                                                                                             |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  text: 'Hello!',\n});\n```\n\nYou can specifiy [messaging type](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) using options. If `messaging_type` and `tag` is not provided, `UPDATE` will be used as default messaging type.\n\nExample:\n\n```js\nclient.sendMessage(\n  USER_ID,\n  {\n    text: 'Hello!',\n  },\n  {\n    messaging_type: 'RESPONSE',\n  }\n);\n```\n\nAvailable messaging types:\n\n- `UPDATE` as default\n- `RESPONSE` using `{ messaging_type: 'RESPONSE' }` options\n- `MESSAGE_TAG` using `{ tag: 'ANY_TAG' }` options\n\n<br />\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n## `sendText(userId, text [, options])`\n\nSend plain text messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param   | Type                              | Description                                                                                                                                                                                                                       |\n| ------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| text    | `String`                          | Text of the message to be sent.                                                                                                                                                                                                   |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello!', { tag: 'ISSUE_RESOLUTION' });\n```\n\n<br />\n\n## `sendAttachment(userId, attachment [, options])`\n\nSend attachment messages to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                              | Description                                                                                                                                                                                                                       |\n| ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| attachment       | `Object`                          | [attachment](https://developers.facebook.com/docs/messenger-platform/reference/send-api#attachment) object.                                                                                                                       |\n| options          | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n| options.filename | Required when upload from buffer. |\n\nExample:\n\n```js\nclient.sendAttachment(USER_ID, {\n  type: 'image',\n  payload: {\n    url: 'https://example.com/pic.png',\n  },\n});\n```\n\n<br />\n\n## `sendAudio(userId, audio [, options])`\n\nSend sounds to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| audio            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The audio to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send audio using url string:\n\n```js\nclient.sendAudio(USER_ID, 'https://example.com/audio.mp3');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendAudio(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendAudio(USER_ID, fs.createReadStream('audio.mp3'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendAudio(USER_ID, buffer, { filename: 'audio.mp3' });\n```\n\n<br />\n\n## `sendImage(userId, image [, options])`\n\nSend images to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request). Supported formats are jpg, png and gif.\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| image            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The image to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send image using url string:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendImage(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendImage(USER_ID, fs.createReadStream('vr.jpg'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendImage(USER_ID, buffer, { filename: 'vr.jpg' });\n```\n\n<br />\n\n## `sendVideo(userId, video [, options])`\n\nSend videos to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| video            | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The video to be sent.                                                                                                                             |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send video using url string:\n\n```js\nclient.sendVideo(USER_ID, 'https://example.com/video.mp4');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendVideo(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendVideo(USER_ID, fs.createReadStream('video.mp4'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendVideo(USER_ID, buffer, { filename: 'video.mp4' });\n```\n\n<br />\n\n## `sendFile(userId, file [, options])`\n\nSend files to specified user by uploading them or sharing a URL using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param            | Type                                                                         | Description                                                                                                                                       |\n| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId           | <code>String &#124; Object</code>                                            | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| file             | <code>String &#124; Buffer &#124; ReadStream &#124; AttachmentPayload</code> | The file to be sent.                                                                                                                              |\n| options          | `Object`                                                                     | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n| options.filename | Required when upload from buffer.                                            |\n\nExample:\n\n- Send file using url string:\n\n```js\nclient.sendFile(USER_ID, 'https://example.com/receipt.pdf');\n```\n\n- Use `AttachmentPayload` to send cached attachment:\n\n```js\nclient.sendFile(USER_ID, { attachment_id: '55688' });\n```\n\n- Use `ReadStream` created from local file:\n\n```js\nconst fs = require('fs');\n\nclient.sendFile(USER_ID, fs.createReadStream('receipt.pdf'));\n```\n\n- Use `Buffer` to send attachment:\n\n```js\nclient.sendFile(USER_ID, buffer, { filename: 'file.pdf' });\n```\n\n<br />\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n## `sendTemplate(userId, template [, options])`\n\nSend structured message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n| Param    | Type                              | Description                                                                                                                                                                                                                       |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                         |\n| template | `Object`                          | Object of the template.                                                                                                                                                                                                           |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) or [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendTemplate(USER_ID, {\n  template_type: 'button',\n  text: 'title',\n  buttons: [\n    {\n      type: 'postback',\n      title: 'Start Chatting',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendButtonTemplate(userId, title, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template)\n\nSend button message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410664-0b80b080-27dc-11e8-8854-4408d6f32fdf.png\" alt=\"sendButtonTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                         |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                           |\n| title   | `String`                          | Text that appears above the buttons.                                                                                                                                |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). Set of 1-3 buttons that appear as call-to-actions. |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                   |\n\nExample:\n\n```js\nclient.sendButtonTemplate(USER_ID, 'What do you want to do next?', [\n  {\n    type: 'web_url',\n    url: 'https://petersapparel.parseapp.com',\n    title: 'Show Website',\n  },\n  {\n    type: 'postback',\n    title: 'Start Chatting',\n    payload: 'USER_DEFINED_PAYLOAD',\n  },\n]);\n```\n\n<br />\n\n## `sendGenericTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template)\n\nSend generic message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410502-bf948426-27db-11e8-8c9d-7fd6158d0cc2.png\" alt=\"sendGenericTemplate\" width=\"750\" />\n\n| Param    | Type                              | Description                                                                                                                                                                                                                                         |\n| -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                                                                           |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Data for each bubble in message.                                                                                                |\n| options  | `Object`                          | Other optional parameters, such as `image_aspect_ratio`, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types) and [tags](https://developers.facebook.com/docs/messenger-platform/message-tags). |\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      title: \"Welcome to Peter's Hats\",\n      image_url: 'https://petersfancybrownhats.com/company_image.png',\n      subtitle: \"We've got the right hat for everyone.\",\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          type: 'postback',\n          title: 'Start Chatting',\n          payload: 'DEVELOPER_DEFINED_PAYLOAD',\n        },\n      ],\n    },\n  ],\n  { image_aspect_ratio: 'square' }\n);\n```\n\nAdding a [tag](https://developers.facebook.com/docs/messenger-platform/message-tags) to a message allows you to send it outside the 24+1 window, for a limited number of use cases, per [Messenger Platform policy](https://developers.facebook.com/docs/messenger-platform/policy-overview).\n\nExample:\n\n```js\nclient.sendGenericTemplate(\n  USER_ID,\n  [\n    {\n      // ...\n    },\n  ],\n  { tag: 'ISSUE_RESOLUTION' }\n);\n```\n\nAvailable tags:\n\n- `BUSINESS_PRODUCTIVITY`\n- `COMMUNITY_ALERT`\n- `CONFIRMED_EVENT_REMINDER`\n- `NON_PROMOTIONAL_SUBSCRIPTION`\n- `PAIRING_UPDATE`\n- `APPLICATION_UPDATE`\n- `ACCOUNT_UPDATE`\n- `PAYMENT_UPDATE`\n- `PERSONAL_FINANCE_UPDATE`\n- `SHIPPING_UPDATE`\n- `RESERVATION_UPDATE`\n- `ISSUE_RESOLUTION`\n- `APPOINTMENT_UPDATE`\n- `GAME_EVENT`\n- `TRANSPORTATION_UPDATE`\n- `FEATURE_FUNCTIONALITY_UPDATE`\n- `TICKET_UPDATE`\n\n<br />\n\n## `sendListTemplate(userId, items, buttons [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template)\n\nSend list message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410530-c97f03e4-27db-11e8-8331-56610e6fc3ad.png\" alt=\"sendListTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                                                                     |\n| ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                                                                       |\n| items   | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). List view elements.                                                         |\n| buttons | `Array<Object>`                   | Array of [button](https://developers.facebook.com/docs/messenger-platform/send-messages/template/button#button). List of buttons associated on the list template message (maximum of 1 button). |\n| options | `Object`                          | Other optional parameters, such as `top_element_style` and [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).                            |\n\nExample:\n\n```js\nclient.sendListTemplate(\n  USER_ID,\n  [\n    {\n      title: 'Classic T-Shirt Collection',\n      image_url: 'https://peterssendreceiveapp.ngrok.io/img/collection.png',\n      subtitle: 'See all our colors',\n      default_action: {\n        type: 'web_url',\n        url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',\n        messenger_extensions: true,\n        webview_height_ratio: 'tall',\n        fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n      },\n      buttons: [\n        {\n          title: 'View',\n          type: 'web_url',\n          url: 'https://peterssendreceiveapp.ngrok.io/collection',\n          messenger_extensions: true,\n          webview_height_ratio: 'tall',\n          fallback_url: 'https://peterssendreceiveapp.ngrok.io/',\n        },\n      ],\n    },\n  ],\n  [\n    {\n      type: 'postback',\n      title: 'View More',\n      payload: 'USER_DEFINED_PAYLOAD',\n    },\n  ],\n  { top_element_style: 'compact' }\n);\n```\n\n<br />\n\n## `sendOpenGraphTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/open-graph-template)\n\nSend open graph message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410778-4a6e77e6-27dc-11e8-9a3a-487bd2f7197e.png\" alt=\"sendOpenGraphTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#element). Only one element is allowed.  |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendOpenGraphTemplate(USER_ID, [\n  {\n    url: 'https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View More',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendMediaTemplate(userId, elements [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/template/media)\n\nSend media message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410836-64249ada-27dc-11e8-8dc4-5a155916961a.png\" alt=\"sendMediaTemplate\" width=\"250\" />\n\n| Param    | Type                              | Description                                                                                                                                       |\n| -------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId   | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| elements | `Array<Object>`                   | Array of [element](https://developers.facebook.com/docs/messenger-platform/reference/template/media#payload). Only one element is allowed.        |\n| options  | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendMediaTemplate(USER_ID, [\n  {\n    media_type: 'image',\n    attachment_id: '1854626884821032',\n    buttons: [\n      {\n        type: 'web_url',\n        url: 'https://en.wikipedia.org/wiki/Rickrolling',\n        title: 'View Website',\n      },\n    ],\n  },\n]);\n```\n\n<br />\n\n## `sendReceiptTemplate(userId, receipt [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template)\n\nSend receipt message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410909-8b72001e-27dc-11e8-94ae-555cb4ae93c9.png\" alt=\"sendReceiptTemplate\" width=\"250\" />\n\n| Param   | Type                              | Description                                                                                                                                       |\n| ------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId  | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| receipt | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/receipt#payload) of receipt template.                    |\n| options | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendReceiptTemplate(USER_ID, {\n  recipient_name: 'Stephane Crozatier',\n  order_number: '12345678902',\n  currency: 'USD',\n  payment_method: 'Visa 2345',\n  order_url: 'http://petersapparel.parseapp.com/order?order_id=123456',\n  timestamp: '1428444852',\n  elements: [\n    {\n      title: 'Classic White T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 2,\n      price: 50,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/whiteshirt.png',\n    },\n    {\n      title: 'Classic Gray T-Shirt',\n      subtitle: '100% Soft and Luxurious Cotton',\n      quantity: 1,\n      price: 25,\n      currency: 'USD',\n      image_url: 'http://petersapparel.parseapp.com/img/grayshirt.png',\n    },\n  ],\n  address: {\n    street_1: '1 Hacker Way',\n    street_2: '',\n    city: 'Menlo Park',\n    postal_code: '94025',\n    state: 'CA',\n    country: 'US',\n  },\n  summary: {\n    subtotal: 75.0,\n    shipping_cost: 4.95,\n    total_tax: 6.19,\n    total_cost: 56.14,\n  },\n  adjustments: [\n    {\n      name: 'New Customer Discount',\n      amount: 20,\n    },\n    {\n      name: '$10 Off Coupon',\n      amount: 10,\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineBoardingPassTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-boardingpass-template)\n\nSend airline boarding pass message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37410966-a5fb1542-27dc-11e8-9d23-e3a090b0cdeb.png\" alt=\"sendAirlineBoardingPassTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                        |\n| ---------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                          |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-messages/template/airline-boarding-pass#payload) of boarding pass template. |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types).  |\n\nExample:\n\n```js\nclient.sendAirlineBoardingPassTemplate(RECIPIENT_ID, {\n  intro_message: 'You are checked in.',\n  locale: 'en_US',\n  boarding_pass: [\n    {\n      passenger_name: 'SMITH/NICOLAS',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74J',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74J',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '003',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1SMITH/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n    {\n      passenger_name: 'JONES/FARBOUND',\n      pnr_number: 'CG4X7U',\n      travel_class: 'business',\n      seat: '74K',\n      auxiliary_fields: [\n        {\n          label: 'Terminal',\n          value: 'T1',\n        },\n        {\n          label: 'Departure',\n          value: '30OCT 19:05',\n        },\n      ],\n      secondary_fields: [\n        {\n          label: 'Boarding',\n          value: '18:30',\n        },\n        {\n          label: 'Gate',\n          value: 'D57',\n        },\n        {\n          label: 'Seat',\n          value: '74K',\n        },\n        {\n          label: 'Sec.Nr.',\n          value: '004',\n        },\n      ],\n      logo_image_url: 'https://www.example.com/en/logo.png',\n      header_image_url: 'https://www.example.com/en/fb/header.png',\n      qr_code: 'M1JONES/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh',\n      above_bar_code_image_url: 'https://www.example.com/en/PLAT.png',\n      flight_info: {\n        flight_number: 'KL0642',\n        departure_airport: {\n          airport_code: 'JFK',\n          city: 'New York',\n          terminal: 'T1',\n          gate: 'D57',\n        },\n        arrival_airport: {\n          airport_code: 'AMS',\n          city: 'Amsterdam',\n        },\n        flight_schedule: {\n          departure_time: '2016-01-02T19:05',\n          arrival_time: '2016-01-05T17:30',\n        },\n      },\n    },\n  ],\n});\n```\n\n<br />\n\n## `sendAirlineCheckinTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template)\n\nSend airline checkin message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411010-bfb3d8a2-27dc-11e8-91de-30653cf2d62c.png\" alt=\"sendAirlineCheckinTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-checkin-template#payload) of checkin template.       |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineCheckinTemplate(USER_ID, {\n  intro_message: 'Check-in is available now.',\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  flight_info: [\n    {\n      flight_number: 'f001',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SEA',\n        city: 'Seattle',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        boarding_time: '2016-01-05T15:05',\n        departure_time: '2016-01-05T15:45',\n        arrival_time: '2016-01-05T17:30',\n      },\n    },\n  ],\n  checkin_url: 'https://www.airline.com/check-in',\n});\n```\n\n<br />\n\n## `sendAirlineItineraryTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template)\n\nSend airline itinerary message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411025-ce27545e-27dc-11e8-91be-28ab27644db7.png\" alt=\"sendAirlineItineraryTemplate\" width=\"600\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-itinerary-template#payload) of itinerary template.   |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineItineraryTemplate(USER_ID, {\n  intro_message: \"Here's your flight itinerary.\",\n  locale: 'en_US',\n  pnr_number: 'ABCDEF',\n  passenger_info: [\n    {\n      name: 'Farbound Smith Jr',\n      ticket_number: '0741234567890',\n      passenger_id: 'p001',\n    },\n    {\n      name: 'Nick Jones',\n      ticket_number: '0741234567891',\n      passenger_id: 'p002',\n    },\n  ],\n  flight_info: [\n    {\n      connection_id: 'c001',\n      segment_id: 's001',\n      flight_number: 'KL9123',\n      aircraft_type: 'Boeing 737',\n      departure_airport: {\n        airport_code: 'SFO',\n        city: 'San Francisco',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      arrival_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T4',\n        gate: 'G8',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T19:45',\n        arrival_time: '2016-01-02T21:20',\n      },\n      travel_class: 'business',\n    },\n    {\n      connection_id: 'c002',\n      segment_id: 's002',\n      flight_number: 'KL321',\n      aircraft_type: 'Boeing 747-200',\n      travel_class: 'business',\n      departure_airport: {\n        airport_code: 'SLC',\n        city: 'Salt Lake City',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      arrival_airport: {\n        airport_code: 'AMS',\n        city: 'Amsterdam',\n        terminal: 'T1',\n        gate: 'G33',\n      },\n      flight_schedule: {\n        departure_time: '2016-01-02T22:45',\n        arrival_time: '2016-01-03T17:20',\n      },\n    },\n  ],\n  passenger_segment_info: [\n    {\n      segment_id: 's001',\n      passenger_id: 'p001',\n      seat: '12A',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's001',\n      passenger_id: 'p002',\n      seat: '12B',\n      seat_type: 'Business',\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p001',\n      seat: '73A',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n    {\n      segment_id: 's002',\n      passenger_id: 'p002',\n      seat: '73B',\n      seat_type: 'World Business',\n      product_info: [\n        {\n          title: 'Lounge',\n          value: 'Complimentary lounge access',\n        },\n        {\n          title: 'Baggage',\n          value: '1 extra bag 50lbs',\n        },\n      ],\n    },\n  ],\n  price_info: [\n    {\n      title: 'Fuel surcharge',\n      amount: '1597',\n      currency: 'USD',\n    },\n  ],\n  base_price: '12206',\n  tax: '200',\n  total_price: '14003',\n  currency: 'USD',\n});\n```\n\n<br />\n\n## `sendAirlineUpdateTemplate(userId, attributes [, options])` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template)\n\nSend airline flight update message templates to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request).\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411064-e3005a56-27dc-11e8-8486-4fc548ad7b1a.png\" alt=\"sendAirlineUpdateTemplate\" width=\"250\" />\n\n| Param      | Type                              | Description                                                                                                                                       |\n| ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId     | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object.                                                         |\n| attributes | `Object`                          | [payload](https://developers.facebook.com/docs/messenger-platform/send-api-reference/airline-update-template#payload) of update template.         |\n| options    | `Object`                          | Other optional parameters. For example, [messaging types](https://developers.facebook.com/docs/messenger-platform/send-messages#messaging_types). |\n\nExample:\n\n```js\nclient.sendAirlineUpdateTemplate(USER_ID, {\n  intro_message: 'Your flight is delayed',\n  update_type: 'delay',\n  locale: 'en_US',\n  pnr_number: 'CF23G2',\n  update_flight_info: {\n    flight_number: 'KL123',\n    departure_airport: {\n      airport_code: 'SFO',\n      city: 'San Francisco',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    arrival_airport: {\n      airport_code: 'AMS',\n      city: 'Amsterdam',\n      terminal: 'T4',\n      gate: 'G8',\n    },\n    flight_schedule: {\n      boarding_time: '2015-12-26T10:30',\n      departure_time: '2015-12-26T11:30',\n      arrival_time: '2015-12-27T07:30',\n    },\n  },\n});\n```\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quick_replies` option to send message methods, for example, with `sendText`:\n\n```js\nclient.sendText(USER_ID, 'Pick a color:', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith `sendImage`:\n\n```js\nclient.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quick_replies: [\n    {\n      content_type: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of send message methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n## `sendSenderAction(userId, action)`\n\nSend sender actions to specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), to let users know you are processing their request.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n| action | `String`                          | Name of the action.                                                                       |\n\nExample:\n\n```js\nclient.sendSenderAction(USER_ID, 'typing_on');\n```\n\n<br />\n\n## `markSeen(userId)`\n\nMark last message as read for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.markSeen(USER_ID);\n```\n\n<br />\n\n## `typingOn(userId)`\n\nTurn typing indicators on for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOn(USER_ID);\n```\n\n<br />\n\n## `typingOff(userId)`\n\nTurn typing indicators off for specified user.\n\n| Param  | Type                              | Description                                                                               |\n| ------ | --------------------------------- | ----------------------------------------------------------------------------------------- |\n| userId | <code>String &#124; Object</code> | Page-scoped user ID of the recipient or [recipient][send-api-reference#recipient] object. |\n\nExample:\n\n```js\nclient.typingOff(USER_ID);\n```\n\n<br />\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `is_reusable` property set to `true` can be sent to other message recipients.\n\n## `uploadAttachment(type, attachment, options)`\n\nUpload specified type attachment using URL address, buffer, or stream.\n\n| Param               | Type                                                                                             | Description                                    |\n| ------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------- |\n| type                | `String`                                                                                         | Must be one of `image | video | audio | file`. |\n| attachment          | <code>String &#124; Buffer &#124; ReadStream</code>                                              | Attachment to be uploaded.                     |\n| options             | `Object`                                                                                         | Other optional parameters.                     |\n| options.is_reusable | Set to `true` to make the saved asset sendable to other message recipients. Defaults to `false`. |\n| options.filename    | Required when upload from buffer.                                                                |\n\nExample:\n\n```js\nclient.uploadAttachment('image', 'http://www.example.com/image.jpg', {\n  is_reusable: true,\n});\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAttachment('image', fs.createReadStream('image.jpg'), {\n  is_reusable: true,\n});\n```\n\nOr using buffer:\n\n```js\nclient.uploadAttachment('image', buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadAudio(audio, options)`\n\nUpload audio attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| audio   | <code>String &#124; Buffer &#124; ReadStream</code> | The audio to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadAudio('http://www.example.com/audio.mp3', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadAudio(fs.createReadStream('audio.mp3'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadAudio(buffer, {\n  is_reusable: true,\n  filename: 'audio.mp3',\n});\n```\n\n<br />\n\n## `uploadImage(image, options)`\n\nUpload image attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| image   | <code>String &#124; Buffer &#124; ReadStream</code> | The image to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadImage('http://www.example.com/image.jpg', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadImage(fs.createReadStream('image.jpg'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadImage(buffer, {\n  is_reusable: true,\n  filename: 'image.jpg',\n});\n```\n\n<br />\n\n## `uploadVideo(video, options)`\n\nUpload video attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| video   | <code>String &#124; Buffer &#124; ReadStream</code> | The video to be uploaded.  |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadVideo('http://www.example.com/video.mp4', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadVideo(fs.createReadStream('video.mp4'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadVideo(buffer, {\n  is_reusable: true,\n  filename: 'video.mp4',\n});\n```\n\n<br />\n\n## `uploadFile(file, options)`\n\nUpload file attachment using URL address, buffer, or stream.\n\n| Param   | Type                                                | Description                |\n| ------- | --------------------------------------------------- | -------------------------- |\n| file    | <code>String &#124; Buffer &#124; ReadStream</code> | The file to be uploaded.   |\n| options | `Object`                                            | Other optional parameters. |\n\nExample:\n\n```js\nclient.uploadFile('http://www.example.com/file.pdf', { is_reusable: true });\n```\n\nOr using read stream:\n\n```js\nconst fs = require('fs');\n\nclient.uploadFile(fs.createReadStream('file.pdf'), { is_reusable: true });\n```\n\nOr using buffer:\n\n```js\nclient.uploadFile(buffer, {\n  is_reusable: true,\n  filename: 'file.pdf',\n});\n```\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n## `sendBatch(requests)`\n\nSends multiple requests in one batch.\n\n| Param    | Type            | Description               |\n| -------- | --------------- | ------------------------- |\n| requests | `Array<Object>` | Subrequests in the batch. |\n\nExample\n\n```js\nconst { MessengerBatch } = require('messaging-api-messenger');\n\nclient.sendBatch([\n  MessengerBatch.sendText(USER_ID, '1'),\n  MessengerBatch.sendText(USER_ID, '2'),\n  MessengerBatch.sendText(USER_ID, '3'),\n  MessengerBatch.sendText(USER_ID, '4'),\n  MessengerBatch.sendText(USER_ID, '5'),\n]);\n```\n\nThere are a bunch of factory methods can be used to create batch messages:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendListTemplate`\n- `MessengerBatch.sendOpenGraphTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods exactly have same argument signature with client methods.\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages)\n\nTo use the broadcast API, your Messenger bot must have the following permissions:\n\n- `pages_messaging`\n- `pages_messaging_subscriptions`\n\n## `createMessageCreative(messages)`\n\n| Param    | Type            | Description           |\n| -------- | --------------- | --------------------- |\n| messages | `Array<Object>` | The messages to send. |\n\nExample\n\n```js\nclient\n  .createMessageCreative([\n    {\n      attachment: {\n        type: 'template',\n        payload: {\n          template_type: 'generic',\n          elements: [\n            {\n              title: 'Welcome to Our Marketplace!',\n              image_url: 'https://www.facebook.com/jaspers.png',\n              subtitle: 'Fresh fruits and vegetables. Yum.',\n              buttons: [\n                {\n                  type: 'web_url',\n                  url: 'https://www.jaspersmarket.com',\n                  title: 'View Website',\n                },\n              ],\n            },\n          ],\n        },\n      },\n    },\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\nor you can use message factory methods to create message creative:\n\n```js\nconst { Messenger } = require('messaging-api-messenger');\n\nclient\n  .createMessageCreative([\n    Messenger.createGenericTemplate([\n      {\n        title: 'Welcome to Our Marketplace!',\n        image_url: 'https://www.facebook.com/jaspers.png',\n        subtitle: 'Fresh fruits and vegetables. Yum.',\n        buttons: [\n          {\n            type: 'web_url',\n            url: 'https://www.jaspersmarket.com',\n            title: 'View Website',\n          },\n        ],\n      },\n    ]),\n  ])\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_creative_id: 938461089,\n    // }\n  });\n```\n\n- `Messenger.createMessage`\n- `Messenger.createText`\n- `Messenger.createAttachment`\n- `Messenger.createAudio`\n- `Messenger.createImage`\n- `Messenger.createVideo`\n- `Messenger.createFile`\n- `Messenger.createTemplate`\n- `Messenger.createButtonTemplate`\n- `Messenger.createGenericTemplate`\n- `Messenger.createListTemplate`\n- `Messenger.createOpenGraphTemplate`\n- `Messenger.createMediaTemplate`\n- `Messenger.createReceiptTemplate`\n- `Messenger.createAirlineBoardingPassTemplate`\n- `Messenger.createAirlineCheckinTemplate`\n- `Messenger.createAirlineItineraryTemplate`\n- `Messenger.createAirlineUpdateTemplate`\n\nThe following message templates are not supported in broadcast API:\n\n- Airline boarding pass template\n- Airline check-in template\n- Airline itinerary template\n- Airline flight update template\n- Receipt template\n- Open graph template\n\n<br />\n\n## `sendBroadcastMessage(messageCreativeId, options)`\n\n| Param                   | Type     | Description                                                                                                                                       |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| messageCreativeId       | `Number` | The `message_creative_id` of the message creative to send in the broadcast.                                                                       |\n| options                 | `Object` | Other optional parameters.                                                                                                                        |\n| options.custom_label_id | `Number` | The id of custom label.                                                                                                                           |\n| options.targeting       | `Object` | The targeting config.                                                                                                                             |\n| options.schedule_time   | `String` | ISO-8601 and Unix timestamp formats are accepted. For example 2018-04-05T20:39:13+00:00 and 1522960753 both represent 8:39:13pm 04/05/2018 (UTC). |\n\nExample\n\n```js\nclient.sendBroadcastMessage(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   broadcast_id: 827,\n  // }\n});\n```\n\nTo send a broadcast message to the set of PSIDs associated with a label, pass label id as `custom_label_id` option:\n\n```js\nclient.sendBroadcastMessage(938461089, { custom_label_id: LABEL_ID });\n```\n\nOr you can send broadcast messages with label predicates (`and`, `or`, `not`):\n\n```js\nimport { MessengerBroadcast } from 'messaging-api-messenger';\n\nconst { add, or, not } = MessengerBroadcast;\n\nclient.sendBroadcastMessage(938461089, {\n  targeting: {\n    labels: and(\n      '<CUSTOM_LABEL_ID_1>'\n      or(\n        '<UNDER_25_CUSTOMERS_LABEL_ID>',\n        '<OVER_50_CUSTOMERS_LABEL_ID>'\n      )\n    ),\n  },\n});\n```\n\n<br />\n\n## `sendSponsoredMessage(adAccountId, args)`\n\n| Param                       | Type          | Description                                                                                                  |\n| --------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |\n| adAccountId                 | `String`      | The Ad account ID. [See more](https://developers.facebook.com/docs/marketing-api/guides/messenger-sponsored) |\n| message                     | `Object`      | The Object to pass into request body.                                                                        |\n| message.message_creative_id | `Number`      | The ID of the Message Creative you want to send.                                                             |\n| message.daily_budget        | `Number`      | The maximum daily budget of the ad campaign for sending the sponsored message.                               |\n| message.bid_amount          | `Number`      | Maximum amount to bid for each message.                                                                      |\n| message.targeting           | `JSON String` | Option field for ads targeting                                                                               |\n\nExample\n\n```js\nclient\n  .sendSponsoredMessage('18910417349234', {\n    message_creative_id: 938461089,\n    daily_budget: 100,\n    bid_amount: 400,\n    targeting: \"{'geo_locations': {'countries':['US']}}\",\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   \"ad_group_id\": <AD_GROUP_ID>\n    //   \"broadcast_id\": <BROADCAST_ID>\n    //   \"success\": <RESPONSE_STATUS>\n    // }\n  });\n```\n\n<br />\n\n<a id=\"targeting-broadcast-messages\" />\n\n### Targeting Broadcast Messages - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/target-broadcasts)\n\n## `createLabel(name)`\n\nCreating a Label.\n\n| Param | Type     | Description               |\n| ----- | -------- | ------------------------- |\n| name  | `String` | name of the custom label. |\n\nExample:\n\n```js\nclient.createLabel('awesome').then((label) => {\n  console.log(label);\n  // {\n  //   id: 1712444532121303\n  // }\n});\n```\n\n<br />\n\n## `associateLabel(userId, labelId)`\n\nAssociating a Label to a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.associateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `dissociateLabel(userId, labelId)`\n\nRemoving a Label From a PSID.\n\n| Param   | Type     | Description                           |\n| ------- | -------- | ------------------------------------- |\n| userId  | `String` | Page-scoped user ID of the recipient. |\n| labelId | `String` | ID of the custom label.               |\n\nExample:\n\n```js\nclient.dissociateLabel(USER_ID, LABEL_ID);\n```\n\n<br />\n\n## `getAssociatedLabels(userId)`\n\nRetrieving Labels Associated with a PSID.\n\n| Param  | Type     | Description                           |\n| ------ | -------- | ------------------------------------- |\n| userId | `String` | Page-scoped user ID of the recipient. |\n\nExample:\n\n```js\nclient.getAssociatedLabels(USER_ID).then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `getLabelDetails(labelId, options)`\n\nRetrieving Label Details.\n\n| Param          | Type            | Description                     |\n| -------------- | --------------- | ------------------------------- |\n| labelId        | `String`        | ID of the custom label.         |\n| options.fields | `Array<String>` | fields to retrieve with its ID. |\n\nExample:\n\n```js\nclient.getLabelDetails(LABEL_ID, { fields: ['name'] }).then((result) => {\n  console.log(result);\n  // {\n  //   id: \"1001200005002\",\n  //   name: \"myLabel\",\n  // }\n});\n```\n\n<br />\n\n## `getLabelList()`\n\nRetrieving a List of All Labels.\n\nExample:\n\n```js\nclient.getLabelList().then((result) => {\n  console.log(result);\n  // {\n  //   data: [\n  //     {\n  //       name: 'myLabel',\n  //       id: '1001200005003',\n  //     },\n  //     {\n  //       name: 'myOtherLabel',\n  //       id: '1001200005002',\n  //     },\n  //   ],\n  //   paging: {\n  //     cursors: {\n  //       before:\n  //         'QVFIUmx1WTBpMGpJWXprYzVYaVhabW55dVpycko4U2xURGE5ODNtNFZAPal94a1hTUnNVMUtoMVVoTzlzSDktUkMtQkUzWEFLSXlMS3ZALYUw3TURLelZAPOGVR',\n  //       after:\n  //         'QVFIUmItNkpTbjVzakxFWGRydzdaVUFNNnNPaUl0SmwzVHN5ZAWZAEQ3lZANDAzTXFIM0NHbHdYSkQ5OG1GaEozdjkzRmxpUFhxTDl4ZAlBibnE4LWt1eGlTa3Bn',\n  //     },\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `deleteLabel(labelId)`\n\nDeleting a Label.\n\n| Param   | Type     | Description             |\n| ------- | -------- | ----------------------- |\n| labelId | `String` | ID of the custom label. |\n\nExample:\n\n```js\nclient.deleteLabel(LABEL_ID);\n```\n\n<br />\n\n<br />\n\n<a id=\"estimating-broadcast-size\" />\n\n### Estimating Broadcast Size - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/estimate-reach)\n\n## `startReachEstimation(customLabelId)`\n\n| Param         | Type     | Description          |\n| ------------- | -------- | -------------------- |\n| customLabelId | `Number` | The custom label ID. |\n\nExample\n\n```js\nclient.startReachEstimation(938461089).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation_id\": <REACH_ESTIMATION_ID>\n  // }\n});\n```\n\n<br />\n\n## `getReachEstimate(reachEstimationId)`\n\n| Param             | Type     | Description                                        |\n| ----------------- | -------- | -------------------------------------------------- |\n| reachEstimationId | `Number` | The reach estimate ID from _startReachEstimation_. |\n\nExample\n\n```js\nclient.getReachEstimate(73450120243).then((result) => {\n  console.log(result);\n  // {\n  //   \"reach_estimation\": \"<REACH_ESTIMATE>\"\n  //   \"id\": \"<REACH_ESTIMATION_ID>\"\n  // }\n});\n```\n\n<br />\n\n<a id=\"broadcast-metrics\" />\n\n### Broadcast Metrics - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#metrics)\n\n## `getBroadcastMessagesSent(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `Number` | The broadcast ID. |\n\nExample\n\n```js\nclient.getBroadcastMessagesSent(73450120243).then((result) => {\n  console.log(result);\n  // [\n  //   {\n  //     \"name\": \"messages_sent\",\n  //     \"period\": \"lifetime\",\n  //     \"values\": [\n  //       {\n  //         \"value\": 1000,\n  //         \"end_time\": \"1970-01-02T00:00:00+0000\"\n  //       }\n  //     ],\n  //     \"title\": \"Lifetime number of messages sent from the page broadcast\",\n  //     \"description\": \"Lifetime: The total number of messages sent from a Page to people.\",\n  //     \"id\": \"1301333349933076/insights/messages_sent\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"scheduling-broadcasts\" />\n\n### Scheduling Broadcasts - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/broadcast-messages/#scheduling)\n\nTo schedule a broadcast, specify the `schedule_time` property when you call the `sendBroadcastMessage` API request to send the message.\n\n```js\nclient\n  .sendBroadcastMessage(938461089, {\n    schedule_time: '2018-04-05T20:39:13+00:00',\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   broadcast_id: '115517705935329',\n    // }\n  });\n```\n\n## `cancelBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCancel a scheduled broadcast.\n\n```js\nclient.cancelBroadcast('115517705935329');\n```\n\n## `getBroadcast(broadcastId)`\n\n| Param       | Type     | Description       |\n| ----------- | -------- | ----------------- |\n| broadcastId | `String` | The broadcast ID. |\n\nCheck on broadcast status.\n\n```js\nclient.getBroadcast('115517705935329').then((broadcast) => {\n  console.log(broadcast);\n  // {\n  //   scheduled_time: '2018-04-05T20:39:13+00:00',\n  //   status: 'SCHEDULED',\n  //   id: \"115517705935329\"\n  // }\n});\n```\n\nThe API will respond with the time the broadcast is scheduled for, and one of the following statuses:\n\n- `SCHEDULED`: Broadcast is scheduled but has not been sent.\n- `IN_PROGRESS`: Broadcast has been initiated and is still in-progress.\n- `FINISHED`: Broadcast was completed successfully.\n- `CANCELED`: Broadcast was canceled by the developer.\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n## `getUserProfile(userId, options)`\n\nRetrieving a Person's Profile.\n\n| Param          | Type            | Description                                                                                                                                                                      |\n| -------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userId         | `String`        | Page-scoped user ID of the recipient.                                                                                                                                            |\n| options.fields | `Array<String>` | Value must be among `id`, `name`, `first_name`, `last_name`, `profile_pic`, `locale`, `timezone`, `gender`, default with `id`, `name`, `first_name`, `last_name`, `profile_pic`, |\n\nExample:\n\n```js\nclient.getUserProfile(USER_ID).then((user) => {\n  console.log(user);\n  // {\n  //   id: '5566'\n  //   first_name: 'Johnathan',\n  //   last_name: 'Jackson',\n  //   profile_pic: 'https://example.com/pic.png',\n  // }\n});\n```\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n## `getMessengerProfile(fields)`\n\nRetrieves the current value of one or more Messenger Profile properties by name.\n\n| Param  | Type            | Description                                                                                                     |\n| ------ | --------------- | --------------------------------------------------------------------------------------------------------------- |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`. |\n\nExample:\n\n```js\nclient\n  .getMessengerProfile(['get_started', 'persistent_menu'])\n  .then((profile) => {\n    console.log(profile);\n    // [\n    //   {\n    //     get_started: {\n    //       payload: 'GET_STARTED',\n    //     },\n    //   },\n    //   {\n    //     persistent_menu: [\n    //       {\n    //         locale: 'default',\n    //         composer_input_disabled: true,\n    //         call_to_actions: [\n    //           {\n    //             type: 'postback',\n    //             title: 'Restart Conversation',\n    //             payload: 'RESTART',\n    //           },\n    //         ],\n    //       },\n    //     ],\n    //   },\n    // ]\n  });\n```\n\n<br />\n\n## `setMessengerProfile(profile)`\n\nSets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.\n\n| Param   | Type     | Description                                                                                                                      |\n| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| profile | `Object` | Object of [Profile](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api#profile_properties). |\n\nExample:\n\n```js\nclient.setMessengerProfile({\n  get_started: {\n    payload: 'GET_STARTED',\n  },\n  persistent_menu: [\n    {\n      locale: 'default',\n      composer_input_disabled: true,\n      call_to_actions: [\n        {\n          type: 'postback',\n          title: 'Restart Conversation',\n          payload: 'RESTART',\n        },\n      ],\n    },\n  ],\n});\n```\n\n<br />\n\n## `deleteMessengerProfile(fields)`\n\nDeletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.\n\n| Param  | Type            | Description                                                                                                     |\n| ------ | --------------- | --------------------------------------------------------------------------------------------------------------- |\n| fields | `Array<String>` | Value must be among `account_linking_url`, `persistent_menu`, `get_started`, `greeting`, `whitelisted_domains`. |\n\nExample:\n\n```js\nclient.deleteMessengerProfile(['get_started', 'persistent_menu']);\n```\n\n<br />\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n## `getPersistentMenu`\n\nRetrieves the current value of persistent menu.\n\nExample:\n\n```js\nclient.getPersistentMenu().then((menu) => {\n  console.log(menu);\n  // [\n  //   {\n  //     locale: 'default',\n  //     composer_input_disabled: true,\n  //     call_to_actions: [\n  //       {\n  //         type: 'postback',\n  //         title: 'Restart Conversation',\n  //         payload: 'RESTART',\n  //       },\n  //       {\n  //         type: 'web_url',\n  //         title: 'Powered by ALOHA.AI, Yoctol',\n  //         url: 'https://www.yoctol.com/',\n  //       },\n  //     ],\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setPersistentMenu(menu)`\n\nSets the values of persistent menu.\n\n| Param | Type            | Description                                                                                                                          |\n| ----- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |\n| menu  | `Array<Object>` | Array of [menu](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu#properties). |\n\nExample:\n\n```js\nclient.setPersistentMenu([\n  {\n    locale: 'default',\n    call_to_actions: [\n      {\n        title: 'Play Again',\n        type: 'postback',\n        payload: 'RESTART',\n      },\n      {\n        title: 'Language Setting',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: '中文',\n            type: 'postback',\n            payload: 'CHINESE',\n          },\n          {\n            title: 'English',\n            type: 'postback',\n            payload: 'ENGLISH',\n          },\n        ],\n      },\n      {\n        title: 'Explore D',\n        type: 'nested',\n        call_to_actions: [\n          {\n            title: 'Explore',\n            type: 'web_url',\n            url: 'https://www.youtube.com/watch?v=v',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'W',\n            type: 'web_url',\n            url: 'https://www.facebook.com/w',\n            webview_height_ratio: 'tall',\n          },\n          {\n            title: 'Powered by YOCTOL',\n            type: 'web_url',\n            url: 'https://www.yoctol.com/',\n            webview_height_ratio: 'tall',\n          },\n        ],\n      },\n    ],\n  },\n]);\n```\n\n> Note: You must set a get started button to use the persistent menu.\n\n<br />\n\n## `deletePersistentMenu`\n\nDeletes persistent menu.\n\nExample:\n\n```js\nclient.deletePersistentMenu();\n```\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n## `getGetStarted`\n\nRetrieves the current value of get started button.\n\nExample:\n\n```js\nclient.getGetStarted().then((getStarted) => {\n  console.log(getStarted);\n  // {\n  //   payload: 'GET_STARTED',\n  // }\n});\n```\n\n<br />\n\n## `setGetStarted(payload)`\n\nSets the values of get started button.\n\n| Param   | Type     | Description                                                                                                 |\n| ------- | -------- | ----------------------------------------------------------------------------------------------------------- |\n| payload | `String` | Payload sent back to your webhook in a `messaging_postbacks` event when the 'Get Started' button is tapped. |\n\nExample:\n\n```js\nclient.setGetStarted('GET_STARTED');\n```\n\n<br />\n\n## `deleteGetStarted`\n\nDeletes get started button.\n\nExample:\n\n```js\nclient.deleteGetStarted();\n```\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n## `getGreeting`\n\nRetrieves the current value of greeting text.\n\nExample:\n\n```js\nclient.getGreeting().then((greeting) => {\n  console.log(greeting);\n  // [\n  //   {\n  //     locale: 'default',\n  //     text: 'Hello!',\n  //   },\n  // ]\n});\n```\n\n<br />\n\n## `setGreeting(greeting)`\n\nSets the values of greeting text.\n\n| Param    | Type            | Description                                                                                                                       |\n| -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| greeting | `Array<Object>` | Array of [greeting](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting#properties). |\n\nExample:\n\n```js\nclient.setGreeting([\n  {\n    locale: 'default',\n    text: 'Hello!',\n  },\n]);\n```\n\n<br />\n\n## `deleteGreeting`\n\nDeletes greeting text.\n\nExample:\n\n```js\nclient.deleteGreeting();\n```\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n## `getWhitelistedDomains`\n\nRetrieves the current value of whitelisted domains.\n\nExample:\n\n```js\nclient.getWhitelistedDomains().then((domains) => {\n  console.log(domains);\n  // ['http://www.example.com/']\n});\n```\n\n<br />\n\n## `setWhitelistedDomains(domains)`\n\nSets the values of whitelisted domains.\n\n| Param   | Type            | Description                                                                                                                                            |\n| ------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| domains | `Array<String>` | Array of [whitelisted_domain](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting#properties). |\n\nExample:\n\n```js\nclient.setWhitelistedDomains(['www.example.com']);\n```\n\n<br />\n\n## `deleteWhitelistedDomains`\n\nDeletes whitelisted domains.\n\nExample:\n\n```js\nclient.deleteWhitelistedDomains();\n```\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n## `getAccountLinkingURL`\n\nRetrieves the current value of account linking URL.\n\nExample:\n\n```js\nclient.getAccountLinkingURL().then((accountLinking) => {\n  console.log(accountLinking);\n  // {\n  //   account_linking_url:\n  //     'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',\n  // }\n});\n```\n\n<br />\n\n## `setAccountLinkingURL(url)`\n\nSets the values of account linking URL.\n\n| Param | Type     | Description          |\n| ----- | -------- | -------------------- |\n| url   | `String` | Account linking URL. |\n\nExample:\n\n```js\nclient.setAccountLinkingURL(\n  'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic'\n);\n```\n\n<br />\n\n## `deleteAccountLinkingURL`\n\nDeletes account linking URL.\n\nExample:\n\n```js\nclient.deleteAccountLinkingURL();\n```\n\n<br />\n\n<a id=\"target-audience\" />\n\n### Target Audience - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/target-audience)\n\n## `getTargetAudience`\n\nRetrieves the current value of target audience.\n\nExample:\n\n```js\nclient.getTargetAudience().then((targetAudience) => {\n  console.log(targetAudience);\n  // {\n  //   audience_type: 'custom',\n  //   countries: {\n  //     whitelist: ['US', 'CA'],\n  //   },\n  // }\n});\n```\n\n<br />\n\n## `setTargetAudience(type, whitelist, blacklist)`\n\nSets the values of target audience.\n\n| Param     | Type            | Description                                                                                                                             |\n| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| type      | `String`        | Audience type. Valid values include `all | custom | none`.                                                                              |\n| whitelist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the blacklist countries won't see your bot on discovery surfaces on Messenger Platform. |\n| blacklist | `Array<String>` | List of ISO 3166 Alpha-2 codes. Users in any of the whitelist countries will see your bot on discovery surfaces on Messenger Platform.  |\n\nExmaple:\n\n```js\nclient.setTargetAudience('custom', ['US', 'CA'], ['UK']);\n```\n\n<br />\n\n## `deleteTargetAudience`\n\nDeletes target audience.\n\nExample:\n\n```js\nclient.deleteTargetAudience();\n```\n\n<br />\n\n<a id=\"chat-extension-home-url\" />\n\n### Chat Extension Home URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/home-url)\n\n## `getHomeURL`\n\nRetrieves the current value of chat extension home URL.\n\nExample:\n\n```js\nclient.getHomeURL().then((chatExtension) => {\n  console.log(chatExtension);\n  // {\n  //   url: 'http://petershats.com/send-a-hat',\n  //   webview_height_ratio: 'tall',\n  //   in_test: true,\n  // }\n});\n```\n\n<br />\n\n## `setHomeURL(url, attributes)`\n\nSets the values of chat extension home URL.\n\n| Param      | Type     | Description                                                                                                                                  |\n| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String` | The URL to be invoked from drawer.                                                                                                           |\n| attributes | `Object` | Other [properties](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/home-url#properties) of home URL. |\n\nExmaple:\n\n```js\nclient.setHomeURL('http://petershats.com/send-a-hat', {\n  webview_height_ratio: 'tall',\n  in_test: true,\n});\n```\n\n<br />\n\n## `deleteHomeURL`\n\nDeletes chat extension home URL.\n\nExample:\n\n```js\nclient.deleteHomeURL();\n```\n\n<br />\n\n<a id=\"messenger-code-api\" />\n\n### Messenger Code API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-code)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16685647_261975084241469_2329165888516784128_n.png?oh=61941dc020355f5c8fe88035d33f1503&oe=59F612D6)\n\n## `generateMessengerCode(options)`\n\nGenerating a Messenger code.\n\n| Param              | Type     | Description                                                                   |\n| ------------------ | -------- | ----------------------------------------------------------------------------- |\n| options            | `Object` | Optional parameters of generating a Messenger code.                           |\n| options.image_size | `Number` | The size, in pixels, for the image you are requesting.                        |\n| options.data       | `Object` | If creating a parametric code, pass `{ \"data\": { \"ref\": \"YOUR_REF_HERE\" } }`. |\n\nExample:\n\n```js\nclient\n  .generateMessengerCode({\n    data: {\n      ref: 'billboard-ad',\n    },\n    image_size: 1000,\n  })\n  .then((code) => {\n    console.log(code);\n    // {\n    //   \"uri\": \"YOUR_CODE_URL_HERE\"\n    // }\n  });\n```\n\n<br />\n\n### Handover Protocol API\n\n## `passThreadControl(userId, targetAppId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/pass-thread-control)\n\nPasses thread control from your app to another app.\n\n| Param       | Type     | Description                                                                      |\n| ----------- | -------- | -------------------------------------------------------------------------------- |\n| userId      | `String` | The PSID of the message recipient.                                               |\n| targetAppId | `Number` | The app ID of the Secondary Receiver to pass thread control to.                  |\n| metadata    | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControl(USER_ID, APP_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `passThreadControlToPageInbox(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control#page_inbox)\n\nPasses thread control from your app to \"Page Inbox\" app.\n\n| Param    | Type     | Description                                                                      |\n| -------- | -------- | -------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                               |\n| metadata | `String` | Metadata passed to the receiving app in the `pass_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.passThreadControlToPageInbox(\n  USER_ID,\n  'free formed text for another app'\n);\n```\n\n<br />\n\n## `takeThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/take-thread-control)\n\nTakes control of a specific thread from a Secondary Receiver app.\n\n| Param    | Type     | Description                                                                           |\n| -------- | -------- | ------------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                    |\n| metadata | `String` | Metadata passed back to the secondary app in the `take_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.takeThreadControl(USER_ID, 'free formed text for another app');\n```\n\n<br />\n\n## `requestThreadControl(userId, metadata)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/request-thread-control/)\n\nRequests control of a specific thread from a Primary Receiver app.\n\n| Param    | Type     | Description                                                                       |\n| -------- | -------- | --------------------------------------------------------------------------------- |\n| userId   | `String` | The PSID of the message recipient.                                                |\n| metadata | `String` | Metadata passed to the primary app in the `request_thread_control` webhook event. |\n\nExample:\n\n```js\nclient.requestThreadControl(USER_ID, 'free formed text for primary app');\n```\n\n<br />\n\n## `getThreadOwner` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/handover-protocol/get-thread-owner)\n\nGet the current thread owner.\n\n| Param  | Type     | Description                        |\n| ------ | -------- | ---------------------------------- |\n| userId | `String` | The PSID of the message recipient. |\n\nExample:\n\n```js\nclient.getThreadOwner(USER_ID).then((threadOwner) => {\n  console.log(threadOwner);\n  // {\n  //   app_id: '12345678910'\n  // }\n});\n```\n\n<br />\n\n## `getSecondaryReceivers` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/secondary-receivers)\n\nRetrieves the list of apps that are Secondary Receivers for a page.\n\nExample:\n\n```js\nclient.getSecondaryReceivers().then((receivers) => {\n  console.log(receivers);\n  // [\n  //   {\n  //     \"id\": \"12345678910\",\n  //     \"name\": \"David's Composer\"\n  //   },\n  //   {\n  //     \"id\": \"23456789101\",\n  //     \"name\": \"Messenger Rocks\"\n  //   }\n  // ]\n});\n```\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- Page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n## `getInsights(metrics, options)`\n\nRetrieves the insights of your Facebook Page.\n\n| Param         | Type     | Description                                                                                                                         |\n| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| metrics       | `Array`  | [The metrics](https://developers.facebook.com/docs/messenger-platform/reference/messaging-insights-api/#metrics) you want to check. |\n| options       | `Object` | Optional arguments.                                                                                                                 |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for.                                                                   |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.                                                                     |\n\nExample:\n\n```js\nclient\n  .getInsights(['page_messages_reported_conversations_unique'])\n  .then((counts) => {\n    console.log(counts);\n    // [\n    //   {\n    //     \"name\": \"page_messages_reported_conversations_unique\",\n    //     \"period\": \"day\",\n    //     \"values\": [\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       },\n    //       {\n    //         \"value\": \"<VALUE>\",\n    //         \"end_time\": \"<UTC_TIMESTAMP>\"\n    //       }\n    //     ]\n    //   }\n    // ]\n  });\n```\n\n<br />\n\n## `getBlockedConversations(options)`\n\nRetrieves the number of conversations with the Page that have been blocked.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getBlockedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_blocked_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //    ]\n  //   }\n});\n```\n\n<br />\n\n## `getReportedConversations(options)`\n\nRetrieves the number of conversations from your Page that have been reported by people for reasons such as spam, or containing inappropriate content.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getReportedConversations().then((counts) => {\n  console.log(counts);\n  //   {\n  //     \"name\": \"page_messages_reported_conversations_unique\",\n  //     \"period\": \"day\",\n  //     \"values\": [\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       },\n  //       {\n  //         \"value\": \"<VALUE>\",\n  //         \"end_time\": \"<UTC_TIMESTAMP>\"\n  //       }\n  //     ]\n  //   }\n});\n```\n\n<br />\n\n## `getOpenConversations(options)`\n\n**Deprecated**\n\n> `getOpenConversations()` is deprecated on May 11, 2018.\n> Currently this method returns the same result as the replacing method getTotalMessagingConnections()\n\nRetrieves the total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getOpenConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getTotalMessagingConnections(options)`\n\nRetrieves the number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getTotalMessagingConnections().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_total_messaging_connections',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1000, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 1000, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Messaging connections',\n  //   description:\n  //     'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',\n  //   id:\n  //     '1386473101668063/insights/page_messages_total_messaging_connections/day',\n  // }\n});\n```\n\n<br />\n\n## `getNewConversations(options)`\n\nRetrieves the number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.\n\n| Param         | Type     | Description                                                       |\n| ------------- | -------- | ----------------------------------------------------------------- |\n| options       | `Object` | Optional arguments.                                               |\n| options.since | `number` | Optional. UNIX timestamp of the start time to get the metric for. |\n| options.until | `number` | Optional. UNIX timestamp of the end time to get the metric for.   |\n\nExample:\n\n```js\nclient.getNewConversations().then((result) => {\n  console.log(result);\n  // {\n  //   name: 'page_messages_new_conversations_unique',\n  //   period: 'day',\n  //   values: [\n  //     { value: 1, end_time: '2018-03-12T07:00:00+0000' },\n  //     { value: 0, end_time: '2018-03-13T07:00:00+0000' },\n  //   ],\n  //   title: 'Daily unique new conversations count',\n  //   description:\n  //     'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',\n  //   id:\n  //     '1386473101668063/insights/page_messages_new_conversations_unique/day',\n  // }\n});\n```\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n## `setNLPConfigs(config)`\n\nSet values of NLP configs.\n\n| Param               | Type      | Description                                                                                                                                                                                                                                                                             |\n| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| config              | `Object`  | Configuration of NLP.                                                                                                                                                                                                                                                                   |\n| config.nlp_enabled  | `Boolean` | Optional. Either enable NLP or disable NLP for that Page.                                                                                                                                                                                                                               |\n| config.model        | `String`  | Optional. Specifies the NLP model to use. Either one of `{CHINESE, CROATIAN, DANISH, DUTCH, ENGLISH, FRENCH_STANDARD, GERMAN_STANDARD, HEBREW, HUNGARIAN, IRISH, ITALIAN_STANDARD, KOREAN, NORWEGIAN_BOKMAL, POLISH, PORTUGUESE, ROMANIAN, SPANISH, SWEDISH, VIETNAMESE}`, or `CUSTOM`. |\n| config.custom_token | `String`  | Optional. Access token from Wit.                                                                                                                                                                                                                                                        |\n| config.verbose      | `Boolean` | Optional. Specifies whether verbose mode if enabled, which returns extra information like the position of the detected entity in the query.                                                                                                                                             |\n| config.n_best       | `Number`  | Optional. The number of entities to return, in descending order of confidence. Minimum 1. Maximum 8. Defaults to 1.                                                                                                                                                                     |\n\nExample:\n\n```js\nclient.setNLPConfigs({\n  nlp_enabled: true,\n});\n```\n\n<br />\n\n## `enableNLP`\n\nEnabling Built-in NLP.\n\nExample:\n\n```js\nclient.enableNLP();\n```\n\n<br />\n\n## `disableNLP`\n\nDisabling Built-in NLP.\n\nExample:\n\n```js\nclient.disableNLP();\n```\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n## `logCustomEvents(activity)`\n\nLog custom events by using the [Application Activities Graph API](https://developers.facebook.com/docs/graph-api/reference/application/activities/) endpoint.\n\n| Param                        | Type            | Description                           |\n| ---------------------------- | --------------- | ------------------------------------- |\n| activity                     | `Object`        |\n| activity.app_id              | `Number`        | ID of the app.                        |\n| activity.page_id             | `String`        | ID of the page.                       |\n| activity.page_scoped_user_id | `String`        | Page-scoped user ID of the recipient. |\n| activity.events              | `Array<Object>` | Custom events.                        |\n\nExample:\n\n```js\nclient.logCustomEvents({\n  app_id: APP_ID,\n  page_id: PAGE_ID,\n  page_scoped_user_id: USER_ID,\n  events: [\n    {\n      _eventName: 'fb_mobile_purchase',\n      _valueToSum: 55.22,\n      _fb_currency: 'USD',\n    },\n  ],\n});\n```\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n## `getIdsForApps({ user_id, app_secret, ...options })`\n\nGiven a user ID for an app, retrieve the IDs for other apps owned by the same business\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForApps({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '10152368852405295',\n    //       app: {\n    //         category: 'Business',\n    //         link: 'https://www.facebook.com/games/?app_id=1419232575008550',\n    //         name: \"John's Game App\",\n    //         id: '1419232575008550',\n    //       },\n    //     },\n    //     {\n    //       id: '645195294',\n    //       app: {\n    //         link: 'https://apps.facebook.com/johnsmovieappns/',\n    //         name: 'JohnsMovieApp',\n    //         namespace: 'johnsmovieappns',\n    //         id: '259773517400382',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n## `getIdsForPages({ user_id, app_secret, ...options })`\n\nGiven a user ID for a Page (associated with a bot), retrieve the IDs for other Pages owned by the same business.\n\n| Param        | Type     | Description                   |\n| ------------ | -------- | ----------------------------- |\n| user_id      | `String` | Page-scoped user ID.          |\n| app_secret   | `String` | Secret of the app.            |\n| options.app  | `String` | The app to retrieve the IDs.  |\n| options.page | `String` | The page to retrieve the IDs. |\n\nExample:\n\n```js\nclient\n  .getIdsForPages({\n    user_id: USER_ID,\n    app_secret: APP_SECRET,\n  })\n  .then((result) => {\n    console.log(result);\n    // {\n    //   data: [\n    //     {\n    //       id: '12345123', // The psid for the user for that page\n    //       page: {\n    //         category: 'Musician',\n    //         link:\n    //           'https://www.facebook.com/Johns-Next-Great-Thing-380374449010653/',\n    //         name: \"John's Next Great Thing\",\n    //         id: '380374449010653',\n    //       },\n    //     },\n    //   ],\n    //   paging: {\n    //     cursors: {\n    //       before: 'MTQ4OTU4MjQ5Nzc4NjY4OAZDZDA',\n    //       after: 'NDAwMDExOTA3MDM1ODMwA',\n    //     },\n    //   },\n    // };\n  });\n```\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n## `createPersona(persona)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#create)\n\nCreates a persona.\n\n| Param                       | Type                | Description                     |\n| --------------------------- | ------------------- | ------------------------------- |\n| persona.name                | <code>String</code> | name of the persona.            |\n| persona.profile_picture_url | <code>String</code> | profile picture of the persona. |\n\n```js\ncreatePersona({\n  name: 'John Mathew',\n  profile_picture_url: 'https://facebook.com/john_image.jpg',\n}).then((persona) => {\n  console.log(persona);\n  // {\n  //  \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#get)\n\nRetrieves the name and profile picture of a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ngetPersona(personaId).then((persona) => {\n  console.log(persona);\n  // {\n  //   \"name\": \"John Mathew\",\n  //   \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //   \"id\": \"<PERSONA_ID>\"\n  // }\n});\n```\n\n<br />\n\n## `getPersonas(cursor?: string)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves personas associated with a Page using the cursor.\n\n| Param  | Type                | Description        |\n| ------ | ------------------- | ------------------ |\n| cursor | <code>String</code> | pagination cursor. |\n\n```js\ngetPersonas(cursor).then((personas) => {\n  console.log(personas);\n  // {\n  //   \"data\": [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ],\n  //   \"paging\": {\n  //     \"cursors\": {\n  //       \"before\": \"QVFIUlMtR2ZATQlRtVUZALUlloV1\",\n  //       \"after\": \"QVFIUkpnMGx0aTNvUjJNVmJUT0Yw\"\n  //     }\n  //   }\n  // }\n});\n```\n\n<br />\n\n## `getAllPersonas()` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#retrieve_all)\n\nRetrieves all the personas associated with a Page.\n\n```js\ngetAllPersonas().then((personas) => {\n  console.log(personas);\n  //   [\n  //     {\n  //       \"name\": \"John Mathew\",\n  //       \"profile_picture_url\": \"https://facebook.com/john_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     },\n  //     {\n  //       \"name\": \"David Mark\",\n  //       \"profile_picture_url\": \"https://facebook.com/david_image.jpg\",\n  //       \"id\": \"<PERSONA_ID>\"\n  //     }\n  //   ]\n});\n```\n\n<br />\n\n## `deletePersona(personaId)` - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas/#remove)\n\nDeletes a persona.\n\n| Param     | Type                | Description        |\n| --------- | ------------------- | ------------------ |\n| personaId | <code>String</code> | ID of the persona. |\n\n```js\ndeletePersona(personaId);\n```\n\n<br />\n\n### Others\n\n## `debugToken` - [Official Docs](https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling)\n\nGets token information.\n\nExample:\n\n```js\nclient.debugToken().then((pageInfo) => {\n  console.log(pageInfo);\n  // {\n  //    app_id: '000000000000000',\n  //    application: 'Social Cafe',\n  //    expires_at: 1352419328,\n  //    is_valid: true,\n  //    issued_at: 1347235328,\n  //    scopes: ['email', 'user_location'],\n  //    user_id: 1207059,\n  //  }\n});\n```\n\n## `createSubscription`\n\nCreate new Webhooks subscriptions.\n\n| Param          | Type            | Description                                                                                                                       |\n| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| access_token   | `String`        | App access token.                                                                                                                 |\n| callback_url   | `String`        | The URL that will receive the POST request when an update is triggered, and a GET request when attempting this publish operation. |\n| verify_token   | `String`        | An arbitrary string that can be used to confirm to your server that the request is valid.                                         |\n| fields         | `Array<String>` | One or more of the set of valid fields in this object to subscribe to.                                                            |\n| object         | `String`        | Indicates the object type that this subscription applies to. Defaults to `page`.                                                  |\n| include_values | `Boolean`       | Indicates if change notifications should include the new values.                                                                  |\n\nExample:\n\n```js\nclient.createSubscription({\n  access_token: APP_ACCESS_TOKEN,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.createSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n  callback_url: 'https://mycallback.com',\n  fields: ['messages', 'messaging_postbacks', 'messaging_referrals'],\n  verify_token: VERIFY_TOKEN,\n});\n```\n\nDefault Fields:\n\n- `messages`\n- `messaging_postbacks`\n- `messaging_optins`\n- `messaging_referrals`\n- `messaging_handovers`\n- `messaging_policy_enforcement`\n\n## `getSubscriptions`\n\nGet the current Webhook subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getSubscriptions({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getSubscriptions({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n## `getPageSubscription`\n\nGet the current page subscriptions set up on your app.\n\n| Param        | Type     | Description       |\n| ------------ | -------- | ----------------- |\n| access_token | `String` | App access token. |\n\nExample:\n\n```js\nclient.getPageSubscription({\n  access_token: APP_ACCESS_TOKEN,\n});\n```\n\nOr provide app id and app secret instead of app access token:\n\n```js\nclient.getPageSubscription({\n  access_token: `${APP_ID}|${APP_SECRET}`,\n});\n```\n\n<br />\n\n## `getPageInfo`\n\nGet page name and page id using Graph API.\n\nExample:\n\n```js\nclient.getPageInfo().then((page) => {\n  console.log(page);\n  // {\n  //   name: 'Bot Demo',\n  //   id: '1895382890692546',\n  // }\n});\n```\n\n## getMessagingFeatureReview\n\nProgrammatically check the feature submission status of Page-level Platform features.\n\nExample:\n\n```js\nclient.getMessagingFeatureReview().then((data) => {\n  console.log(data);\n  // [\n  //   {\n  //     \"feature\": \"subscription_messaging\",\n  //     \"status\": \"<pending|rejected|approved|limited>\"\n  //   }\n  // ]\n});\n```\n\n## Debug Tips\n\n### Log requests details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api-messenger\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Test\n\n### Point requests to your dummy server\n\nTo avoid sending requests to real Messenger server, specify `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-messenger.js` in your project root:\n\n```js\n// __mocks__/messaging-api-messenger.js\nconst jestMock = require('jest-mock');\nconst {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient,\n} = require.requireActual('messaging-api-messenger');\n\nmodule.exports = {\n  Messenger,\n  MessengerBatch,\n  MessengerBroadcast,\n  MessengerClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(MessengerClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-messenger` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-messenger');\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0-beta.34","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-LylIpyPgEAI05kYtIw3Lo0mdisPxmgemDCf8CMfcRaI9xHWAtJf+Ra/j0m2hk/a+gC9tDQ0FVQ6qp+C0R54ctw==","shasum":"28c833b7d354ef2452b1bb22d242b61fd3922414","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0-beta.34.tgz","fileCount":46,"unpackedSize":715418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVdDpCRA9TVsSAnZWagAAfR4P/1pnfqow6mtmBpJac+tE\nC6Sdoy79aycBE3u32TzsSVHXwuicAxBjnEw2NgZA8S/3b0BiGoqu7QLSXhVZ\nOE/LMPWSloywzRbxgOkXekFeNdmfwkPwm9AjfUFW8FVBSY3pUTWfcBMGAuOE\nG+XGcjrBqZbB6CfooTsD40FeWULoTypbux8EmdBf1yhh7BBAM7YxluMMvPsS\naV1lXVoaab+Wupsu9bXgw6FLLHHd0RjULOnOfmOAR0r6CO4zzbJKdcVgWxtg\nDWJ1QLsfLffrR2PsUGj50U9WOUwkVSTLxM1VSCMfHgGLZmKMaULBJ6enexSf\n6wFf7TNQ7q3ELSzy5T72Y4DrJ7dl2iPIUv7ZNiig4r8yBIu/NMnRCKvnUPht\ntf+ymoiVr50lCuquKZYg+AwjUwOikgpwz++M+VeX4zxLV7s1WLes+SbydKgF\nDczxVScEaQY1odoDOdk7XmNRaTTNmfS1F2PnBIP88zU84gc5BnwdKrCoI52R\ngWzxY3MJJ25ZFemVUZjxnSuCFvA6YNqwE4wwxSs4ZEJEWpzLF4h5VmamwmLr\nSztwEAIivtT9KDI0NZIRBVEX4Gja4d21hUFpoiVvUQ9cYC6nICbjZ/gD+tWl\nVWCHpPHMsuJLSb/REIaPtYumEcHi4Whqgq5sqOM8RKu6gj9mXmNzbGkAQ22f\nldkz\r\n=M9Ur\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUFuJY/trewCqtQHW/Vmp++F6vE2WwvjkRYzTeyLfkrAiAJijZkeIp/jN3chvxCnTjmaVxa9EwTrWpP/EyqucYwqw=="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0-beta.34_1599459561416_0.4024811974595335"},"_hasShrinkwrap":false},"1.0.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"879afbd4bebbbb480dd5c1bd32e7cdcc5127437c","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.0","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-GsVnb2sd038LVRxZbwns8AfkJ2FD/BuNjx41ABf/MqaviA4g2ko+m2Xm6zrckL97Dk/X6OYSIQvo8Y5QCpqCyQ==","shasum":"6771b4bc3119b02079eb6b1b85f490d49094e0b6","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.0.tgz","fileCount":46,"unpackedSize":831620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVfVYCRA9TVsSAnZWagAAlLgP/3aSXGI11mcqtNGjIizT\nGqHLzYsCcOKwYjdTbfw11wyM33E188JgB0bA67tt6chomlA+bY68AMcC/qOB\nsOTb/B3xQLFVqiJOEIsK89EqlUhiwAH6znNhBm2Te6PJhVzszNHmucU+2ifl\neSU64H9uu6RNvtcr51DasbRrM8QU43cTWJhWqpGS+VHmR+OZ4Iaydckwfalr\nIWTMbjUZgPE57jGfX1r09eTbNSH6GG2f+YCGUGiWCF5mGP6xP96WPVWgyDX2\nTywZ7HyWsd0aCZX3qfKMPI5geItJzY8VWGNMpuu/rhsEZvpds8B9fHPOeoif\nZm4wRUv9VgqwOmt5QUqeXbJGINxDtdVidSMenWDOceXx4VIy69v4jHMKEDZl\nbt1H/whriYfkDtdIIqEN2gvbtXtJZbypRNLUVyRtDgBlcD/95ieHkLM0kFQD\nR93/r5KfNQ2hS/e0zYvL7tPTcGD/gL15BcVGA+u26yixFKm9rr5xNB7ktKr0\nujClS5XUUcgJ4dc5TXMkEzQfd7pKp/1YzPaz9OZMtqvcforzP+lURACEo0ww\nKXegj+22SZ4MoQqI6AavF/8d04TL7DiGo/0KDHml7v3EZzsodcVqltqUfSPi\ngfFbQvn5ZkvI+oXIVoePVkCz3KKmU9u5haUHnhHo0r/NkZkgo+e89pEwjXrL\nXP4c\r\n=hm6z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxNeIHY662Ybep5E+uhi9mvcWwlx4ITNFnOahaUCjeJgIgWE4s5B7NAYZ+pXszG6nzC5vOPHopBFGgmuFXtT5+PY4="}]},"maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.0_1599468887562_0.08337851019346565"},"_hasShrinkwrap":false},"1.0.1":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.1","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"cc72282a84bd6f2176f63bec462b15ae4dd37265","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.1","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-AO7/KYYgutDLnwL1KwR49CTvI+Iwn+qNlHIf7HBJ1GrPSd9WhHARUvdjmJQk9xgFv1UgMJMAVfJDRTgXk8sC5A==","shasum":"afa9a6a96e9d33cf0bead6e4d9c53475baddb91d","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.1.tgz","fileCount":46,"unpackedSize":830976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaFDWCRA9TVsSAnZWagAANEQP/30CdCNZNDg7YkfkEBNw\nO0wBcqbcxrtUy6tpo4n4fbd2VBAHULUGwgDv+PD36FMnQ0pXhyEyPvVzI9BR\ndqWv9Gvd9ZwKHFtsO4s7TkstP9fsIFeJgpvwEWXZllufe9DcSjKqtwZUXrGr\nB+RZ8havE9dVdYc/SpSegLdtR/1C3cl8hpRHDYnMoP7GLQKCQN/8tW6MT5OS\n2U6kn8GDpeJM77VjgBu47aCyNFYOrfq4PjzNvYffXLFoKn/+caRZ3Qhbco8+\nCZBWI1UffDZRs+inO4Jm5tePG5GQvSCU5P7iRfczx1Nvj2wAOy5Co+m1WnhV\nBTUWw9wP+ZnyNaeRu03dyO3dwaAbqbiXxoSFKxrjf9D11j7orA0Gm3lr5SB6\nbLWhCk9PK6bqISR1rZCuK1gWx3jZYJ1MDzuu42kqd6K50L+MB9pn1D3HK4fV\npOnFYBjhQnI9+y1rM7tBVEEw4mLFztnAA9MDvk8+0jhtYYTRQCzAu6vXZLqV\nboiiKFhhvtocqvTlarvODckGgvnBt4kJsTPPq/wKrAcrFBqrbaOJNs7jRxkM\nu1ApYj8UWOfIdNEoJWstit1nlaRzDj1CcV+k5lc6MbnBzaCsh1JmydkUvd+V\nqXP+jcvKG4vhdSvDO5ok20+6yt4tTjjpBesFYpSsNnlCxBIRWUOyLHcIoBWL\nVD6A\r\n=Tuv7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCToN589oB0AYKjk0N8Gd7KXvSfbGlZYQk6vKaE9HrfdwIgfzXaShu7YCksT6DcU7Kjyn1xJXyIT8Hwr2k9MdjfsF0="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.1_1600671958134_0.7347357832206249"},"_hasShrinkwrap":false},"1.0.2":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.2","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.19.2","axios-error":"^1.0.0","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"39aad597e2fdae7d297b754ed6a10ec514e3818b","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.2","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-YOrM1pKlmOlafECqidT5W78IQ3wWQo/dO5FtioFMIn4H48fkTsOtk0Il7+yd7H3w3oPeM24iwCA9U26pPK51uw==","shasum":"fa08676a5808f410b44951c41328e5c83504ee60","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.2.tgz","fileCount":46,"unpackedSize":833641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaIYGCRA9TVsSAnZWagAAyV4QAJ3OAWwCdu32kx63JlYl\n2pSJfWOUMJxOmPi7aS9b8gRYS5q46AbUs+XHBZxbxVN32eyPf20OmaRHChce\nQkvVQ57zLgpL/A3gHF8v4RRpejXDLOfluh+eGx+tveWEVU1wgwZ8l11H0zUW\nlKmhtziYbBYmQFfOA4NheKOo7m+UANQUORnsPG0ZrwlIP4R1oKTApCH6t2tA\nQYN5Ed0/fNkXOv/QJjJZoutjmmvOj/d4X5FSj/3Qz7vf4w2uM73PEMiIsmPV\nv/r85+aiOFaL+2CVLpyiyBO5Xe2pbstRY7wbsJXe97MUEVhO9OKqbqWrTnOU\na+tZ6vsEXSJzuRxUNNWrWOryg0qWn3QrCaJlQhsC7Lodx0f/VqjeosjOlEcq\nHqdnHRH6XuWGM+tyUgN640TSAutVYGo8OWRIQeNlkyCjL1eUrds+ZiQQM9JE\nyl/qOqnXmFv1ab92aVfBfdhs3fqR61KCx0vxRj1Yahrj3aRFn+qftRvWzUVa\nuLVNKoh6S2Pcnt5ZYiaaCNQoRzBUEOVSHBuHDviGU5H50/XP3LmsNBAPQDn9\neu+yhA+rb0rrq42DamiCsSxZtmqeutm6OAEVrYRxl9WRVe7uUkvjIJVPyOEQ\nn7Uu0Nw3ohGZdyQqk7Vb5ANilPggB1DzGlnsO5kiw4byG2lQi9kYDA8z9RRZ\nZbe5\r\n=h5Wi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUu8NsY9oJfSQQlIyNTTfWUjd19JyXChVWvJihSupgyAiEAuf62iEHGkmdqdWLUAi8GAtkCgK9LoPNym718dJqV9P4="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.2_1600685574252_0.21737486635906733"},"_hasShrinkwrap":false},"1.0.4":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.4","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.21.1","axios-error":"^1.0.4","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"8d0a6e0549448e353ce90878b2fe1d71db1d0596","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.4","_nodeVersion":"14.15.0","_npmVersion":"lerna/3.22.1/node@v14.15.0+x64 (darwin)","dist":{"integrity":"sha512-vBTT/MS1bJlolGgTCv7ttMlBT4XIlu3jOAMDFT1EWQMTlv/G6s4Ot2krsrRFjt/g7aGAgy9B8TtNGiTfsm5g1Q==","shasum":"117142aa1ca22c387a20c61fa987cbf1c795a1f2","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.4.tgz","fileCount":46,"unpackedSize":833641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf++q4CRA9TVsSAnZWagAAngwP/RJIl6NAUsc7lBcnBSjm\nMWtmsnT6eq4zjphhdM77qBHA6xrBP7YET8Fah/YFBmnx8LgLahFMoZD2rxwH\nQfKY1EFqQqSuGxQy1D9yF5Y47FXJDyprdfuLIQa4/oC97prrfqJEjpM1JwyI\nY2zGYJ0wz0NWmbx0HUwdXGA9Y/9qHE1dZYqlD916EbMA+XEKrn5eAfMjkrl5\nWiUp08Q0q3mJ7g/MP+X0KtCoBMav/lYxKMGtUgPTmLHHX+2qzUTvoYfemBYe\nG3hNB95tlV3qD2SQ1MN6z55TuitDb7bG7ZPbIQZb7Upsf4g4ObdLIVw8RCcA\nvl4hoi5kxg7KQCnKgONBGyJ21lAyuL1sRu9URpjys6Rw5ek/3QuH1eBFX+90\nW0mgOARvTtmjECHA7yLtCtUgosixuIyR55pdvwhn1wua+QOhI9sxRzV8rjIy\ndju27G7w7iA6X0i0ZUb0jxn1Lw+fJXna42BIg4REV1wNzOwXVYs1haL41fLr\nzxcL//lTvdR+06fxRCHKBFKqAe/C3eqxTElCQvy1T4CvxVTJ/4SAMORxUHAW\nKKrqvAnzpkimUT6KwdTaqp52dGX2wXeVhpbIBhLSKx4EGnFJ680XI/lRIqEA\nI5ElTAiCXOi/Tu8kAmXzbGCkVBNyQ9Tm1UkL+Nj4uPPIR6n1n1QczbAx7+/S\n1T2Q\r\n=yfHi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTq9RMOub65H4ZUhvEiTb6EeCVTn+gpr9YZLruWXLFbAIhAL9RPO887/TBb4M8YL9jcb1bHm4bCss12dXhDrh/OWC8"}]},"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.4_1610345143532_0.46232102520669294"},"_hasShrinkwrap":false},"1.0.5":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.5","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.21.1","axios-error":"^1.0.4","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"4279cce00374db3c6fc4c9ba270a8c8ca18433a7","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.5","_nodeVersion":"14.15.0","_npmVersion":"lerna/3.22.1/node@v14.15.0+x64 (darwin)","dist":{"integrity":"sha512-T17O+T6YAPkF8zDydsleMBtZ5HmCBDUZNHmF1nUUM82+WLaeqCTTHvJN3XR6hFjOA7XCTEXoxu4z+0A3QZv9yg==","shasum":"70a4a34df4582def7bc0ea03a8530644e2ed72aa","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.5.tgz","fileCount":46,"unpackedSize":833690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd+/qCRA9TVsSAnZWagAAsgwP/ip0k0+qudCv38Wxi8CD\nTxJbBERztXSOsim3fsa2M+UBn9oaf5mPlq0oTycJA+ZXFJmInZSHOyKp6T38\n+W2KXKE2uRjEeQljbTNh8zn1zolmE5xmFz/+nfvabBR39Ie0kZ5n+n6pRI2v\nZn+AhQV9lSkQzb2KOkvd7j27krzcPeLYMPD34eoy1lvo6jxkz/10/j9lzBgS\nZFulXugYDgmtU7/yXLcm2phCtSvioUN7JL4b3KxTMHzei07HV95Z7zNyGAfp\nIkeOoxNlBkm/Ibby5YIb6EcMmcrhETDe3yH7T0D0tMoJzRMHBb1tVcdWa83w\nDXzMv+/Fe0U8y7Usyc8ehVenR+nXQi0D4Oz1tNITBVH1/63nOxS+2hSdWoXi\n2AbC+/9J72UALyj/C26s/yOhWTwxiQ21F0+7ilehNwGTv+ITW46I8fSry+Am\nmpTAm2elrPBRi0JJVFIs+jqXLmZFd9VMAEzygejcxEOrBiwlv/9X6SJO5ygF\nxWLnII6WRNAw5NMUKG82SdCs3JUUUXNeymxdYQi92W2omjzCLIGXkAPmlgW/\nBxg/lrcYJ5HahfoSvs2VgDTzsQr94cSN2qUvWo8iVajJGfpgOBUCMIUJ4mp2\nPE3ixL4Pk5BGNUFWrfj51YxiE/Ts6f9NDnCFsoIwFKr7ViHX84abg3vUH1IB\n0r5P\r\n=+/Dj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDB+Wq+ncVuseaikE2QXvIs5FXTntMedb1+elSsJCPp/wIgNkGEqsrEnFtWlKbXZald5ioFHzpZadib6ozw56nAcLg="}]},"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.5_1618472938025_0.27619300772191946"},"_hasShrinkwrap":false},"1.0.6":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.6","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.21.1","axios-error":"^1.0.4","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"785284584a31f3c3a9daa63497ba7b0d6b7a2eb4","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.0.6","_nodeVersion":"14.17.5","_npmVersion":"lerna/3.22.1/node@v14.17.5+x64 (darwin)","dist":{"integrity":"sha512-yLrUGMF5v/PHMtEbfB62C70bqHsL9L9XGGA1v/GCJQeyjS4OWmSXOJTwDUm31chuppWaYx4br7WkxGM8UCDCfQ==","shasum":"606209b615dd539d82ec5b6e813b2a2dfea47585","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.0.6.tgz","fileCount":46,"unpackedSize":833746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMQrYCRA9TVsSAnZWagAAr/wP/As23V92Ue0Uj+maJCLE\nOM4AWNJWd5FoRjO2g8odUQpwu4Z9ljAnG93DKYytS8qjRC6kY9eWk01jcWOw\niA5L9bJrHcs2o8J7H2JRr6wl6htkhT0IJZNm+idQUuiMGorCm37e/pPWTCLR\nrt9zWrOTLhiSf9dHA7Dozzxkg+m6e64O8+2lobj4zQ5HMpfeNhI3MOEbp4ib\ncEZPvf93oBlX/ZMr607xd+qoOKNw7fHXOkf/qL2AzTxBuFJBaZMxuV2OBs2r\nR5fe6bsG4iSBHUAAhLHCGLj6nXyK4fTRn14f1vkO5zKm3zqMk/tk7iRFbffn\nw/66lQRtmIbGa8Qc/d6zBL+znwQ9Y99UVomh0wudOyg8WdJsBM0oIdPv77K+\nZc5bsZnn5K/vHq2iXycvoZS4DuU+gL16lyp25AtbX+ix6dAAg8ssJR8lube5\nO68qA7qdGgGKUME3XmV/WvtC5OCgsLqmXsV4wFFCUiQEgGuM+5sBVzomhIho\n7vZo/JoQW0FeH8zXbhffxDqPj0oU5A5PML/YzPG7ErMtxmBW+Ge3jzCnd64s\nO2+Y/Y6Ik9Jkp5vhjvcn0fr/6B9GSFPCCSEHP69ZBapk0C3aCOGG18dVZEXH\nEo7AOSxFIT5JiWsPzSosmmu+9wUfIZ93UQ1SDk0sfCZeqr7cApsWuT98odkb\nEM6S\r\n=nYby\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyCQI4RFA1jiCVkkorYYJJ1I4Iz2/msrOoCPpsxes5yAIgTuGAn7QTnWyWReceLKmmWgMA6KNhLkNC7nsvHugA3LU="}]},"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.0.6_1630603992138_0.2441003046435124"},"_hasShrinkwrap":false},"1.1.0":{"name":"messaging-api-messenger","description":"Messaging API client for Messenger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.1.0","main":"dist/index.js","browser":"lib/browser.js","types":"dist/index.d.ts","dependencies":{"@types/append-query":"^2.0.0","@types/lodash":"^4.14.156","@types/warning":"^3.0.0","append-query":"^2.1.0","axios":"^0.21.1","axios-error":"^1.0.4","form-data":"^3.0.0","lodash":"^4.17.15","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","messenger"],"engines":{"node":">=10"},"gitHead":"7df9e3bba37712e0892f14895576c42c949d3003","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"},"homepage":"https://github.com/Yoctol/messaging-apis#readme","_id":"messaging-api-messenger@1.1.0","_nodeVersion":"14.17.5","_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","dist":{"integrity":"sha512-WfODwHvkkC/oJMrqr7ukm2yTf4DqWg8BvnwmGOU53fRMvuCQNGWYSKQPk8k/s0Evl56J32iDidooGIL9fAGOjQ==","shasum":"3a2b068935a6b6754cdc42da6f825c9e2f6aa686","tarball":"https://registry.npmjs.org/messaging-api-messenger/-/messaging-api-messenger-1.1.0.tgz","fileCount":46,"unpackedSize":725759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2zFqCRA9TVsSAnZWagAAqWoP/3C3a2h3LCUkaAcnPCDx\nteJ69xKXxgDFK2FG3NwXnhtZjJPPKu5Jg/+pvkPFcwtEg7yjlfc/ZST6gpJF\nxE81Rk8jW3FcCeIp7fo9/MR6p+KyrHGlOoqt1HMv2gjtyf6ufamqTLfkZECa\nF+JbaUy7B6fbBD9svcfdRgF+puIYjkmTtvlF9t4TGVNTepXjEExwwvHGNGwH\nDPMLrPp2Iivc3lh/+hhljveuMlAi1Jmmw8lYJIXi0dlKeGKi9vNkFqV/PzUO\n8GlE1EccFKMUSn6d6iwicj1VxloFyUt8OwXzk87AdKpT46PPjqq4cOP1p0kd\ny/zymeYbWIdshK39CSXXYkM+zlkUtmqbl6vHTqkzi2gLsCEufRpv3rx7lkRN\nXeFTpqTeAeFubDfQ5rZM/v9GIpOSsgNvAvgULZ1v4khYAPltsfEOzwTevWWE\nbDXiBzFQGG9CWsPvW0zcG6XXhQzl6smuvJ5rVmcVolbYB+DUUDvbp5nBJZj1\nmDliJvn7k3gZKI08nm2wZ1paO7zuYwLdq46qjGvtMsn/wKnaei5JRiv+r5zp\nYVzeSDLn89NyXtJVcAN06gjMWWX75SPp+N4zY27G+m1fxjr9Gu+eSpjnUIB8\nSQrbmiHNlbp7qwuV5Mz809B2+WGD2EnkkU2Uyh0ALrCCp5V5MoEwfN1UzwMg\nDBdG\r\n=DaiH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG02v8TjE5BSeFJuxiv/Rgbm5i8+RF1feNwAAE+xJ509AiB99l6dN2nOGVAtmFqvOaL4+p7U0YSUO6cotVBHpS8tFw=="}]},"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"directories":{},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"},{"name":"kpman","email":"s92f002@gmail.com"},{"name":"tw0517tw","email":"tw0517tw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-messenger_1.1.0_1633326870741_0.09100105086911303"},"_hasShrinkwrap":false}},"readme":"# messaging-api-messenger\n\n> Messaging API client for Messenger\n\n<img src=\"https://static.xx.fbcdn.net/rsrc.php/v3/yh/r/p6_sqYxQ9ch.png\" alt=\"Messenger\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Send API](#send-api)\n    - [Content Types](#content-types)\n    - [Templates](#templates)\n    - [Quick Replies](#quick-replies)\n    - [Sender Actions](#sender-actions)\n    - [Attachment Upload API](#attachment-upload-api)\n    - [Message Batching](#message-batching)\n  - [Custom Labels](#custom-labels)\n  - [User Profile API](#user-profile-api)\n  - [Messenger Profile API](#messenger-profile-api)\n    - [Persistent Menu](#persistent-menu)\n    - [Get Started Button](#get-started-button)\n    - [Greeting Text](#greeting-text)\n    - [Whitelisted Domains](#domain-whitelist)\n    - [Account Linking URL](#account-linking-url)\n  - [Handover Protocol API](#handover-protocol-api)\n  - [Page Messaging Insights API](#page-messaging-insights-api)\n  - [Built-in NLP API](#built-in-nlp-api)\n  - [Event Logging API](#event-logging-api)\n  - [ID Matching API](#id-matching-api)\n  - [Persona API](#persona-api)\n  - [Others](#others)\n- [Debug Tips](#debug-tips)\n- [Testing](#testing)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-messenger\n```\n\nor\n\n```sh\nyarn add messaging-api-messenger\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  version: '6.0',\n});\n```\n\nIf the `version` option is not specified, `6.0` will be used by default.\n\n### Verifying Graph API Calls with `appsecret_proof`\n\nIf `appSecret` is provided, `MessengerClient` will enable this feature automatically and include `appsecret_proof` in every Graph API requests. To skip it, set the `skipAppSecretProof` option to `true`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  appId: APP_ID,\n  appSecret: APP_SECRET,\n  skipAppSecretProof: true,\n});\n```\n\n### Error Handling\n\n`messaging-api-messenger` uses [axios](https://github.com/axios/axios) as HTTP client. We use [axios-error](https://github.com/Yoctol/messaging-apis/tree/master/packages/axios-error) package to wrap API error instances for better formatting error messages. Directly calling `console.log` with the error instance will return formatted message. If you'd like to get the axios `request`, `response`, or `config`, you can still get them via those keys on the error instance.\n\n```js\nclient.sendRawBody(body).catch((error) => {\n  console.log(error); // formatted error message\n  console.log(error.stack); // error stack trace\n  console.log(error.config); // axios request config\n  console.log(error.request); // HTTP request\n  console.log(error.response); // HTTP response\n});\n```\n\n<br />\n\n## API Reference\n\nAll methods return a Promise.\n\n<br />\n\n<a id=\"send-api\" />\n\n### Send API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference)\n\n- [sendRawBody](/messaging_api_messenger.messengerclient-1.html#sendrawbody)\n- [sendMessage](/messaging_api_messenger.messengerclient-1.html#sendmessage)\n\n<a id=\"content-types\" />\n\n### Content Types - [Content types](https://developers.facebook.com/docs/messenger-platform/send-api-reference/contenttypes)\n\n- [sendText](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendtext)\n- [sendAttachment](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendattachment)\n- [sendAudio](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendaudio)\n- [sendImage](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendimage)\n- [sendVideo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendvideo)\n- [sendFile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendfile)\n\n<a id=\"templates\" />\n\n### Templates - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/templates)\n\n- [sendTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendtemplate)\n- [sendButtonTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendbuttontemplate)\n- [sendGenericTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendgenerictemplate)\n- [sendMediaTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendmediatemplate)\n- [sendReceiptTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendreceipttemplate)\n- [sendAirlineBoardingPassTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendairlineboardingpasstemplate)\n- [sendAirlineCheckinTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendairlinecheckintemplate)\n- [sendAirlineItineraryTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendairlineitinerarytemplate)\n- [sendAirlineUpdateTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendairlineupdatetemplate)\n- [sendOneTimeNotifReqTemplate](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendonetimenotifreqtemplate)\n\n<br />\n\n<a id=\"quick-replies\" />\n\n### Quick Replies - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411344-91c8ad54-27dd-11e8-82fc-fd9adf896301.png\" alt=\"Quick Replies\" width=\"750\" />\n\nTo send messages with quick replies to the specified user using the [Send API](https://developers.facebook.com/docs/messenger-platform/reference/send-api#request), pass `quickReplies` option to send message methods, for example, with `sendText`:\n\n```js\nawait client.sendText(USER_ID, 'Pick a color:', {\n  quickReplies: [\n    {\n      contentType: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nwith the `sendImage` option:\n\n```js\nawait client.sendImage(USER_ID, 'https://example.com/vr.jpg', {\n  quickReplies: [\n    {\n      contentType: 'text',\n      title: 'Red',\n      payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',\n    },\n  ],\n});\n```\n\nIt works with all of message sending methods.\n\n<br />\n\n<a id=\"sender-actions\" />\n\n### Sender Actions - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions)\n\n<img src=\"https://user-images.githubusercontent.com/3382565/37411363-9b65ecaa-27dd-11e8-8f51-7aac7fd0bd2f.png\" alt=\"Sender Actions\" width=\"250\" />\n\n- [sendSenderAction](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendsenderaction)\n- [markSeen](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#markseen)\n- [typingOn](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#typingon)\n- [typingOff](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#typingoff)\n\n<a id=\"attachment-upload-api\" />\n\n### Attachment Upload API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-api-reference/attachment-upload)\n\n> Note: Only attachments that were uploaded with the `isReusable` property set to `true` can be sent to other message recipients.\n\n- [uploadAttachment](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#uploadattachment)\n- [uploadAudio](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#uploadaudio)\n- [uploadImage](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#uploadimage)\n- [uploadVideo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#uploadvideo)\n- [uploadFile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#uploadfile)\n\n<br />\n\n<a id=\"message-batching\" />\n\n### Message Batching - [Official Docs](https://developers.facebook.com/docs/graph-api/making-multiple-requests)\n\n- [sendBatch](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#sendbatch)\n\nThere are a bunch of factory methods can be used to create batch requests:\n\n- `MessengerBatch.sendRequest`\n- `MessengerBatch.sendMessage`\n- `MessengerBatch.sendText`\n- `MessengerBatch.sendAttachment`\n- `MessengerBatch.sendAudio`\n- `MessengerBatch.sendImage`\n- `MessengerBatch.sendVideo`\n- `MessengerBatch.sendFile`\n- `MessengerBatch.sendTemplate`\n- `MessengerBatch.sendButtonTemplate`\n- `MessengerBatch.sendGenericTemplate`\n- `MessengerBatch.sendReceiptTemplate`\n- `MessengerBatch.sendMediaTemplate`\n- `MessengerBatch.sendAirlineBoardingPassTemplate`\n- `MessengerBatch.sendAirlineCheckinTemplate`\n- `MessengerBatch.sendAirlineItineraryTemplate`\n- `MessengerBatch.sendAirlineUpdateTemplate`\n- `MessengerBatch.sendSenderAction`\n- `MessengerBatch.typingOn`\n- `MessengerBatch.typingOff`\n- `MessengerBatch.markSeen`\n- `MessengerBatch.getUserProfile`\n- `MessengerBatch.passThreadControl`\n- `MessengerBatch.passThreadControlToPageInbox`\n- `MessengerBatch.takeThreadControl`\n- `MessengerBatch.requestThreadControl`\n- `MessengerBatch.associateLabel`\n- `MessengerBatch.dissociateLabel`\n- `MessengerBatch.getAssociatedLabels`\n\nThose methods have exactly same argument signature with the methods on client.\n\n<br />\n\n<a id=\"custom-labels\" />\n\n### Custom Labels - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/custom-labels)\n\n- [createLabel](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#createlabel)\n- [associateLabel](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#associatelabel)\n- [dissociateLabel](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#dissociatelabel)\n- [getAssociatedLabels](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getassociatedlabels)\n- [getLabelDetails](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getlabeldetails)\n- [getLabelList](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getlabellist)\n- [deleteLabel](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deletelabel)\n\n<br />\n\n<a id=\"user-profile-api\" />\n\n### User Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/user-profile)\n\n- [getUserProfile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getuserprofile)\n\n<br />\n\n<a id=\"messenger-profile-api\" />\n\n### Messenger Profile API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile)\n\n- [getMessengerProfile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getmessengerprofile)\n- [setMessengerProfile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#setmessengerprofile)\n- [deleteMessengerProfile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deletemessengerprofile)\n\n<a id=\"persistent-menu\" />\n\n### Persistent Menu - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/persistent-menu)\n\n![](https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/16686128_804279846389859_443648268883197952_n.png?oh=adde03b0bc7dd524a58cf46016e0267d&oe=59FC90D6)\n\n- [getPersistentMenu](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getpersistentmenu)\n- [setPersistentMenu](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#setpersistentmenu)\n- [deletePersistentMenu](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deletepersistentmenu)\n\n<a id=\"get-started-button\" />\n\n### Get Started Button - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14302685_243106819419381_1314180151_n.png?oh=9487042d8c0067eb2fda1efa45d0e17b&oe=59F7185C\" alt=\"Get Started Button\" width=\"500\" />\n\n- [getGetStarted](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getgetstarted)\n- [setGetStarted](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#setgetstarted)\n- [deleteGetStarted](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deletegetstarted)\n\n<a id=\"greeting-text\" />\n\n### Greeting Text - [Officail docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text)\n\n<img src=\"https://scontent-tpe1-1.xx.fbcdn.net/v/t39.2365-6/14287888_188235318253964_1078929636_n.png?oh=a1171ab50f04d3a244ed703eafd2dbef&oe=59F01AF5\" alt=\"Greeting Text\" width=\"250\" />\n\n- [getGreeting](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getgreeting)\n- [setGreeting](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#setgreeting)\n- [deleteGreeting](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deletegreeting)\n\n<a id=\"domain-whitelist\" />\n\n### Whitelisted Domains - [Official Docs](https://developers.facebook.com/docs/messenger-platform/messenger-profile/domain-whitelisting)\n\n- [getWhitelistedDomains](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getwhitelisteddomains)\n- [setWhitelistedDomains](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#setwhitelisteddomains)\n- [deleteWhitelistedDomains](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deletewhitelisteddomains)\n\n<a id=\"account-linking-url\" />\n\n### Account Linking URL - [Official Docs](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/account-linking-url)\n\n- [getAccountLinkingURL](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getaccountlinkingurl)\n- [setAccountLinkingURL](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#setaccountlinkingurl)\n- [deleteAccountLinkingURL](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deleteaccountlinkingurl)\n\n### Handover Protocol API\n\n- [passThreadControl](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#passthreadcontrol)\n- [passThreadControlToPageInbox](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#passthreadcontroltopageinbox)\n- [takeThreadControl](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#takethreadcontrol)\n- [requestThreadControl](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#requestthreadcontrol)\n- [getThreadOwner](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getthreadowner)\n- [getSecondaryReceivers](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getsecondaryreceivers)\n\n<br />\n\n<a id=\"page-messaging-insights-api\" />\n\n### Page Messaging Insights API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/insights/page-messaging)\n\nRequirements for insights API:\n\n- The page token must have `read_insights` permission.\n- Insights are only generated for a Facebook Page that has more than `30` people that like it.\n\n- [getInsights](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getinsights)\n- [getBlockedConversations](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getblockedconversations)\n- [getReportedConversations](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getreportedconversations)\n- [getTotalMessagingConnections](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#gettotalmessagingconnections)\n- [getNewConversations](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getnewconversations)\n\n<br />\n\n<a id=\"built-in-nlp-api\" />\n\n### Built-in NLP API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/built-in-nlp)\n\n- [setNLPConfigs](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#setnlpconfigs)\n- [enableNLP](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#enablenlp)\n- [disableNLP](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#disablenlp)\n\n<br />\n\n<a id=\"event-logging-api\" />\n\n### Event Logging API - [Official Docs](https://developers.facebook.com/docs/app-events/bots-for-messenger#logging-custom-events)\n\n- [logCustomEvents](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#logcustomevents)\n\n<a id=\"id-matching-api\" />\n\n### ID Matching API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/identity/id-matching)\n\n- [getIdsForApps](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getidsforapps)\n- [getIdsForPages](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getidsforpages)\n\n<br />\n\n<a id=\"persona-api\" />\n\n### Persona API - [Official Docs](https://developers.facebook.com/docs/messenger-platform/send-messages/personas)\n\n- [createPersona](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#createpersona)\n- [getPersona](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getpersona)\n- [getPersonas](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getpersonas)\n- [getAllPersonas](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getallpersonas)\n- [deletePersona](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#deletepersona)\n\n<br />\n\n### Others\n\n- [debugToken](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#debugtoken)\n- [createSubscription](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#createsubscription)\n- [getSubscriptions](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getsubscriptions)\n- [getPageSubscription](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getpagesubscription)\n- [getPageInfo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getpageinfo)\n- [getMessagingFeatureReview](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_messenger.messengerclient-1.html#getmessagingfeaturereview)\n\n<br />\n\n## Debug Tips\n\n### Log Requests Details\n\nTo enable default request debugger, use following `DEBUG` env variable:\n\n```sh\nDEBUG=messaging-api:request\n```\n\nIf you want to use a custom request logging function, just provide your own `onRequest`:\n\n```js\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  onRequest: ({ method, url, headers, body }) => {\n    /* */\n  },\n});\n```\n\n## Testing\n\n### Point Requests to Your Dummy Server\n\nTo avoid sending requests to real Messenger server, specify the `origin` option when constructing your client:\n\n```js\nconst { MessengerClient } = require('messaging-api-messenger');\n\nconst client = new MessengerClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on your production server.\n\n[send-api-reference#recipient]: https://developers.facebook.com/docs/messenger-platform/send-api-reference#recipient\n","maintainers":[{"email":"chentsulin@gmail.com","name":"chentsulin"},{"email":"et284vu065k3@gmail.com","name":"etrexkuo"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"wtflink515@gmail.com","name":"link515"},{"email":"s92f002@gmail.com","name":"kpman"}],"time":{"modified":"2022-06-19T18:05:11.955Z","created":"2017-05-11T05:45:06.830Z","0.1.0-1":"2017-05-11T05:45:06.830Z","0.1.0-2":"2017-05-12T10:19:02.272Z","0.1.0":"2017-06-21T14:02:51.020Z","0.1.1":"2017-06-22T07:43:40.403Z","0.2.0":"2017-06-29T08:08:03.584Z","0.2.1":"2017-07-06T05:07:18.219Z","0.2.2":"2017-07-11T02:44:33.237Z","0.2.3":"2017-07-13T06:35:36.094Z","0.2.4":"2017-08-02T08:15:21.050Z","0.2.5":"2017-08-09T08:09:41.815Z","0.2.6":"2017-08-14T07:27:01.829Z","0.2.8":"2017-08-25T09:39:56.440Z","0.3.0":"2017-08-29T07:36:48.656Z","0.3.1":"2017-08-31T08:38:02.477Z","0.3.3":"2017-09-07T07:49:08.715Z","0.3.4":"2017-09-13T10:14:43.446Z","0.3.5":"2017-09-14T16:15:18.187Z","0.4.0":"2017-09-19T10:45:20.482Z","0.4.1":"2017-09-19T11:18:01.321Z","0.4.2":"2017-09-22T01:43:32.741Z","0.4.4":"2017-10-11T08:03:23.937Z","0.4.7":"2017-10-16T08:01:52.103Z","0.5.0-0":"2017-10-20T06:56:57.403Z","0.5.0":"2017-10-20T07:18:38.262Z","0.5.1":"2017-10-25T12:00:47.075Z","0.5.2":"2017-10-26T04:09:09.882Z","0.5.3":"2017-10-26T07:30:57.750Z","0.5.4-0":"2017-10-30T04:41:41.316Z","0.5.4":"2017-10-30T05:24:57.930Z","0.5.5":"2017-11-01T08:41:30.717Z","0.5.7":"2017-11-09T09:33:16.994Z","0.5.8":"2017-11-13T06:12:31.484Z","0.5.9":"2017-11-15T06:15:51.041Z","0.5.11":"2017-11-22T08:06:09.378Z","0.5.12":"2017-11-23T10:35:02.915Z","0.5.13":"2017-11-28T11:49:40.573Z","0.5.14":"2017-11-29T10:04:59.819Z","0.5.16":"2017-12-05T07:49:22.305Z","0.6.0":"2017-12-07T04:13:46.180Z","0.6.3":"2017-12-12T03:53:31.783Z","0.6.4":"2017-12-14T05:04:20.430Z","0.6.5":"2017-12-20T03:37:07.533Z","0.6.6":"2017-12-20T07:33:27.452Z","0.6.9":"2017-12-28T03:57:21.469Z","0.7.0-alpha.1":"2018-01-22T06:36:29.810Z","0.7.0-alpha.2":"2018-02-05T02:05:21.991Z","0.6.13":"2018-02-12T08:03:28.602Z","0.6.14":"2018-02-20T07:20:04.743Z","0.6.15":"2018-02-26T09:15:38.841Z","0.7.0-beta.1":"2018-03-26T08:59:27.829Z","0.7.0-beta.2":"2018-03-28T08:08:59.291Z","0.7.0-beta.3":"2018-04-02T06:26:59.569Z","0.7.0-beta.4":"2018-04-03T06:40:32.440Z","0.7.0-beta.5":"2018-04-03T09:39:37.215Z","0.7.0-rc.1":"2018-04-09T08:14:20.832Z","0.7.0-rc.2":"2018-04-17T04:19:56.123Z","0.7.0-rc.3":"2018-04-24T03:52:47.742Z","0.7.0":"2018-04-27T13:30:37.438Z","0.7.1":"2018-05-16T10:51:02.770Z","0.7.2":"2018-06-08T04:11:22.708Z","0.7.3":"2018-06-19T04:00:04.697Z","0.7.4":"2018-07-12T04:15:08.057Z","0.7.5":"2018-08-04T12:20:29.987Z","0.7.6":"2018-08-23T07:10:37.160Z","0.7.7":"2018-09-16T09:13:19.724Z","0.7.8":"2018-09-19T05:58:46.271Z","0.7.10":"2018-10-09T07:39:30.850Z","0.7.11":"2018-10-17T14:50:53.738Z","0.7.13":"2018-10-30T11:01:18.029Z","0.7.14":"2018-11-07T11:00:52.373Z","0.7.15":"2018-11-12T11:58:54.512Z","0.7.16":"2019-01-29T05:40:31.987Z","0.8.0-alpha.1":"2019-01-30T12:27:30.114Z","0.8.0-alpha.2":"2019-02-23T08:20:04.657Z","0.8.0-alpha.3":"2019-03-06T11:03:21.018Z","0.8.0-alpha.4":"2019-03-07T04:31:55.811Z","0.8.0-alpha.5":"2019-03-07T11:01:35.272Z","0.8.0-alpha.6":"2019-03-08T04:22:13.995Z","0.8.0":"2019-08-26T10:06:56.171Z","0.8.1":"2019-08-27T04:07:57.125Z","0.8.2":"2019-09-05T07:16:16.218Z","1.0.0-alpha.0":"2019-09-11T09:45:23.510Z","1.0.0-alpha.2":"2019-10-04T06:35:27.508Z","1.0.0-alpha.6":"2019-11-11T11:41:50.471Z","1.0.0-beta.0":"2019-11-14T07:19:21.493Z","1.0.0-beta.1":"2019-11-16T15:30:24.406Z","1.0.0-beta.2":"2019-11-19T05:54:56.823Z","1.0.0-beta.4":"2019-11-22T11:22:37.999Z","1.0.0-beta.5":"2019-11-22T14:03:15.118Z","1.0.0-beta.10":"2019-12-09T04:12:28.520Z","1.0.0-beta.16":"2020-04-06T14:32:15.658Z","0.7.17":"2020-04-08T05:14:35.907Z","0.7.18":"2020-04-08T05:21:26.605Z","0.8.5":"2020-04-08T05:36:40.009Z","1.0.0-beta.18":"2020-04-13T15:18:56.690Z","1.0.0-beta.22":"2020-05-10T13:26:32.585Z","1.0.0-beta.23":"2020-05-18T09:30:43.746Z","1.0.0-beta.24":"2020-06-11T06:37:03.812Z","1.0.0-beta.25":"2020-06-11T11:30:31.431Z","1.0.0-beta.26":"2020-06-16T08:05:09.465Z","1.0.0-beta.27":"2020-06-23T05:48:26.398Z","1.0.0-beta.29":"2020-06-29T04:34:11.199Z","1.0.0-beta.31":"2020-07-01T03:27:45.168Z","1.0.0-beta.33":"2020-07-22T06:42:06.656Z","1.0.0-beta.34":"2020-09-07T06:19:21.621Z","1.0.0":"2020-09-07T08:54:47.704Z","1.0.1":"2020-09-21T07:05:58.350Z","1.0.2":"2020-09-21T10:52:54.425Z","1.0.4":"2021-01-11T06:05:43.820Z","1.0.5":"2021-04-15T07:48:58.250Z","1.0.6":"2021-09-02T17:33:12.297Z","1.1.0":"2021-10-04T05:54:30.937Z"},"keywords":["bot","chatbot","messaging-apis","messenger"],"repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/Yoctol/messaging-apis#readme","bugs":{"url":"https://github.com/Yoctol/messaging-apis/issues"}}