{"_id":"messaging-api-viber","_rev":"72-044a445d0e60c3b827c1aa7524a942e9","name":"messaging-api-viber","description":"Messaging API client for Viber","dist-tags":{"latest":"1.1.0","next":"1.0.0-beta.33"},"versions":{"0.4.4":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.16.2"},"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-viber@0.4.4","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-TJlIxS5yGFvioBzsOTnaHcpiCuvBAIyX8d+e6g6+6H9Tj/rAESEvgtVCyLZWM+mdT2lPbGvtJT20zss/W7g3AQ==","shasum":"8876f9158da8763df22721d57bc590cd5873236c","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.4.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0HBF3BrKTEGLrjh0orsCvAHFjwn2I8QsZvH0ff485kAiAbfMAlIxF/PDCLHZjQMcmvv0E5NkuAIwXMD+w2O4/vrA=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.4.4.tgz_1507709006113_0.6221377274487168"},"directories":{}},"0.4.5":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.4.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","viber"],"dependencies":{"axios":"^0.16.2"},"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-viber@0.4.5","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-doesvi9za7AFTOwVtIkY4d2Tc0KqRw3jneOUDZoL8nUAMM0Lk1q2o3gK/wOZkSIMj3ewv5dkf4hRcYlURJD8bA==","shasum":"5a2ac01121fef232885b4cdf52b3b37dfba28647","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.4.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/aTewbTUsW68vhwascO+jrxYrg41eAqEznKfCidDQ8AiAZcKk2lgM3fzD2LMhr/58Bm2TZDUkqOjUS2WKUwO8nZw=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.4.5.tgz_1507784767974_0.3032098156400025"},"directories":{}},"0.4.6":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.4.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","viber"],"dependencies":{"axios":"^0.16.2"},"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-viber@0.4.6","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-4uX1gyXiEEXYOe8XsZFVHq3yzhB6lw+9p2a852xfqsMOyXLrDLXDM9e46kfZ4Xni3lRXJR0VUtJbzUhbKACvfQ==","shasum":"3e0f8d92d0eab29d62ab4e11cf2cd54411a20cb1","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.4.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICkXLaMuzmC5/qgKijxj+6S8/KmTk72uB4npOaWk8E8cAiEAq6c0kir+GTIm8OjeZSMnwL0woeC0OC1YgCO1QxG1RdY="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.4.6.tgz_1508054344261_0.6141113443300128"},"directories":{}},"0.4.7":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.16.2"},"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-viber@0.4.7","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-ts1GicAef8kaXZdF2gIShiH1B1WSRGu5IIW+tMr3oFnH7sqSfJnt1u0TJqWeI3oa2EeBQ2skI1DNeNBK8SKmjw==","shasum":"0051e0f0da9f7ab7a72c3b2d7e5fbf09f11dd073","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.4.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5N1TtXVz+6//N7LjKMw+Xgsmx52NqbV0nuQJsoMlMpAiA5s0ukH8kkGv8RPhh0WXgV5ZlDg6HF0hTLLyit0VF5Yw=="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.4.7.tgz_1508140911671_0.07032066094689071"},"directories":{}},"0.5.0-0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.16.2","axios-error":"^0.5.0-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-viber@0.5.0-0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-wS68RFCvjyLlnpgQmPdOTWVMHZwNg3iGXKzQNByhNYQl9vR5kyXu8PIG19qIZMyrDNFLAEpLDa8KPr5y09lGtQ==","shasum":"a33c1e7da1d5193a729ce3ddc3ce0e7aeeed34fc","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.0-0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJZLsCFes2Ls+Mj3zPx/tTtI7UFQwop7CAV82sG36oKAIgFCPCVDLBx2eMY8Tzedm1BU6Yjz18SeyRUWeaxFXgiys="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.0-0.tgz_1508482618375_0.44861784554086626"},"directories":{}},"0.5.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.16.2","axios-error":"^0.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-viber@0.5.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-ClIMfCl31RJaQQchO62dz7uPON6O3Fq0DYGvHIa1YcjKs8u066s0cRyfBgx9LFek63QQ0aMIKcMuHnO83QVusA==","shasum":"0f6cab7073c4efec4107550bf1161eabcf3f8fb9","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICNYNG4bHvXPrdGriVj/SlpMOGd2JPbGXDVQRh04WF3UAiEA5vsU2+IEGqWJorGHynw2TBa/tqXGI31GtBPEFq2FS6I="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.0.tgz_1508483919006_0.5851858011446893"},"directories":{}},"0.5.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.2","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-viber@0.5.2","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-g97uHqJpgbCdV0n216QIiIWU4JijW8UNhoDm3VcfcrZW+bCnKLN0BaeakjycGWGuMPhdyAq3vIP7JfQLTi+22g==","shasum":"7e48266e3ac00ceac67de8617726031de6024ce0","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9ARrR0RXM7YqAotT/Tznk2iG/MCMMZntK19g//8E6cgIgBBLbUHUH1mwLeQnNY2vLY3U14bu51vqzc48u8YPpN+s="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.2.tgz_1508990952097_0.514511076034978"},"directories":{}},"0.5.4":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","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-viber@0.5.4","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-o2qwM2gaQY0Xf0D4PJ+Dj1GeA+rFAywAV+eF0lUJrCX65ci29tIAmJuPUnJCojXiZ+NbvSiHL75ZUNCJDQjjpA==","shasum":"186cd7372bc5ab43dd0b3f76f1adab79e89e571f","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBlSiUV5Eoc+3l+gDWTPKq8R961cjqL+mUFkZcxCEE7AIgRYnk/Idd2dGrd51y3/LDMtSHQpVpYTP7jl1rEd2ZwvE="}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.4.tgz_1509341099221_0.025490283267572522"},"directories":{}},"0.5.7":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","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-viber@0.5.7","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-EKzMy/kD2o9r9VXq/13DwJh5WXwjVSq1zp7E1SeJnRkYe/7/hBJzVmDPiIFU7V/N3OkyAJ9Irbe3QPOwtHVjNA==","shasum":"45648d5f82ad4096d6039276a225d62e8f08247b","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2vmByqaxSG26GGOCzF4gHxBOMQ5J1LN8dQPLgEHYBTwIhAIYMbN2DiWgr5BS0jSM7OKI9ovvlWBh5ndh/SoPIzNM1"}]},"maintainers":[{"name":"chentsulin","email":"chentsulin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.7.tgz_1510219996616_0.4985353017691523"},"directories":{}},"0.5.10":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.5.10","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","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-viber@0.5.10","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Grc9fyawZE+MFZvlC1YdHoT6uSoB35472Q+VXvx5qSWvQgfcjGZRwcn4Yr00w+DTXbfFTEAaB+9l7fhZn+Dt9g==","shasum":"cc73ad3adf306feeec9f7c776ab1e7e7e1e32e6a","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.10.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5+MDGQ3bohivPbjZC5ASfPN0wDJzrQLHk7NZYE64h2AiBDTAdHy4ULgrgwkiR7UB62xDjKyBH8QOKZkEMhqBkPJg=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.10.tgz_1511249623938_0.42243896378204226"},"directories":{}},"0.5.15":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.5.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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","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-viber@0.5.15","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-9/s/DFuDnJnH70SmWODCAo1Rh8DY9+lDQGHcZISaamdPSMr+3xkCWpgWbAk2v+A17CWiHvOOyOCfISrDuBOHdA==","shasum":"0d8861a9253e254366fcce4a6b17dadf1b50a208","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.15.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1ofW/Oj/lx5anq/eImbDiN8YY6fXCyWDlVeOljNw4lQIgKopsj0gws7yCwx1be0LEj/yait4E07ca3UvpT0wjYqg="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.15.tgz_1512383336714_0.7535084045957774"},"directories":{}},"0.5.16":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4","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-viber@0.5.16","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-9raeYIenvXexa1HahczzrCsYNlNFJ7w/S+SCwF8AFOEgOhipdCQQzwdFPsMGQDynWB9IAD3eGswukcMJDTtsvg==","shasum":"f002977d947337addfd96f9c93dc313040b7a38c","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.5.16.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDgoyxO+Z+Eg+DV9wPzMTCIIjagkfIuUu6iqk7MJZHGAiBdE8f2wvoFTuCRHgJYRoPnKd7CUHd4mrrepmfTguWGEA=="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.5.16.tgz_1512460163252_0.198730343952775"},"directories":{}},"0.6.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4"},"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-viber@0.6.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-hDI5BWPX69gtybVVJMVMK2AvQFTLg/DoDLnSIwYKVvKwCRk+aBOnpQJ24rvTJDnjardC/IZ4g2SMnI9gyMt+hw==","shasum":"7f61818cdaeb21b79ae17f173e29c95d7057a174","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.6.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqZPd5kYJLLJsLyt26E9et23d5w2DRw4sdyVNSXwNqigIgWYOAhMA0Z8Qp6RArAa1pgTPTpImFlf0kb0JcDeXAkcU="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.6.0.tgz_1512620028309_0.4073049849830568"},"directories":{}},"0.6.11":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.6.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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4"},"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-viber@0.6.11","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-Qaea9vja4kHlGBh8Sxekw9GO2F+Wkcz6FZPAd/HekpsXHdNA0iyI4IbyFdd/nlmljEQrZBeT06NspYetO6w6Eg==","shasum":"c453e5a4397f54ea4839433fae683ec53bb383b5","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.6.11.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDy3RS+6DEY9s6Q4J4H1DVMuy8woxM1YUhQT3VpkFOvdgIhAMh4SnFYTFqnrbDeKh1jY3+nHzYlR8zG+gtR8V+WfQTe"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.6.11.tgz_1516596167777_0.11472230311483145"},"directories":{}},"0.7.0-alpha.1":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-alpha.1","dist":{"shasum":"2dae1790107f8d68f70032e87d60ce3740622126","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-alpha.1.tgz","integrity":"sha512-i5YWkJenqNZBvsjgxNrDv6YSdod8QH09CjCvVO9ngtu4ZuTKbWW1RpdFYfoU9xOLuKCz0eDazKsCkHSnt16OXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNCBgwpLPAz26WK8WDJ0YvblsxEEXhZsAGlwAGbGzNrgIhALBp2/q1cKl/okWhYbuNQ273lQxAYLO8NYxAgWVfEJb5"}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.7.0-alpha.1.tgz_1516602988198_0.979904146399349"},"directories":{}},"0.7.0-alpha.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-alpha.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-alpha.2","dist":{"shasum":"1fdcfd5e26cde339fc0c3b5873773940894204e0","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-alpha.2.tgz","integrity":"sha512-FXV3EwXG7AOqMt1P7/SjxxaYS5ORZNQWlGeIv4QWe6bwU1/4r8t4cjpG5hL4660XfQvR6UD02O60B7qISATt5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqkSugeytZynEOnnMZZhemM9WDKAv4QmIOlP3dBUMSqAiEA4P7VN92ggz5+WFoQwBAW8cB1omJ9WchOOavHbaQeuhs="}]},"maintainers":[{"email":"s92f002@gmail.com","name":"kpman"},{"email":"tw0517tw@gmail.com","name":"tw0517tw"},{"email":"chentsulin@gmail.com","name":"chentsulin"}],"_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messaging-api-viber-0.7.0-alpha.2.tgz_1517796322694_0.3323713596910238"},"directories":{}},"0.6.13":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.5.4"},"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-viber@0.6.13","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"chentsulin","email":"chentsulin@gmail.com"},"dist":{"integrity":"sha512-7r3juPZ+JU4lw+PhlfkzMlR8iQDbdLLxCMTqv4X1bLgNnKekOUvRWZl3vNAl8h/lbKdeM5sji7dc9io4VwIItg==","shasum":"4b36e5c7e3086af6333b349e2ecfd505ab3860ba","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.6.13.tgz","fileCount":11,"unpackedSize":76823,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLQhUdlIgnakngulnHYSYvJpZk0yDO8GDE/GBvyiQcegIgGTg2MfHeAJLLCaAEUeVaoe4dCZ9utjDtjYk5XzBbZV0="}]},"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-viber_0.6.13_1518422611625_0.17862754193244745"},"_hasShrinkwrap":false},"0.7.0-beta.1":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.1"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-beta.1","dist":{"shasum":"108c9319466c331d4c1ccbd8381d33888d57e2a0","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-beta.1.tgz","fileCount":17,"unpackedSize":78408,"integrity":"sha512-/jnBVnBfGhcSZd5PBXbDZdYFronTJ6Un5GaD+cDVYeJF7BbzQHP+LvNcuSEsh5DRsI4STERl5oN9pHq0j5eg0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXD3SNvjLt2NTWlelvmhJ4Y9T0yIRMDxlGGqUjIry6gwIgP9+IgEiB9p4Wyhw48JyDL4qe8xm6uRQ7YK0dfK5wvc8="}]},"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-viber_0.7.0-beta.1_1522054769147_0.1741177082669676"},"_hasShrinkwrap":false},"0.7.0-beta.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-beta.2","dist":{"shasum":"2779e8f46bbb9992f961d27c78ad6e2f3015aca7","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-beta.2.tgz","fileCount":17,"unpackedSize":78408,"integrity":"sha512-KwXZc4kvpxPij+ybjOP86DesjjGiNNh//a46mEDe2npafu8X1aP9BeOYaODDyIbVjhiMC9K+MbH2o2TJa8hTPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzwL6NTyXbS8TKnMO/MMmcnrFuhxLmQSFrRMsnBKwTSwIhAOYvKQ2I1YwKjH8DRb4k45urpeYUmozWXaP5wnHPbN7a"}]},"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-viber_0.7.0-beta.2_1522224541700_0.6701628208681647"},"_hasShrinkwrap":false},"0.7.0-beta.3":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.3"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-beta.3","dist":{"shasum":"9ef142175bc87f8fa885644e844ba266ed7ea802","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-beta.3.tgz","fileCount":17,"unpackedSize":78408,"integrity":"sha512-59yoYNMhgaNTlEV9A7lb/WlQkn2bpykeN4TVrHO2RbcrUoaX45Lvs3ePsZjc7G95df3Y5ETAOKp4RpXuSe5uiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrNp0euICwe971GznjEgA3ayx5OuLoFUvc+GMdyU7paAiBRYaOZBkMThrmvCzgF5c031AcVcU9Q7sLsna8q/B+LIg=="}]},"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-viber_0.7.0-beta.3_1522650423699_0.11433302579498816"},"_hasShrinkwrap":false},"0.7.0-beta.4":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.4"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-beta.4","dist":{"shasum":"b1041bca392ad98702fd822c3dcb1b80977b8b63","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-beta.4.tgz","fileCount":17,"unpackedSize":78408,"integrity":"sha512-ehW/aXWEEGUgAVfKqhKcw/bkW60JQJTfSpQfFO2QhzBl2hYRGUhFmh6VPcXy2JavlV9Ebu9zBODfFdiZoM5X8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLUNU20TczdePvuws1FKEHLtnOWiRdJkLY6yXD7bzjMgIhAMICLoGPmpPRLJl30hC+IQMJxicil/Bjl8bNcLG5ehCP"}]},"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-viber_0.7.0-beta.4_1522737601129_0.30534489496879846"},"_hasShrinkwrap":false},"0.7.0-beta.5":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-beta.5","dist":{"shasum":"6dc3a56aa8d282417098fb5897844e62a5270fd3","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-beta.5.tgz","fileCount":17,"unpackedSize":78408,"integrity":"sha512-oLPd3x3wZx+A98HQCK8pQfXFPm9ceS1zNb3b9NkD1/aDnE84g1+JPf3nB3QQ61FIE21326mzEeZ06D0HffZksQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBIEgEf8DCUAIA7gRpfyD+vSCnAOV6dV3be5fY014FRAiBlF/wJUWsX3qzJKAjanToD7Kwh/YeixRYuHallFue2pg=="}]},"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-viber_0.7.0-beta.5_1522748378785_0.5485539789751077"},"_hasShrinkwrap":false},"0.7.0-rc.1":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.1"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-rc.1","dist":{"shasum":"f465792cd2460f7f4924fac4a2310fabc7d9cb28","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-rc.1.tgz","fileCount":17,"unpackedSize":78404,"integrity":"sha512-J6fZ0wLuyMRbhVVfvP7TMk3BqRrolcKjhAM0xldcOodpN+oe9giIo1n8UZ68m0ZEIFIg26EjDiZd3Tnk3WZJ7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGNhUPTX1u++m1uXxjaigQPvGa7xYGaHxSXCye1TP5F4AiEAiIyDlPpAdI/8SZ+9kbPgI8TrEMRtDzwDOeWyY3v3Kqw="}]},"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-viber_0.7.0-rc.1_1523261663893_0.9413740392458563"},"_hasShrinkwrap":false},"0.7.0-rc.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.2"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-rc.2","dist":{"shasum":"70f8f6537ba8d130beccc872548ef4f0b2b80463","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-rc.2.tgz","fileCount":17,"unpackedSize":78404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1XXzCRA9TVsSAnZWagAAkbQQAJHST9PTxE8kuGE4n48D\nJONzavkqCcip8ws9x152LuKd3DSWqWhvhrXfFavWmp9XXrkA90r183pc+tdA\nXK24fkeySeFoPE1/vS0/CvxXEL/JYfmUfYvqsS/T8869VR1UqJCbIKV0TitK\nU5YcOz/KVULg3fyRg87x0lB51vrHr1SfwOxj7r36Ge9mD1FHFbVV4niAGqR+\nx7hPDWGmiqseZ5wazlIZYixavVvhqtaxm+hbFRVQcC2fKU92iM/hBzfIKE8s\nuEVsqFP486+wKxCJV+4C9JUUj+RIHaYQ9OMfi8RTC5TdIFNmTo/FHpgIVA/k\n2Se4HHvfaFndZ+/z6DiKrnmHI80FjhYS/DP0LEPvRfzWUt6k1g7CLlalGS9n\nZ9JRRY++tTUrNS7stq2qzLHMJfuin9PTiwl10ZksF55NsaDPWhoiVozYgwXC\n0PDj4ThTA511n3c++N2JLAwaFsopAIZ9SIvQpGLXGghskG30Tj5BDys6dqLV\nOp2xlaeepCF10+iJqxdHEDnnTEuVYTCvhcbUyoPVARrD5udyYmeh9dfUQ6HL\nKxzZ2gLhLSaBqxZD49Fjg08Ac2Lns+iU4fS4oIbSwhJMaIQacr+DVs3V3D7n\n985i0WAEsGJ/u35uX3e/V9JHEyN+DxklBzhXnRVu/yfsEVDnz0KTL/VG7xEo\nMh+6\r\n=pdDv\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-W2fPE8jG2M6uCkyanRgeBWc1i7Jjn9CDD1IleGROdlIpp2kWeYOcPNuBMZ05XqA0RHNCnUaU4AxSU1MMNX7j+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/PJSgb6BZRXL3JvgAc2oTmUfiUL54l7qe7SJkxqX+BAiARghUKI9giw6R3HQvgMvL2Sng1KYwoEXerBK11kHeHTg=="}]},"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-viber_0.7.0-rc.2_1523938801737_0.134781480712711"},"_hasShrinkwrap":false},"0.7.0-rc.3":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0-rc.3"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0-rc.3","dist":{"shasum":"86d4a8d213dad94050dcce2d124071ec03da7ac0","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0-rc.3.tgz","fileCount":17,"unpackedSize":78624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3qoYCRA9TVsSAnZWagAAN+AP/1JwAujCvluC3JS13tDX\nRLsYskJRNBfMJZY/cYF9hAhpZd9dmS3dl9pz9VoRT/g3fvnyKdg94aTBqdOj\nThG+wBhcJAE0hXx7LA0e0JNl94AEEgA8d3bQspe10/4CeHuZ8qqNTApQxayg\nPplQowmPze0EhgEZqtVzAY1ubJbA84QQwOU+MLalZCXQ+RjBIL9ph/S1qCxl\ntEH5mcjuH2LapplB4U1UtqF5Bxup2OqS6dySj8VSLFBfTkBU0exgWKTjwTOS\nXGOPcaFyEywJ91+elnxFJmWAsIUZbrbp9tJRL5Y8X+OHO0fOPYwmiMdy9u/5\n5f1afyUEHUaVREwTJLYGEqRow78JF0p/hQk+/Ce5w0cT6AV8H8JHXN5ujuao\n96WV+SpjKlq8orSgvSNJbuXC85tM3zvvOeBzOGpk0TfCZVHdptdfP8QcryOR\nPNg2f/DvdlWVhuO3bYj0Sfuc2p2vwcF2wsw5bvudTw7au8qeouAToOHsZrp9\nUAwAtxg3Ri000oxzMkJ0ov3IvZHRLdpZhVZS5bVqprv/U5HgcnUXTeDusFeO\nT3KhDuECw2fkIw3r/ukLR3rB9LIjPe4fa5E0pIwfXDUcbnOjPiJu/UV8Dvbf\n0lltQOsVwBYYYbyMHGoKMWlxpDzgzE2C0gKvvic00boUucvMWCYM3Iyl3C0Y\ndFjH\r\n=XG4c\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-MtHnSK0y5kIDPh7lj0Tk9sSiBT+pQv/ien5ZJ2uVQfprGquIP6wqia4aDkeUy1ePAptyYvYfM4pJDR5wz4RylQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFSNZ5srv/p4KxMovW9W2dJjR7GTitC3wun3WzAgy3dxAiB3M4EODnTp45MFlfNqPSLzvDKNahHu8KqAF81Nd/fRqg=="}]},"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-viber_0.7.0-rc.3_1524541975048_0.555800183955719"},"_hasShrinkwrap":false},"0.7.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.0","dist":{"shasum":"256ff05cdd5a7d1c0b365ea3ec5cb4b752557495","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.0.tgz","fileCount":17,"unpackedSize":78614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4yYGCRA9TVsSAnZWagAAMcwQAI5b8Fj38cXVqJ5C8s2t\nQbdXIyK9Huns1msjiQmHhJxEdSzvTDzR1Qa2cJw4frTGYIBmIOc1glnYFsBH\nRG4dxjj/Z53PIPCneKCO40jZL+Af4kSErXG6SZmBVC3U3JQIYLjpCAoEv4lv\nPXP+vzGNgpe+Te2d/09SFaLfPza9dkTgJ+KgaPolQfFdbhjh6fVE+NEOIeXI\nKtfaFIG2Qky0QS3DBP1q0Sip8iz7h/rD1zITurZdLWHdoDcr/Yklr1IcOq5P\nec8XLrK0VNIahJwZZZihXnYJH9J/P8ScYKVR2Wq/V4OSwT9O/KZqqbPsPT2t\nFHEKh8mgNy1wi5g2fgOmZxlMBedpEcgLCJ5ceN4kzc4zDFIl3VW5WPOP8F2c\nMkOY5HiOog1vflwAFxehvoJA0byMl4k7cTWdrg59tcPOo9Q66TFCUAIETrZM\n28Kr9UI8wWEHHpoqT6QMmd619E7Msrx6qokkIvG3SWfGuZ8sI/IpnsK7F+Yt\nLRIdMV6XK8K7VnaP4JmEp3YL6E7g/IeLBlmC1H0MsW6FJo0tz5LRjtSqaKI+\n+/+TigPansGY2gA0RnBvyAyWLpcfRIZ+ULls3c6J0Yuw9rgmgXjs3dZNc0qK\nFt87zpFDEt2by2ZKy8PIDEjJ6Sh7+eOzCEjas8obpUO+h3yh87SBx5TuzY15\nK2Fg\r\n=kBuG\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-vMyUvLtXg3POSMA7SjxvduLt/20JILilmAC2rmix/CdJBZknoF/mZjuTf0s0IyzGRvT0g5jQJQ8TgSwlySP3oA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbpflv364h5UEska+Rl7xzx9Iodf3/JSs7IWeg/OdiVAiEA3Jld73ojfjFQayr6nfcAUuPaw49yk9e7wvL2d9z9O5w="}]},"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-viber_0.7.0_1524835844183_0.41999068461515887"},"_hasShrinkwrap":false},"0.7.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.2","dist":{"shasum":"38556ea800039756daad63ffff77a693d41e1ed7","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.2.tgz","fileCount":17,"unpackedSize":79236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGgHyCRA9TVsSAnZWagAA81cQAJcQ3y8EH53DsjMd14NP\n9R8fJcTxFGgROzISj1Ow0mQIXxqV31cCc5engchbFRSxnnPSLxKEqVYcNWaO\ngqfeNQeROoCYxGZLBQP9dNcRqtXM2DFwQp8C/K+C3UIPNLSFNvdETUp4vkwA\nJCGL/nMzp1AoV/CMeNCXS7pv1KidHWFlIV7dCLF6skrh8PZn+1l/LLVU9ccG\nhekeXBB6MFzpDX9rGBvlOt736BUQaKf+tLaBLctSFdgZ6EfZliVRsdej0+0Y\nhAgbAWZZgEhxWxUblpzLqq/sohtDysdoUOWmf+9t6IpIJvd9YcKQA9THQJtN\nkK85SrjrC/Fg6p0I1PDpl+kbgNQmvuATeCZolMzMPuDrDvNeQrRvFKoBDIFr\nJj4VaWcHQmHe8pjsfvVzmD60aaXQjoep2TqIU4Hc5q0+OL/UMks1keCoVMDR\nx6fFdecgZD+cdkn78BkE7Wg71ALpFhHUSj6FF1sibjGvxNwCVsgFV3biIm9k\n2pE954lyOqcxLMc+3wtvy49djFriTNqk+ILg1zaNMpJlFY4lAIy+UGGjiqDH\nnZ8dey8WP2VHV0MO3H4nNhmAqw0N/EizFsuWfVOZE3HXVqXXaxUVTqjV1aIY\nwCsaBoGkEylteOY0RNpDau5yeYzkSyQ1gMLFk0RTAJkdMdglxWco52gTXJH3\nt30c\r\n=+7BE\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-vNiX3ZtCZbnuPvHRNwl7t7J2eWfTaNFWgNGyajblNRnOTPWbOGBnqIETRLKcTCg8eo6r/+r7B+VAYLd9N8Uoqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDX/f0EP8UXjbu2gKjlfBJD2+el7USR4NGKn9P/wVvXAwIhAOAZlbPh4vu2RjRfs0ZTLQoPHPksCphoWPMsEF6GQBSo"}]},"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-viber_0.7.2_1528431089388_0.419443244247482"},"_hasShrinkwrap":false},"0.7.3":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.7.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","viber"],"dependencies":{"axios":"^0.17.0","axios-error":"^0.7.0"},"devDependencies":{"axios-mock-adapter":"^1.9.0"},"_id":"messaging-api-viber@0.7.3","dist":{"shasum":"38ab05b7fb702a4f058384760c54699a4df6eb09","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.3.tgz","fileCount":17,"unpackedSize":79260,"integrity":"sha512-D8784ENV0AEFtntFgXT3x7SUPlnryT95MbpHPMGA9ZRtopzlQ4IG8ChQ6vc32uo9/3Hlmi1vyr8IG2XhQt5l2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe+WZqtT/ITzjLXZi7e6H8OQdSVQ6MKRAVOhrhKSpo+QIhAIRYE5I1FNd/hmJ7Wjcow6CDAyT9tWumqOJiNBdp/dUC"}]},"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-viber_0.7.3_1529380804112_0.651320066932584"},"_hasShrinkwrap":false},"0.7.4":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.7.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","viber"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.4"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-viber@0.7.4","dist":{"shasum":"4614f5f2c13eaa3fd5efbb3e36a8be56737ee9ec","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.4.tgz","fileCount":17,"unpackedSize":79420,"integrity":"sha512-2YAfctS3OvEPiu6f8EvqWbYQQWiIUJcauaOjiKlwNEh4RATpaWD2726PLxxf7bIEgdbpFqJp/j/GadNqrPiw2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZfsqerQ4Ns/Lq0Ve9ttYCI+FTUrYti9M/vTVCuwXlbQIgDWpwXKsMS1T6kXwHTyQOeQArtpwgMDcIIcvS950oZVA="}]},"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-viber_0.7.4_1531368909914_0.031579523718566094"},"_hasShrinkwrap":false},"0.7.5":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.7.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","viber"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.4"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-viber@0.7.5","dist":{"shasum":"83f226d1a0a370c6397f8e9e4df738a503aef90c","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.5.tgz","integrity":"sha512-Hybv+DcCqFjw+UBEdEHx/4uC9r07qPLLor1kwagvkQXQRhOnJtqSXVkGeQgFMENWSxIE5lbgUlzYA/Q5Yvz1tw==","fileCount":17,"unpackedSize":80198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZZoYCRA9TVsSAnZWagAASiUP/AldiYyr9HgLV0YQehWn\ndj3GMitK+tW5Wn+5K08m08XdsUKKDHrn9JPRAiwJMRXqv2zEjtCP3s/3pOnh\n5aPPzNrAlpONspwo7zPd2XD/Dq6gwTZ9+FXqXyq8Pg7xQGZfnSvnTAkfM3V7\nksuwUjiFmq5O96Pg5SwRrYDDDQ2l6Tin2yzeeu9uLSqfHkODu8VNVlB4ueJr\nVd34Rza3Nc7EwwYJutMSiqxYgPcssfVNSmYHKpUmjXw2m0kAjZ9wT8JXgElr\nwXCaxi/YsDdbSEYYzHuI55Yo/Q9HL+E5MhmrDdp2HS5eUg4VJ9nURrUry+/X\nh8CQIfShx3TjCQjNyWe0ZuhG+xsd9lcBm5eun9ve3RxjG1heZ9VpzPn0xWus\nzmdG5+WMs5NPgU8Ich3cWvfHLJqBnozZwyX2G7BbsFMuvKP6rHA3jMPnGFEx\ndH8eDPkdaz7zEwsAJ71CX8pLT5DamPAnyLNCHJq/NXqKL3gH7F+oqxL+iQ6n\nrRMkEbQmgv6m7bjpPpSKNcO0WzvJaEYYK66j7XaiShCiCZ9sDHGXu2AlU14S\nrE9hFWJ4xRzJ9wNdf7pJkFwN38tuCbSBQXhAOEXR2QkXad6vMVzPnIo2ItzY\nIUwa59MI6UDjeCu/vvMfOLhJR0s6UxwO5EC41B2d0WvrRyH3jj6e2gjQ8lbh\n+9Cc\r\n=sRP4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqSrQD/rHqRqp01wRMkTwei5YdHce2E8S2JLlxaJOYSwIgeb+ao/cMnj6USVLwT7zS/YGD6joCgONFkuE6CYFPkD0="}]},"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-viber_0.7.5_1533385239552_0.6556587928400155"},"_hasShrinkwrap":false},"0.7.6":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.7.6","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","viber"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.6"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-viber@0.7.6","dist":{"shasum":"c4fef4802e51df7741760a09596aad7a8d17c448","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.6.tgz","integrity":"sha512-HgIbs0zdHR225MKl/gjGuzWccPI34vzUtfLDjtAjLUFeAovC4+qMR17eB//U5Olf84ZoU90fyfNrrWm3i1vyTQ==","fileCount":17,"unpackedSize":80198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfl3yCRA9TVsSAnZWagAABNkP/3v1rHp2OraBiwn6feGC\ngagyo5eCZe3JpBAkgOgzXnhd/LoYcGHpTeXvROzY50tiOO3RjPz6ltnTlSHh\nQloEpQEsHsOMNlidZdUmj1oi8VMo3JJWxC438HqUJ8hemyWz4tXXtUFtkfat\nrjsIBINcBpHwlzNACEABolhQYeHwCQCafopoA6YE67SYnMcKTQg5xiS+0rhS\nEtkde3xx4yCH4FtyCplf9P5W/mlFPTa/9u7X1ruhrdVt+CJ7W0KwlYcD8lAK\nKDqOihWF2cK4tmfmM3qANmrRLRO4YPvAKx5d7f09ORsZnhDxCrVwMCUjVBkO\nnSduIvVkuQQiB7ztNlS4IrrwxxSe7p5dZK2/wSp1cjOBLt5t85/1tRKWGaNZ\nda6Rwcn3ueVtUqMMzEfZ/VvJSQJ/GSNZUu8fPsTf3dzZ99/gEK3/3FEyEenc\nZYvg2URvIRFVEl8SHsI8zG0h/C8RI2wRWIhazmP2RRqH5BfJTG73ljJVuNL8\n+MBSDgE852VDOAn/F+EbOGqdjxT8WffjVSNxRJ22HxsjyfJynb8zNcG+hsPM\nZtd5KVfMOiMGElDrwyGin4ZATQo6zF+mmZNJFcLfRTD38ScK7d9MSgKfEOwQ\nt38wACaT+uWwv940qo+OlOQxfpTxv8HtQ9QTyoU31Oifk0VWo/+b/b6dfq8+\nyw9q\r\n=YdGH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBku+JQ+8e2UlvfbHXzQR1nJG1jF7AXACUaDjoDJmMK6AiAsyVw4bemMuoBmyeN5Sm+8HiGEukpaZFwXwvaFHdcWVw=="}]},"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-viber_0.7.6_1535008241592_0.8567324081900545"},"_hasShrinkwrap":false},"0.7.7":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.7.7","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","viber"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.7"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"_id":"messaging-api-viber@0.7.7","dist":{"shasum":"84a94ae2bedd245b7533dc846f098c072f9f4a2b","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.7.tgz","integrity":"sha512-HtvyInq27tGzuQMFgWVnZwJgeS5FcIvJ82+Iaikb9xS6vxHcNKpa8GgHXcOUvXPKx7Vx9GrV99HbFmIm9SxzBw==","fileCount":17,"unpackedSize":80198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnh61CRA9TVsSAnZWagAAj0QP/3bM1qRW1otJTweQjeSs\nD8/BKzbJx9hk5ezEU8lI1Xom93CMuoOLv7afHeEJPBfrwV5doY8sijyqaR5r\nPOyDa0piJajsq2XA/RP2UE6wwnERYs4GJN6jXdoEIu1TLIu/1UGt6tIR9gQ6\nA8K5tq4f1D+LJpqCSdjwy42aXD4VvEme53Ejq2c1+6WiENHzs+/As2JVZ+aK\npvkq3xbMcXKvYayHHAMooPMlfxqoW8aLEgn6DW1nzGM6rrtUyiibpErUZ7GA\nfo1CoeDwLHf4rZakiyP0AUvUPDOJLS9XHtntV3TtpdhrjNiOYAYJ7+Aek4gO\n1P4IlkOb8HiV3tldH/vjrTXgZ0D1Mh2jXyo0f5uGE/5kkArJhycHTi3TmHFl\nyD16ukQPpVo7xmgxIgMYdPgVXKxreBwIlqtG9iJldsmmknb5J5MPDR44kgm7\nybe1HqePSoJHthss+TYgOOfn3+4WfBBuC6MLzM3dcuQBYbsOjPsTT/bIk7uO\ncGUCBR8lSziencXfJapEzSUxroa/JboMctS1SjMIJps0mKmV5MVmfCPWfSGV\n/Y0uyNUT/XIxieoWr2TkO1wq2o64jQcHw+LWwrlHDOf+avI+IOX1xqdqAYNq\nUNGvA7fpNe0DiNgOc1pcTS5dYjn1KMubqWT9I8r+DAzryO3Pbj+TYnAdhMDZ\nZiUw\r\n=c9U6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBhKlgZVus77BTvhdw1daSTlI7m4pm6xOShcEVWn/tH8AiEApaIQcGXpJKeGkECilVgVeo6AK1HAWpNneiGSah+3bJc="}]},"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-viber_0.7.7_1537089204126_0.7780163144737897"},"_hasShrinkwrap":false},"0.7.8":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.7.8","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","viber"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.8","debug":"^4.0.1","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"9bcc48ddb1c03d7fc0d883c5c8e0e5421cc3a505","_id":"messaging-api-viber@0.7.8","dist":{"shasum":"3d9d322df294a8ca84e7eb6d6f657c70b39c08fd","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.8.tgz","integrity":"sha512-4nedppMziLqTOB/qvc+NIfGS+x4felTI3ZusVhJIPgqtzpR2gOZO/04HjDeSE3hjKLFA3beLhX+XCB5GVvttsw==","fileCount":13,"unpackedSize":83729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboeWeCRA9TVsSAnZWagAAD1sQAKGjacn5i5kf6JNswfon\nzDuUzs2h9o5NevDUjra0pxOgXy1NTUn9JgwZOQc5B5Nehro3aq4QJ2i4CDTz\n9+HXFuJIofXWOOcDNZ8Abxrd4qkEe+CWOs1Nr9jVrJCVMpnJuwljgDS5nTEQ\nA1/qdVruZg0dLlHQ2E5c81zU0U1nrhcCVkBuu3FT6Qh0uxhSwc+b3UKeU6Cb\nJ/5A5uUnzGSP3U0gk0hoGmCAW+m5oGoE0MuBawSHnaBbQ9j9o3z1Le54HMas\nldMro+Z6Mytb6WjI1njNT6V4Jd368BM+8KTfQZu/yL7sq0gp7ShNDESTWRvj\nUmSzGRCn8hkvWR6nWt0LJlpTPcst/DAVu2GvJCVR9hTuXw5ah+Z8g9b+pOiw\nOdQJydZ2fQ0PuY/OxQnlDQmo5CO24Bv9oJML6sJzqJgJ3m9gSS+sUPHSKTZ+\n5bzq7ls0U+SRU2aqtyIPpXl5lW7zfZhZ7t+i8Kz75wkd4FZzzt7HI3+gd7xo\neMvYjl84FIXy13kor8LwCbBKISCJMrLNhvR5ggo1sur8CmG8Rstupkq34/kX\nlJm1AfvPAnT2TaYrFYNjObXdAq7NKp5P+woJoBHXIN4C3jPD22ARIJHg0WP1\nYbpK0m/5SVucRnh3UyZL6ldmsNUH5MPsIy+GnsvJjUWcO+6SAhzZqjypzz3C\njAQm\r\n=T3Qs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFV9Pon0X30CYqi3gFgV4MPkLNL5vcwqobcSmjvSNhIwIgR5jZ0hnpfj/RToH8IMzAwYAZCI7TNubhbBhSZqbubK0="}]},"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-viber_0.7.8_1537336733227_0.14668465264342823"},"_hasShrinkwrap":false},"0.7.11":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.7.11","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","viber"],"dependencies":{"axios":"^0.18.0","axios-error":"^0.7.11","debug":"^4.0.1","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"8e43618226e9c46216372b813d24cae3bdf9ed9e","_id":"messaging-api-viber@0.7.11","dist":{"shasum":"7a1866fd2ddd14ff533d9ebe7e8842f0d75ef3ed","integrity":"sha512-PD5ZbBWMccsavFwgNCCleO3utr0LFtbz1aNttBZRUKJ3gGrz9vbwr5x0hiufWkMGIj0biC+ZwDUPSX3+CmcA5Q==","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.11.tgz","fileCount":13,"unpackedSize":83731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx0xVCRA9TVsSAnZWagAA7XgP/AgaqSv6C/azuJDD0nMc\nsAmGZGnbMtiU5vSDAk5jwBqGnNL5hOKniv+5yGtvvQJ/gWLGxGSXMfNHQcXO\n0wUEQHDYSF/2dcVT2n/Eq/YEUG5VEQTvcFW10X/6dXAg+4L7AE8/QiiOedUS\n8yHPGgKBZ2IaAwq0P4ghT3Ly82IXfKLnSphCJmFCq4ZWhhJTK+NdPitMv86+\ntANjizTvx2zmZRJmZHxqkb7/rSualTLuYz6iOJV1TN7DR+SAQzg6GqaPtdBV\nH3v6meho6dhQGmM4bEUZS9RTLbQvrGuW22QuqLC4qDQ/cPk5g/0onmrFtIB+\nZ78sVu1MIUlDJ8VcdVMP8+FaFLJogUWc/qB4RAsKp4PecC7IWogDpnQ5p8Sl\nW+pXc6qkNHn0fCV49APKaGAwobgfSDyGj3DusHou9RaDh2WkSq62SHuJeQ29\ngypG9aF8ZAPkAYkI6vCd4sBUqRJe7PK7nra0eu7ja+WilBIp+7ZVcYl5oT23\nilKkCMrqGSoATZ8EcWxuL38IoViU9rHhdnXOZXU395ghYXwfkln6BwcEGjcT\nbVpoBBdg13Xu1kC7qUiP74AolPLleq4fbOX4LZiihOsO2N6LqiW+YZFR5ayC\n4HJT+WPRxXui5usYpx1kS+QbzTgjnIhVIxl6tVDjEwzwLEtQBuockz00BiPT\ns/cW\r\n=C/TI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWLtCkJ0DzmlTiSpcLS55L5ER1FUB13WtHMpyciJX0SQIhALj24vu29S/Jlg+EqiZ5QLm1yKXtwC0FZJRrJIL3j3k3"}]},"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-viber_0.7.11_1539787859986_0.8855602903486233"},"_hasShrinkwrap":false},"0.8.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","version":"0.8.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","viber"],"dependencies":{"axios":"^0.19.0","axios-error":"^0.8.0","debug":"^4.0.1","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"gitHead":"62a2ec0cb939605bf01a6054b9ccce9f9bb8e1d7","_id":"messaging-api-viber@0.8.0","dist":{"shasum":"23b1b3faab0da96fadeb71bae882db4d797953d3","integrity":"sha512-6yPJmjDdh+aghFs2UnKotvpDAE4+mW8npU/sMOB5T8FZbtqvPCwHvRijOP5G2e0+HB6auTz43IsIJpcMwyYH8w==","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.8.0.tgz","fileCount":13,"unpackedSize":83729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdY69FCRA9TVsSAnZWagAAU+0P/icoIDfJXUkKBoXC0GAH\nCGhEMm7YUfl2QTxwvfhCOUZlHIjf/nl4xfUn0sqKgaLOVStzpLStUTwdChJi\nAU5WV8RE47t1TqzpdtBxl1Ssqr22+7mYp11v1ZL34RcyswRsqgrMI2etObHw\niCkodNKNuDZSqMALvxtypiKu82e45jjZsf/VNVgFfXI7iRV6ri6vq2+dZ2is\nyTqD5E+i6vKmxfzxLvY6g3/cj24NfZ3gpP3HsuT26Y7MKgwKoSRDEfVuMtGR\nYKXEmYwcU6+I4CUXmq1PrdhNQeC4P9jsoWiALYwV0BHbEQsKkMekX5gM3X/7\nNu1+3D6MylxhInhofQPSwLeTjk7z1AVAp9Vfkm8b4pAGsCG5BkLTqfTWFwpV\nHdV5Ik07PA/ysc9ye6kMEP1LCnSzE2dOwWuS3cjjSi6ZW7qR0hVmOWs4cz4F\naao6ODmIc8CJOT7zx/0G2Eanf4VopFaCjBvEQ6jS8bbyKrQxqBxd7qzQV0uO\n85b8hfJ/1/9i6pOyRfqJ6AMy55o+6Xd2yZQ8HeYe/wL/DIupJSnhwNatj07j\nuuXa/LUkDg8tyYwiiYChoD+dON5zfALJ6pYt+VGdt5FEWd9Yv3adoptHEgLK\nYEdLuxCcr1hUgnzEnSSHV/9r7z00ce4lOm05dhgtmY2of/LGfEFycWsZMxt/\n4bOZ\r\n=+hfi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAScdIk93nhGteYUDFqBfg4RC04yfvycUvsZIZ8foXxwIhAN4kFs0y5Hi58XnjRJA4K/09HA8inImg4Xazeme+ITBV"}]},"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-viber_0.8.0_1566814020679_0.8459622305048715"},"_hasShrinkwrap":false},"0.8.1":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"0.8.1","main":"lib/index.js","dependencies":{"axios":"^0.19.0","axios-error":"^0.8.1","debug":"^4.1.1","lodash.omit":"^4.5.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@0.8.1","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-7fSbLkEp37a2OJ5PEOBbunvHK5qRSLyuac+IkOZ4ozspxYtzRfmf9lzvE4Ygyjz4d9YfPJqhx4x32FxBJzJ5Ow==","shasum":"6f82eea423c72988cb276c175f87f5b4420670d4","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.8.1.tgz","fileCount":13,"unpackedSize":84581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZKygCRA9TVsSAnZWagAA1oQQAILopB6/ukK67shlPR2X\n9d0wZ4t5b3oL7H5HhVjdWBQeZH5fy7QmcyXIjhUZwXJGW3daZHtBpQVqckCz\nPx962im/geyp45P2sJPh+mLVWQPDzhymZLSmEpT+RnPTI8wT8T6zIM/Q86Bg\nhNjrzv4QoboC3d6+VftEVVHmM7YNgVfQWy/fvS1kbnmNbqq+BaWYWJrTv3fP\nyLsqLwEySr5BrxbAA8rBXaet2JzLXHNiAyElpx+Bus9E2zeOTZQpaVhXLLdb\nx7FPClNibnKUeWS9Uf//bKzaH+TRMGEs08Jbep34SXDGYmS7a4xCfewTuyIu\nCBIwGcNIAlcKpvzCVhksI19gwjy/PJrIlwfJk3IVz5x1ka/u00gRHl18LJbC\n9CjN8EWpifq9p0Xum5PBgfGAvOW0EZdHDsD0nckpQp6GX5oHlRKn2XeLtiMU\nxTLGBuq3R90MdTvbZ+0vC+J1TmrsEcrP/0ro/3uOX+aBUpTATTdsykvaPqTS\n2aYfIUhIOxcC4GCk8eBMRGMz1rMxtJ+Scx1JrSdwYlKvA530OOwh+LjycFKB\nq1K53kvLv/oP/nhWdpu/8HWurGaBMg6Z1BCaNNLxYUILsXPM2P+rIItAS5Jc\nFAn18bzwtJ8SKLTqSKSup54eyoBiE/iI+DhTqkTOPePPQOkUv9EQx2vXEMHP\nfVOj\r\n=SqAs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6cS5WD7v9rDkp/uOcbVgQFjYbueVLgIeKQr6akZJSmgIgIhUBPOmxzk3fOJwtJmDLeTPdBFk91u8HyP4wslkAKSQ="}]},"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-viber_0.8.1_1566878880094_0.8795508824309781"},"_hasShrinkwrap":false},"0.8.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"0.8.2","main":"lib/index.js","dependencies":{"axios":"^0.19.0","axios-error":"^0.8.1","debug":"^4.1.1","lodash.omit":"^4.5.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@0.8.2","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-TdFdNBksUt1kGrPB1asHJok6yeNVGirng40+ZDQAkt5Q9M0IBP2MdV0F42og8bvuzPYf4edwjqfhJezS0yM3fg==","shasum":"6a1e04e13267432227bd323748a76de61ea606aa","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.8.2.tgz","fileCount":13,"unpackedSize":84625,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcLZDCRA9TVsSAnZWagAAkMcP/insNI6Tymgl5LQGsG+8\nZxnTclxHMQUoHTj6EJ69eOqFyX7nKShS2Y//2oAvgbDqVC8NW2Ztk+KFPoS+\n8hxF+BWJ1PIUt6MvUi2HqsfZOFdQyL6KkJ3MbNDU0txlit1rKp85S/ZVnh87\nC6s1e9VBqIcePeCDK2Nv9HsppqH8W+Q7ceKjON5BOum9scRhU8IKK6tlGkPG\n7tUL0msUGSSW8EHehcAT1Dlqa8GBIy4RQSJxZWcCvlqarOv6ViktJ/4JTZVp\nvC6XuG/x5juillO9IjcACtR8e9Oyj02UQwHbjFs0EPs3T5pfDrGuRI+HWXCX\nzjnFhtobQt6RNWliHcfykUeITRAmYL9Q8xO9m1DomsUnLWtvW0a++VxGmCrg\nS0peBi7Wfw0Ck8+omGgqNv0Yb90/983qGJa4SieFBAYGzvEjUm2/8OUWKJGT\ns94oGTOUpj1oqXk2kQGaSpv+VMwKoE9NRxAsFfmQAS4fcAF1Tn6c5cVT8fEt\nCmx3pHnZzJT70y8eJh4FFQk+6hmLXUS8Xx6GiWu6aiUHLEKVV3J+b2cguSt1\nouUS5jJjgUMkPSccNPPSYFx7qFRRBePxHfCFQmLvqko5Xs6kG4R9irK/igu0\nOyo4kohjYIamUxdWE+UBtbr1qM5ml2k8RL6JKuvgp9/46dwhczthqps4aID1\nVOOC\r\n=GyMt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICsimjyCd8O2H+Wt8CeYmYyRaQum8pwdBFWayN1JSwOGAiAun8RRr/ijDsRtdl1l5VwFF0ZM+TsvrAkCZ2dWMYKcXg=="}]},"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-viber_0.8.2_1567667779274_0.6432012759857895"},"_hasShrinkwrap":false},"1.0.0-alpha.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.0","lodash.omit":"^4.5.0","messaging-api-common":"^1.0.0-alpha.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@1.0.0-alpha.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-M0cRf2Z3JLD2J6I1Xh39h2aF1XmHoxuXNKb+9zO5W82ARLbR+pJ3PoYv3qIEiEZLGNBrNy/AC9336zbDv5CHsw==","shasum":"bd34e9644e53c8bfb5584e52baba6590a343a6e8","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-alpha.0.tgz","fileCount":24,"unpackedSize":191547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeMI3CRA9TVsSAnZWagAAnGoP/jT5YuJ1+viBPAoIL37A\nqfv5gdF7XHDjEp7tLFINBqkhsb1/Y7oYhNPuLMmHRimbR/bVD0CMU2LtHFJN\nDHrhCm9rgBGxrBentqIPLm9D3Md0dkLZodA96xz5kiZ8INqWZxM8TjhD3fo+\nH+TR1E+Rq28NjrrBUBpjs6k6QpJI0m/3JBRNi9jo5HZYxSnXXniQ9+Yqhxdb\n3C8s5+6rrQCQQghJbHRmZIoOVZeYjI6Vlu2FOIo7z15UISUM5FMR/gaJNF2u\nWE1S1toDzBvhbfrOhaH8rx5x1WMOC6eCWXI8BdxleUiSlqppTreRTgu0RFDT\nekFNO6M1K8RMBoxueuk805R6j5Ul5mvr8PfpQWPxpyIsUYSt0hdwTvMJ186f\nOMRjJqPrdn3oggZtlLPfZb6Jz+MyidnjN10JBAhJdRfwv4fPIQwv5RBn+Glt\nuTt2aDemRd6n41Lmxkl2DsN2XKmXEGoorWgEHlqWzAoP/p93UObr0cD4NWW9\nBKclapjYZAghSCPo/uWOkJiC/OOzIKcKZJuoHmXNQp6hnTMYnShGVlCU99fs\nVc+ecudDZ42m2z6Ye0wTfc5YOUteY3e+3Qa/IQKDNVqs4OLBAmodf5+nF10b\nZ3l92ZTX4JrA/Dd7dDLaVONkz4C5EwHFdiazI2EH85PXpEDr9jFAEulj6EXs\nm8+D\r\n=fc88\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB9wshVoalxd810t9GlzXoEEsDuubGOqMcqFemlpnYquAiEAjmQs1RAQkHLV2wmKLKLxuVd90YnYGo3QanUhfX2ehCs="}]},"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-viber_1.0.0-alpha.0_1568195126289_0.09452576228906184"},"_hasShrinkwrap":false},"1.0.0-alpha.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.2","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","camelcase-keys":"^6.0.1","lodash.omit":"^4.5.0","map-obj":"^4.1.0","messaging-api-common":"^1.0.0-alpha.2","pascal-case":"^2.0.1","snakecase-keys":"^3.1.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"7581219e17a1b1d9ab2f600e14f75b9714dd6fa0","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-alpha.2","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-ReJQ0bQpOEzaQLle/VhIasyJ0UDPxpN6l0VK296bsLJ6pMO75hziliWGkP3+1ZwoCYq7dAVDRKTHF8DQ5gj34g==","shasum":"9f5d161c1f9b59957fd7341e13b0aebb9c99812a","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-alpha.2.tgz","fileCount":24,"unpackedSize":243136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlugyCRA9TVsSAnZWagAA8xkP/RfMMvVcLAbSJYlZQgGe\nXXSe3gnBw78I53Y60Q8wGsfShRSOfV9JOtlJeqcy6FYaaBYL10jUOs8C6kbv\n0c0C45Qw/O0SH3A632KS9oYRVczExo3FY27f8uERKo24+qrnbTAuxDjRNQ2x\nl46AucO8JfoSuIVJ69TPFrYl8tCPPhveWQQnhAzMnau2QL6gx18vK4J6M1Op\n7uWJtPCMnuiIND92i/ulIxBJU0Z1c3FYsXKFqwm8/nDQ/bUPq80kr/p/M/nf\n7BFZryvxQODFI8YvZusNfb6pFwXO7OmnOjTot5UiVibuZb1oMXDSCwB+V09X\n+rW4ca40arJmuS77afKgtWFB/nVWjrVs//RHF5UKQSKnK7IiH+0n878Lk+gC\neVyJgLOdglNsjfE+qWxrmA8VD91fiefeq7kI+EzLBY3vSO3q8j/gKl/ZEHrQ\nMYgo2e8F+xiSrO2F5naKRYNbvGMbdXtQrZFBcWQJSzOExSpwTLFpKZ45xErb\nxpDJerGSO3u/VggNMxU/1Ump5mv80BK4D66g65+/BfUpFZdpmEq1ciDZZwRh\nv1evR2RcEWjtx1M7LQ1XraFruCOsVDxhcU9wAZ8iGkO8OTUe7mIwTVakIhDf\n40xGyeU4KLJaPI4Lpm+nmZGM5+b3dFJWTFipk3gXncz489p9rRI5uajkujHE\nbmqi\r\n=3K/a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcpAqWG8Isg27LN5u7+U3dvasLQv80EPZ10S2L/LZ5jAiEA3qW2BPh8IRxCxhPIzAMq6o2GZq1ZEj96ivgKHXVi3EA="}]},"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-viber_1.0.0-alpha.2_1570170930118_0.7384874916590056"},"_hasShrinkwrap":false},"1.0.0-alpha.4":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.4","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","camelcase-keys":"^6.0.1","lodash.omit":"^4.5.0","map-obj":"^4.1.0","messaging-api-common":"^1.0.0-alpha.2","pascal-case":"^2.0.1","snakecase-keys":"^3.1.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"3ba04ffaa1a5c9c7a2aedbe21242663adec99166","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-alpha.4","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.16.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-fJnFPET9Yh7Ky2CB9ZeApIDcdMS+EoxifnCJCviOyUnfq2L/mWSatyDLAiPlyVPGFrHWW33nVmSViOnIbUACpg==","shasum":"6bc013bcf4d4a2f279eb3165f3f3f997c6ec76e6","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-alpha.4.tgz","fileCount":24,"unpackedSize":242913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyUMKCRA9TVsSAnZWagAALtwP/0lXJIMARdAHgn4C7f57\n7mt9e7L9Vye1ihtM1IRzzgqyBxIwVgEDrglKzO0qtRp3Y18a8QT04UOCEszx\n2mQH2f6OFPwluHbm7XIBHzP29TG6PvOgJTWLowI2qEESxXVXCievrpfdxice\n/UJ8BufvkY5YtqF2aodIj2EQP3Xqv0gVKyGDTlwupSvwefl1mMFoXQSnhIzF\nauaeKBZ8V+f3qZwL+ejaiSpjBGK238kfoY5m2fd4mqBn4e2VsB2B/WEEMyrg\nveOG+FeLUt130D2rztApbFFpJEqyk8aKScHhJPZbtuPkXNru8etkBunUXleE\nKCROFChyRu7v3GjxP7EXiX9SxtGZELhJgWfU8G4vhptXzwquACofOqe7DtLu\nhtGtWHuLD3GfLEXKWwMS7tMhtLJhgGMJJchvjoYLhgFsENiUlcl6tWuUiQJL\nvjnrndgIFYaB3QscjEQeZH/lRfxmxyaFWUZVolHxbBuuFTYnAN6AyPx3fWQ/\nbTBFQnSZPptTHgcNJcw0G+vpxelrq4LQdepLUIcipVgv7Aw5vj3Fk/rnBloo\nQNYaLoIRn/bRbv9YPxLVJ7KkZhaj0ApWJAX8zJmo4Q8VPz64ZpGX9maOdaEN\n8B+iEqYg89ii3mt1MbDkOBvDGId8qCAK0Kn8jOKGGtW2Y0ctnbgEtcsrP+EL\n8s5h\r\n=+vVk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqKR2G0xrjI+iuuZvgFU28BT18VTw0I6FPvmVA8h9b5AiEAmVYd8QS3vt8eDj6lwxxbduHWuLLtWR521WdwQmZtr7Q="}]},"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-viber_1.0.0-alpha.4_1573470985478_0.47019692207926056"},"_hasShrinkwrap":false},"1.0.0-alpha.6":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-alpha.6","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","camelcase-keys":"^6.0.1","lodash.omit":"^4.5.0","map-obj":"^4.1.0","messaging-api-common":"^1.0.0-alpha.2","pascal-case":"^2.0.1","snakecase-keys":"^3.1.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"7e2f8be9698b03e5b16a58e6b6ff5c094d514e62","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-alpha.6","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-nl+IZWOuY6eNXO4LW+bEBOZxHigYkO6j3qyTgEqKUKI0QyzlGRHgzckJbIVRIJTq+Ox6UQOt3jDjPJlnDr1k6w==","shasum":"2c4eee625dcb192090632014a407d9823b51b712","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-alpha.6.tgz","fileCount":24,"unpackedSize":242928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyUj9CRA9TVsSAnZWagAAvNQP/1LoxHXpmipx3nQSgFsR\ncZaIAPDfeGu1xd0+X25y+uy+pKAx7yavdMVlEKdRK97f7d35So7WOGue4I7d\nIZhYU1wDepfttcRYQZ8FHCa34bqV0DwSpdY1xMeBITgGHF/84yHW/cYWyVU2\nlKZbrjOFKj1HnSmQ1Tpz2+ejrsDwFKk3ZZu6IBgP8CJ8L4R3t0xAMPt0CexP\nSe25W+gFa3Ecl0HP9FxUf2R7GD6xvGVj0czu/GIVpTvjLlnP6EnYsMbk/KTR\nKZKRN1Gd2bSXJLQmQVbgWSdhg20ozRJEHZLqN2hT+IcreIAoraaeSHtIJ5dB\norlq+lKNXUONFROk+AX+rs4csIK386FkbpWL3dmhB2U0kEWX9WbHiaK+2rTc\ncHDO8X/1c1So7DyBylL2EPnZuJ7J14HaKebBb5cSvVN79IThBv4DFaiv1lxN\nv3GNy27W0ij3zmlehfv9QyElAxlVo1KcNIOuXifu/kqvqPDNQ8Pm9gIDo3tt\nGLRpnur6GSgMrzCGW1WmTXYfHVtjSKbkr0j+5kB5CbsJ9okuw6fKNhp7JBRg\nNFd7P05fSqHE9nU6E6+t41014hXtpWLETRbVNuFNdAOXyIJx6gbNTEBD4h2M\ncdQZrEf+isAL26mPzLatMCy/S2gglTY/H7X4QXZ3FB5hS5tuXzgy0Al4Bnp7\nlw7s\r\n=3bPY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/Ao+QQ4KqiQ05qwJo3PMDoo7//DPOMZZd6MFUuVQE/AiEA2b2R+B6aGlvajbEGR4+eexkEsWvJlWHIl4eizVOEA3I="}]},"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-viber_1.0.0-alpha.6_1573472509279_0.8921511094445977"},"_hasShrinkwrap":false},"1.0.0-beta.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-alpha.2","camelcase-keys":"^6.0.1","lodash.omit":"^4.5.0","map-obj":"^4.1.0","messaging-api-common":"^1.0.0-beta.0","pascal-case":"^2.0.1","snakecase-keys":"^3.1.0","url-join":"^4.0.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"96eaeb0fc0b1bf8799d17dd93aa4c59f1eeeb0f3","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-YWl7X6+VWBnzdl0HcfoODwz5nXc3BRS4Y4drAojMF2w2XiWIeUn6AbEMqYiGF0YeaXFPpu4iHgdRYWwijnjTtw==","shasum":"e529d0d356dd798cb2c0dba8814a6a0d017919ac","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.0.tgz","fileCount":24,"unpackedSize":242926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzP//CRA9TVsSAnZWagAAwO8P/jUR+SINJacAD+JM1DI4\nx9+2ew2IREmtxwaN77Qp1t4W7+7bQ2AS52hL/hyyQGDC5mpPkNO50YYS53Fr\njp/N4iRqND+QY8tJQmnMreSktwgr+ZKscv+TzEHI7D94kZv9sEPBPd8ovuno\nKMNib8TBX09KXVmSZ8hrRsNI1Qx88hJDpcaPpS2loO6tGSxI0BWEb1PJLVOg\nBj6wGxG6g97zKjru+2z7CFE6is5Rd2edBCA9OjBcsvGu5Vzkh4ETUcOJ6poE\nWgN7GHpQ/AT3Mc1THVTHGD0Y70Ed2X1pT8k0q9HMAZc5W1cbFbA8g3GUsfzx\n+Baq6YbwAqdEL22lR0vhvCbbzT+02jajrYaEEHKmpb/uH5qAmXb0sn6Mnm+h\npaIjKwoz/LHC4hv8ukGwt/B3rRS9EG+taZPc7OqMQ9LXpcgC8yMlrId5N1Yl\nGKVICg1ycDoUBcfY/5iFUx0+LjHIYQJpE2Uhj4xZBkngMyp/JPKX1zFqEOQn\nxoks/USOGwU17OySmjfa8uuybbd5UoLJwGWI1qNtqNWdrt/ZFfvS8XRSJJhz\nVAdgcYLrVdaPw9FyMaeUkhqZmATf4lTMd+agilgxOvNvbElTxxpeG35L0WPg\n9eGFjzPFPvJPNWXoikwjGTOMexO5OzYZxGEDuS4WrKkduS1umwqHN4Ak7LPz\n7FmH\r\n=Tl7/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmzmgIdo28m3minfLzcXgPUlrak1Zes7se+B3aqD6iWAiEAlLcsxoKyGChvLEo7wsMKBOOUbUWLGWmi1m4N50iP1tY="}]},"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-viber_1.0.0-beta.0_1573715967523_0.6899896882535084"},"_hasShrinkwrap":false},"1.0.0-beta.1":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.1","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.1","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.1"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"c92c8cdb79d62893a7c07f5208a5234f7bfc00cb","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.1","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-vCtUFaEETIj7/UavS+FjN1PERNNwixNnkXYjFF0XVzDa4fdqjfQ28SXeJTSrjYqndsqPXivbTNWZDmHtuFWxUw==","shasum":"a49ca202b1339bd442a1831abfc0616ee1b2f7f3","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.1.tgz","fileCount":24,"unpackedSize":206158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0BYTCRA9TVsSAnZWagAAeMUQAJidA4GV51Cs1GAQfZUK\naV1nubcLNuJuZsJaDYIIxE3LCz8/qVQ8YYxPh6lC0iFqcxGi2SDVH/5N3sH/\ncv/LbkM2oc89MglLS8V3msqKzojQi/hSn9k4ZFKjyDH6JLsC3cGm9zAYRAmd\nUberl/yfyCcNrWtbMYjTVM1z6bo3F0FipoEsvlTaBN7mhGTuMmWJKDsMStAY\nKwAIZ6zh8157qs9HYGWi5KuSPpq8W+l+JMFDJK7sDJKPJu6zmLVW8TtOiv3r\nDlwsQ8bU/Q43KBaCU+wDQIPqJq0IEBf5A9ek6sd1sIx0OXiMSHsNAjkX3Ohw\ng1f1GzTX9eFYt4XZAisi+VyQOhOMym5hn2Ek2KM/gjaogib7iPohUp7ZhLWz\ni1u1U84oB2GvUgfGCZqNYSONLhdwB0xCgFbQ3dmj3uAwgNF3yP77arHXmnTg\nMmgWymeZaDQ+vhAFmQYs7S5l+xJhm7FDZH0DJdDTYlLVLuyo1CihZ49masFz\nroXsS/B4wU8FNrGBt0FnCHDXd2uVNHvkeiAZXHfiJax1jX504lYixjKsKVkS\nyU0eTWxrZLpjpzZIUJhekIzOCXPGU8B3ZDKs9lmDVSbGgh6I1s3JRnygJJDI\n0Ac6PBtm7yAibn4wDeCazAj2ia9M+4ENQ0G7Ye2tuAhgRCs2x2JlI5jPK8sX\niJ+I\r\n=Ckz5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB13j6gpwErcoekB2bTxWmL2x2QWkD0qSna0RaI0FSGRAiA5nMmN7EhqQetZQTzFwyEFfYlgclGk5m+tF3s6CVKy0Q=="}]},"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-viber_1.0.0-beta.1_1573918227120_0.7648128613535703"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.2","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.2","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.2"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"142b0193efd5babac07cf7280545f7ea202deaea","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.2","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-0W5gi3tEFCMR3RYQNne7gF87r70RKVDRHMkrxtpFfbY+92qwlb06yqYCoEV+e+yqZ+cweidbBhn8ff9wlPv6RA==","shasum":"677350773dba1a96591892e258e06cdd5c7547cb","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.2.tgz","fileCount":24,"unpackedSize":206158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd04O0CRA9TVsSAnZWagAAO1MP/jYThjYtpkc+K/cctWXX\nc85URKmmMax3cQwXULR1U+utBV40wy36R7bEUFmLsiqNp92p2jSHgZwgMuPU\nqxbCYRLsdC4SSl0zHjavY++VJSUgCL1khgWfJlqSD4Mraj85wPM4rQaLAvdO\nkAOG3bXqbFTB0DJ6p7HYylbM/MWsz0zGhRNtqfHUIHDkbhBm/Ehs3FsOalpy\naBsZn/K2k8MvY9V05DCsj4yPVMtlUWI6Fn8YtmiBuMfYnKzEN1gbi3RBU/4z\nOncaFAsiMzO5B3xSF7PqZBY9EQRKex62qs09yiyyjdCc56LEMpPLMu9x/0XU\nAyfLvVkpj4rIxdKK3mExpRAbWpVdLApq2LZwqePATbEsqJVvQ6pAzJlnOzPV\n7KB/DcE9AHp8AEzD01eKUvozfZvWCQGSWin69E32pSHQrYDaDWA4OB/K0r9d\ncqXHHiLT9eobeV7C2Cnl85xMe7cIzpRvQBrX1t6M/PPV0UirEH0l0QqOCqFX\ngiJop67XaD/6fWn1NoYxcM/BmV8LLetMOBwzieNLRMXPC2Zy2mE1xxmAlEc+\n2uyYMbZ4F7U+n1kWeLK/Lp1nj9Mkr2cNlsCsQVC7aXMYktBqn+dcoSMljCY9\n2zANKYMhad1IojjsMS0BVWM9S5XWgLWBkOm+1Lp7q7l1n/M8V4HjgQUTg6Fo\nNlKL\r\n=qSvx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChijMoDwaizGR/LAvDkL8FoBCjWu917ze0BezgaSNj2wIhAN3KJSNMLUxUXGWHz7/Xm8Ihbf7kquLVG6PUq9eZTUif"}]},"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-viber_1.0.0-beta.2_1574142900020_0.7673980135505745"},"_hasShrinkwrap":false},"1.0.0-beta.10":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.10","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.0","axios-error":"^1.0.0-beta.5","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.5"},"devDependencies":{"axios-mock-adapter":"^1.17.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"9ce7ddd82779b579beab4256d71ccd4599e6c58f","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.10","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.18.4/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-aX+WkqLyBLWWoGvaxrek1R0FHKisOCt/CtS8eds8b6m6BnbEv34yhQPn6wWtv6uw1WqBKLD52OCFdWfFWFSrgg==","shasum":"ad7e70220b8c8db88aaf054a48b844e354e8938a","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.10.tgz","fileCount":24,"unpackedSize":207514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7cmgCRA9TVsSAnZWagAAXNEP/j2bE3qLeolwJONnCJf+\nzBCpgmGPP/chr7TJY8tUnQJvMWc6f+cbFVK1/0uOECLBNffZ/S7AcK/RQOMX\nzexWh4lvoPaYl2k5FXz0YCMRcKUS4RvwGPUpOZbdtbuuwSFfev7+yJTsd+EZ\nq4U0OQWE+nHFZy+n5dUfBY9Wf56wLajZH8uAd9eOy1tqrWu5sAXwYppgX29z\nZFJBUAv4+iNpFzjbUFINPlxhP9qECn8oTVNUOPrUEm55fR6AO9hdq2S7z6bL\nNQ7GQtKAqqFJdjEaeqE0e+pKzMAK+faGub15St5o7SaSUmOzRJXdZtdKGCdS\nrfZaKhMkTpMm9VSINJsN4RUjxZD7RZJ/JPxHNVutW7tDS5b01ysPgOlCbjK4\ngw+yVqYvp+GuBFShP/mmcwgYrQFTD9L3ugszgklEBV7iwmAgL8JwbuJ0AcaH\nbEXJgXrzdUeC5rRAn11TSWVcl9+4DXiDtPgSGxDlaS2p4EQKNqo8NEFAMP8R\nX7htwCyAbRyFKJKb5YBXEwIj/VDMUU2+izMew4ptBxojAt00uaAjGdn3nzM9\neQuvq2rNhveI5Ij1TjecbHgVUpJNeK0opfC36ksSqAMG3zRE065zxtZuHO1H\nx2fc8nJ+q4Em4wpgKZmm+OI7pYC2i+3PZHjbmCsXbh8jHUtQJ19gp1Pg0ZAD\nxXgW\r\n=3EF1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHv5mrxlqmx0Q/8tfq56lUC3DSliFpJor3FB/OyMUo+/AiAN1m34RmQZLaivf1dVMz5eVepWzzum38yNiaRgqTX0MQ=="}]},"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-viber_1.0.0-beta.10_1575864736450_0.4122372340299152"},"_hasShrinkwrap":false},"1.0.0-beta.16":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.16","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.16","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.16"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"e0695dde8d2b01d1a068f4086fbd7988bcf9de4c","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.16","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-Gp+MTA3dz/EIOn50NED08bT9kkD4IC/fTDF82dO/UIo57PafCIogP2Mtqooft6gtKMM5PR0Tlcki6rEj7mywtg==","shasum":"c382ae98170729cd2bd2b15f0c92b495074b671b","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.16.tgz","fileCount":24,"unpackedSize":207452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiz12CRA9TVsSAnZWagAAfYEP/1lSIsY9eRbSseXj75lH\nC4I2NBZltxVmEs3ENEpI+DQdu73gjmHwZNLUvx1FSqD4hg6OiXt2NIoN1WJq\nFiItrHCGkzQDbkSGFCzeIBsCtIqydNtpGaG5ESp1TDkKKFuc8FAjkkm0HOcw\nVviKom8Js5nnZNpAUtJfT6bfQR6tnAO1/+x67B4yqudyTQdtcpX39Fk1evYs\n8jdjYy/IbBn0yNQkr+eC0wz8jopUzmOFS1zyckshqxGUmeJ1OPlU4v7P1haZ\n4K2t7wAqm9LKkR9odFMqzfFQ2aroARp+NXt6kkGjq07fHFcm5ECr/k07bn7k\nJs6QoAeRVSJgxj0XPUxc35k+3VfJd3i955R69wbPt+xAXllzjQCrhdr1QIPD\nDvRnkzUBEzYBhWY5/EaucJvaBPix9B7gYuEBuDxfnNganroe4H0johdDN4wb\ncRXT+W/JjikR3HtErtjHojCpMHZkTmMcrhUNLivK72J6nQd3YTC017G3DsyP\nFsqZ1Q0gSGLxOtmAkcZcHHOsiWhGwoyqXw8JEeqfC8JpUMKLeVPeKkuAGB21\n2jl3UeSCS8bFCCEPAfxDZGZSdz/geAT8fG9vBoEEGMsscbG8KJvp+65V2y8U\n9OGAx0ybiiEgnzI+uM9aSTHGALGND9m+cgnG174BE4OlSQoc8h7B3QJkBtmi\nPSiO\r\n=Exvh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFiCP8gzQTxDE1QdnSu8Ti87Zy+CYtYAcmlJHkPmfZ3AiEA1NemkUvgVpl2gNiFzNyD9APJL3jnuvHQdBD8Ai7gWeQ="}]},"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-viber_1.0.0-beta.16_1586183541523_0.3400824513345273"},"_hasShrinkwrap":false},"0.7.17":{"name":"messaging-api-viber","description":"Messaging API client for Viber","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","keywords":["bot","chatbot","messaging-apis","viber"],"dependencies":{"axios":"^0.19.0","axios-error":"^0.7.17","debug":"^4.0.1","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"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-viber@0.7.17","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-Xs6Li1AOxyN8jlol1m0Q9XfqmdS57BW8Ad1Q4BgEBhC+wuBHMAcmPeJS6rkJsfPUtaiHlX05EELIFigmOkp8rA==","shasum":"31caf19a549510714566ebffe30b407febf99c1c","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.17.tgz","fileCount":10,"unpackedSize":71990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejV2/CRA9TVsSAnZWagAAcHYQAJFwd3Ygn0XM2XZf93aC\nxRDbCNh6SXkIvfVmcE6pXuMVDoFYcd3h4cRQRW74KpInjtj9DEm3fMQd2wSf\ngQkwV6TpXYs6vlkOZKgZe5cv1gpkWkjmpWqmjFqRFswSbZ0TtzG1L9ZyqwSh\nP9WLc1KKN1/nrCBD75x4H1pIzmROpHFmglPYt2YxAOmqzWvSeRF6ow0LOCBC\n5UmYuKm1B1WddWhXpr874q2bov2gFbrIUna/nI31Y9tMTM1bdRkeWTuUd2SG\nDwbP1WMV5mvMz48g111f9eOrKHCtJUasS51P/7K9ARDwpWGiS2oUFC7OFEDB\n5/HtCYqJFqH2ZLioPKDw9EbgasF7RAxpul92vP0x8J4K0X0DYoEyURDydmFL\nga+mM6Gq6qDDQ4FjVGxuiMYt1dDMaq0cs/BqXrCI4XK5I667LYYesMtBgRCW\n61sSoFvn+wDy6I9Xck2+gcQP2rpoMw2YHxqUGiuLnsynpkmzvGbvLF1yJzsp\nNZtfY0KnmySnDzfNeyodyiNK1iBds+JufY3LXVsrndFKyysq8a3652eUxeZ5\nDNrTIv1qFDZExn7KrEdMqjn/9MBoheOvC/lrYa+D6IjFu9on8QYp7EE8ztib\nzR77tzQogTVTPsPvCk+w1gu0YWs0AT71WVCKz/mE5q78GmjOV2Ys+k3mJsBM\nJyJc\r\n=wAG7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJKlJjkxy1G6CUppIgYdD+zWB4K6UdmyTyjtMvvd0E7wIgb6ln+GScEAwoQsmLZ+I/NUlBKaEptfaq8NgRACk4xag="}]},"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-viber_0.7.17_1586322879168_0.7979997551061824"},"_hasShrinkwrap":false},"0.7.18":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"https://github.com/Yoctol/messaging-apis.git"},"version":"0.7.18","main":"lib/index.js","dependencies":{"axios":"^0.19.0","axios-error":"^0.7.18","debug":"^4.0.1","lodash.omit":"^4.5.0","url-join":"^4.0.0"},"devDependencies":{"axios-mock-adapter":"^1.15.0"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=6"},"gitHead":"4318450a056e285e70093a80fc0bf79910665642","_id":"messaging-api-viber@0.7.18","dist":{"shasum":"7580e0687a5eaeee36c6b2bd4c6c5675a7429ab7","integrity":"sha512-r4szcHsVbw0yGdi7b3h+LLiLuexFAA6EZMJYah0aPBz5VklVmgUddwBZfoYY/fdYF18XYNem2bm4OyNzmgdK0g==","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-0.7.18.tgz","fileCount":13,"unpackedSize":83731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejV9bCRA9TVsSAnZWagAAax0P+QC0ZXXHXrspLDC5v8wg\nT3XV6VW4pVZa73haIXi+UdatFytnavMEpvHMqajMdI2kO7m6Qh/paOu5k8Ac\ns+z9+2UrWkuNAjIXcChYsV75M6GMWnGttbG61CdV9eVO2mypvJTcunnLVaEe\nwMR3p5DMLClHX1Sp3rXMdCkN+TbqSDKaQx03o6NdPax5Aw67Skppq4rMp350\nmHauFAwnzFNb0ob6zQEJZKDT5t7ITHnOivFDLaOyoxoaGdu6WR4Wax7dtGOd\ndaHtigJdZKespHXxMQ6VpfXHmvQAZv08ijEVaxndQwvNdEIwwNgGfSOIIn53\n3ZmF0P4oUfUTvw7cOTmVjF6sQFVdfuvtFUpUUAFCXvGBNKBrcOp1LaHPnwF9\nTPKdf5CloaiYfas+8XYaQPrHkueub0KANmOtuFp1AyJyvBsY6LbRLUx61Mnx\nBg6oP8VlFaf43ObYANxMd15BwXb/r7OVRjw5tlV8/4agDpPSkd7Nm/eibR3x\nX/0Z+4JWqOMes+ba6vAX+P8H8Zge4bng4rB70QqaRRDV3jTQjCo6tpJ+IwYw\nh+VMo0EUiR0NWaEDnuuX1InAzgENoGi/sFU0m4OOfN7rXi1ASq/xsBv/IQaa\nDgyyRBJ6IUs+iy6FDMhGQ6XCs/9xc7LXuDHWU2p+MzgKnYLTmAk5tqRObkH6\neMZl\r\n=SxqI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzfcshK3mNoGQzlo1nVCeLt3jCOeygUz1Zd8v+12vpigIhAIEkjPOBTGUWfdKCE7LnenuqGIJoyHPSsu5t9DPHU5gK"}]},"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-viber_0.7.18_1586323291258_0.6280850219513547"},"_hasShrinkwrap":false},"1.0.0-beta.23":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.23","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.16","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.23"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=8"},"gitHead":"5de733d62d61798bdb1d4b19b363bbe216b324e8","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.23","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-y2pB7xJpEjg2oi4DRLra1L6jGpWmiCwT2vFowKvho8Jqm/f0iFBJdlLXeV/Gg3eQtT7nO3AaLYOU8Slclj50XA==","shasum":"e1d1d3c1764329c8297efcf3cacf32082435afd4","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.23.tgz","fileCount":24,"unpackedSize":224736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewlXJCRA9TVsSAnZWagAAZfkP/2o6HM9VwAldkVbgMqHK\nRIhjZExvbUCoMg3eXVpNJ2wpePcoWerqosDg6im+U3k7UYP2IR+71MEpg141\n4No1iTFEY/snKOjytwGBX3xr0vSuzs0OUafGCYtpqKfDuKP6DS9RM3x6WvqQ\n/8oMfT/h3hrf3yMwPX0QcuehrkUQuQRNdHZ7UjgrDI9fGx5UYRfjhEku0C1N\nBPkYUv2wv+0m029qNyX3a6Z1bwv0E5Bd4gk7ywjfKl4VtaexjASmOSefacFS\nvi2BoiTx9LUZW9avltVD8ItlKvNIJfujzmqC51s/vqNyMMiuIXCZ4lTJEebP\n+X5lt6fHo5phLvrgZlcbs6Ja0vKL/KRMRnDWrA7UjTdH6tS0tB/qU8kEHy5U\n5NePmoR+833X+xn9cUj3zupt/IEeBvcFwC/pM8ahiyiNceH4lJKlgzv9obmq\naNBikKo7rWBKNeGiMz0AqI9B2bYp6YQtlUHMazvCGcd/MObgFx9XoecwZjfJ\nzEUko4YKMegWY7+rfg/d0oDCARj+DWDvNL21+8GC3dvjtsoKuDeLL/YX0hkP\ntvWcT30khti2lPRUjPUc7WQge5XMewsEehcpUj/8BgZv74/uTET5xskXszlP\nyBnhFlTFKEHWb7UJyfYygRm2q8Zv31Cx0d6bSaT2Y4m6mZFKaRJHpvFphkw6\nT56G\r\n=OlKH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLCf1bN0vc+P1rEVmyISX/Wu9mISTLXUEI9DW9ehZDuwIhAORDaY8EJXuiIf6LmexPaJDT4/iHCdXBR4iShqtL917r"}]},"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-viber_1.0.0-beta.23_1589794249307_0.2061091606069625"},"_hasShrinkwrap":false},"1.0.0-beta.24":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.24","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.24","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.24"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=10"},"gitHead":"18258941a920ed2aabf7b12f17e10e8c14238c15","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = ViberClient.connect(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = ViberClient.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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = ViberClient.connect({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.24","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-PFZRr16Q8euRXywklbon3aVFiGTy6Am2FeCloe1xOqRE75uwEwsnbTp+6QHVxo4XGSRbC4yEcWeg85wy+bgx0g==","shasum":"81f4b8663fc601564c58b099f9183208349561c4","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.24.tgz","fileCount":24,"unpackedSize":224737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4dEXCRA9TVsSAnZWagAA3g0P/jI34eaEPKtvmzf2SLJO\nOlUjRD/vOvh19RNu6zNERwIhAVXF5mtN0NG/YjDXyExdiL0qekIWdmk0tTXv\nlRKhLNf8oUWgaJiBPfBrHIk4HrTnqpi2mP3ZSnfz4cVdBZKUUm8tRdqbCkqi\nFNiwDYA0yVj0tisvT6nSuP5ZscmHxm1ZxbQySC9aqaiN5rYO9UuvLFlEJtq0\nugkqQIr2Ro4JEA4s9x3X9sZXncQPUyfmhIGKCNHAp+jU90tBrf0ryuRwjUvs\nQG6C3m6KK+1u8Tb58P9fPYbIqFaN0ltYBtxxC3ogDA2MgUNPw9hmULvM0ILI\nnRInSYI5EJ6DTXEWr6euQFX2NrEGen5KL/9YlF3oowINndEF5Dt5J7Hhkcqy\nZqgcp5qqIee57mlamM8np/arrA1N4DBz/43UWeMMsCn4FK4TaEydnXU979lC\n6qyWJY7ixadB7yBavtqPXw7lys8HFR0B3It/I4XQ84duEQyTEcxRxwXq504z\n544GOkKaRZ/ZbWY8cGzNm5A2kfq8MtCslY6zVKXmZnEsNG4QJZYuKGYX5apz\nDHIr41y/jXeXm3Z4Sm4RAyjIa22rKZjJgWabp8KOIF0vkA74szd8aYV/6RGd\nUiR93+SKyN6QYhipYFw+YekWGLlsvxRBwdnf7F+YF0Z7Ucyp33fzMmg3h0Rq\nlnpy\r\n=u+zD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxii0WStN49x32tLV9mW0rOIQWpMTJkmiqykpOAMEUCQIhAPyRUVfvz5rOt/FLMNCK0VknyuWrUAPokkc0fpetZeeQ"}]},"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-viber_1.0.0-beta.24_1591857430837_0.7840917731768717"},"_hasShrinkwrap":false},"1.0.0-beta.25":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.25","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.24","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.24","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=10"},"gitHead":"5cca124548cbd6d36cafbdfb3ce6856fd338dbe3","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = new ViberClient(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then(result => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then(info => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then(user => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then(status => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new ViberClient({\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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = new ViberClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.25","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.20.2/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-EHcZALnHnKNeLE2lSjXKgg+Q2bcyYAVMimRW0PrcolxlhWMZTlPdSgNdh403n/ED0trE6y6kQNVYhU31zCMXFQ==","shasum":"81c4da46e2465a69cb2e19d82c9477836cdd2215","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.25.tgz","fileCount":24,"unpackedSize":230148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4hXbCRA9TVsSAnZWagAADP0P/Rdcn7tYmEaMtm+Qj8za\n7dodgVTK7Un32GPo5rceWsXqDokHv+zKbkUkgSPJVz3U2gLmrtb3qtDBxvFG\n0ZmBRk022LsopUOWOEKJtIGzd3rNAsr5b9NWq0M7ZgAaH8+BGXtEuoUKWR4B\ntNk6nxoSvE6do6tXuU3ZRCoDk+vAV6HTXFUaxwoMGn6KDR64qS8MorqUUkBz\nfcRUX2P2gldDUsZhwYyF2bMKzvxuNyPPEB4Vo1ltuv12n5M8nZyyvGgQYy3o\n/3d1XSLvHNujIDgxQ37sYz65OS8UeZoAvXAD1SS30Fmt/6gknCe+6EwFotxs\n20oCnceaBWLzlCOiMoSvLvsPPSzVrGpuLITvktgL/BPprLfT8B7RhM512Pdb\nWtAhcVtUReBchkljyIiIg7k6uC3W68cC56VugZCmLv4TqzsdFAgro2pgv8wi\nHoRZ9EZjfMLRrgmvZnCY7hpRTaiuRkeF1BKgKQ0xyxq2scYJUbINPIY7eyJG\nhuE5skSRqje6jXKZK34KFnulVBWXSwGP7n1TFO8yBZbJWv4zXmUcjjG5Sbie\nK/G3JYDaKmvO7s51L2fm3HpP6+4IhxC345t5PPsyUZSIWgWBqkVK28TQ6k6r\njPiX6DLRXU0Sq8NQdUnijQLBGwHJH63fziE2tOKaGN78uERd9h6eu4zxhMBs\nodOZ\r\n=4poj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgH5DtWZThQW5DdcjomzV6hEd5BoO0nh09iiUQFkP1mAIgVc7F28qJd3XXfywFSfxSydg722xAtrP9VulA1AQWCBk="}]},"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-viber_1.0.0-beta.25_1591875034961_0.9409873623279359"},"_hasShrinkwrap":false},"1.0.0-beta.26":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.26","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.26","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.26","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=10"},"gitHead":"a22b819aad9b425d5d0d2bb45aada31f0ecee42e","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = new ViberClient(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then((info) => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then((user) => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then((status) => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new ViberClient({\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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = new ViberClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.26","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-kGOJfL1JhzfomeHpRmy7VB3Mj/q4d2FfhPdVNzaGGI++LjC9arxkA/1WBzhHTkEy5yI+KjfsI3pukLdW/kixqg==","shasum":"7b09c31cfb8379c0d8ba0abb92e57da6135ff634","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.26.tgz","fileCount":24,"unpackedSize":230158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6H01CRA9TVsSAnZWagAA4a8QAJF744pMVC2p3A4d93sm\nWcfsf8PCRQGdthJgHK4qEn6H2w3dP5LSi/jSjXoXXHB8YsDkKQkflGPWZ563\nMwnhzHDlbETW2dHUl5MHWug+uuxIf9wWAAhvHaXpNGS+0TeJwAqv6mipVRKU\nfTNAE66KjffXS/P+wtFvYZ6t0fFZueTsOlYsfQ7y6m+o5Lf8i7e/UH5sBhlB\ncTZuPKUqWeyTRITSp2BUIfw3t3pmquUnsNk3Fk/E/RM1v2mp670SGtVdFAkk\nN216Fxvtx6s9DchTD3aGIzf5x+nqKSBYe8RTrvIpE80QGtoxwRYLPZPd5Ccu\nbN2FRdPW+gc4+3eEoRk+V9CQgvboDIVnFH5kamRTraK//E2DIcvHD3e0pxVE\n7CMfbNZ63g8Lvjw1h5NNC2W7V0QoAuITM1a4AQprmT4SIKkmx+mzIvb6SQf/\nezhvOZryyAXGyA3by6yobkN/dEgPvZ5JZ7f+4a1irhnmRELJawY2URxip1CU\nXn7H4ZaZq4BIW1EOJgsMoj7JVJMK0qqAXN/pyxQ/Ah1ZLHbo1kYZq9e+KUXL\nil6jb+aoknY0qVsqdMm2ep95s2ofRmcW8IXVyUn7bkdBotZhm7HWnhCd/5yF\nTLE5s/EcSweRp+eqF5xX9vlge0yrJGWaVWhHJA2n/48NonCPzy+3J3ntVsie\nCZEM\r\n=hiKn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkckjEvlFzCEhdUNjcCa8yFN4N1NXiU355/0uK1SCGfAiEA7P8eYeMG7j+r816EyahTXFvsqm8zBGXSSb1kjaCurfk="}]},"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-viber_1.0.0-beta.26_1592294708619_0.15726431971813004"},"_hasShrinkwrap":false},"1.0.0-beta.27":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.27","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"axios":"^0.19.2","axios-error":"^1.0.0-beta.27","lodash":"^4.17.15","messaging-api-common":"^1.0.0-beta.26","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=10"},"gitHead":"38107f34a63c32cf0a1c7994c4c39a2d6034daa4","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = new ViberClient(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then((info) => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then((user) => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then((status) => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new ViberClient({\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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = new ViberClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.27","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-1k5aPpTV0OUUi6cMyIR0HFf2ek1TyYNaC0yxDkNt8SLCFikdmvfuY4mplfKX5EZ8NolEwvYUf2NMp4x27bgBlg==","shasum":"edf2cabd460389da92189f13192aa35aaf5a6601","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.27.tgz","fileCount":24,"unpackedSize":230158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8ZevCRA9TVsSAnZWagAAqH8P/1d4dOH9TFMqT5sYVEZ2\n5ONVMOc0AiYxDWQWz0eNYTWoQ+z95X1G6PnzqlvxoKY/86bIMPdew9dsG+s6\nkZG4xrQwPyW6LQz81+sXw8kAJKk7ovg5egEZSNt9k7DoAnrg3BZ2ofvh7+jn\nMD3Ih6dTYPdTDqflT2BYgl/8F4lIeNILtlMId1vJHoM7U852xH7DRpvDAaeQ\n9rSJXjMrWUnTRSrxuNpSFSMIw3UmUvTcBLyKfmKwsYazCqcQn1VK4WwwcETK\ntd+S4rTbhxclZbqBfuAlS9YEn2tvnLQL9Rm97TuTrx/z41wEzODQldXSZ/d6\niicHlkjgoGiVTnUkfnGOtr4nIfrsz0jEB9kR8i4MAJJygqWEqaiwQ9id8rnp\nRT1iUtJCLADguPalna2oeuRR3/r47G/p7d3HnieWNr978B1PpH0th6GcEYdH\nDXblWndapGxIVXzdfaxk5ktb2aGypByHm87pC3UJRc/beicJUlD9aky7GM0y\n591OLHpJex4ORHUCe/xOaF0vls10gTEv/CV9XBRZPNjHGNTe2E5AjFUieiHy\nhehpN24zFLmHx/SDSyIqLzNbAFAma6Fd+7hSlHc6ucNqBk5rvhT9q08ce/aY\n9hSrdFeLHhM/JR8OE0ssHGYq+B8VSMmbtfaFudKHrV9bBR4pDqlkXtB66mp8\nA65o\r\n=g8S6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWU4F6BzyCBm8RavC//vUNTfJlDbu2CVtMcvB52Cm3ywIhANu67gZVKf/tPLgTtJQNeMcY33+MY/Ef9IM16QF55pad"}]},"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-viber_1.0.0-beta.27_1592891310974_0.46012849661002764"},"_hasShrinkwrap":false},"1.0.0-beta.29":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.29","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","messaging-api-common":"^1.0.0-beta.29","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=10"},"gitHead":"3389b14efbdcaf968ed7476820edaaaa95da0772","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = new ViberClient(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then((info) => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then((user) => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then((status) => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new ViberClient({\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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = new ViberClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.29","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-YMk0gskhEuxBcnemSQFerSs7n0p7aY7yI4MMdk7y2nb9TxkKpiw4+3wOMz1KtZ5/4cYNvJRgfOINfH8HdNp3cA==","shasum":"9cbf886a68330a521f59f678ec4317f5c47b04e7","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.29.tgz","fileCount":24,"unpackedSize":230282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+W9ICRA9TVsSAnZWagAApboQAJjzSos2Hb/LG9IXHDzY\nF5KqzTwbKt7bIG5CPqozLb1AOvzj/wRu0/ATEF+7Xmy8QFZ/MGDI7pCn5Uef\nU5Fhu8iM81EGr9Vngpg/gd9FY/pIeuGAjJ9xcSIoUDkXy5YgxGv5zJ7X0/2e\nraon9d6GuPGsHJ7Y/B0mR/0U7HJlDzFRuGlnT8DoiZedQQ5kImkdNymD75Yu\njqSqTZd4FmZ3IIz1bH2ngklZ0yKkb4HZq+U9zTGpSBaJTJjeDIJTAbhhLUIv\n6u0BTkTV2wQkw6rNtjmJR8bA3lVsykPE7HArgopH4Em8Ymr0Y9XL1MeYtv6X\nVzThcpIPXi0Y1hSNf65iTBxJnac2OO2ppn7ykGwkpZRKls8GSah/sVM7OjPf\nvN+jRB6LwKzPTvDmXx5ZS3/Vha2Bg/bO5RgJ8XfmTkouDhQekvZaRAOERy3K\no4iNacMChUg9nGX8SMvv1tYJgvW4MWIUszWd4n+sZEZuSdpUFWdQdUBW/2/P\nPp0NI3QLnSNe2tzjRXAyxhrPya680v39Q3zpgsLeL8yFWu8T4pV63h2U81o1\nfj/nGgzVyZP/cHC2RIaT0DqlMdq/s51lgRdHj9WpLLNniCpgtfG5c1Gcmje0\nELRN3lTALWKdeTDlhyhTBhNh3I8DInnKl32pS2gRbxeDtrlIjqWiN0Uwua9l\nvEYH\r\n=MnsL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKORAF9GZ5Zmrim/FZCMS8/sPQNcFNe0jPgsGOfV92jAIhAImdZt0QhNN5TveueOXiyNJ0AhC8n580CMKmv2ZdcEKX"}]},"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-viber_1.0.0-beta.29_1593405255851_0.6216553723443667"},"_hasShrinkwrap":false},"1.0.0-beta.31":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.31","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","messaging-api-common":"^1.0.0-beta.29","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=10"},"gitHead":"ddc04126fec6d8e8815ca85a54750ea74e6d8f16","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = new ViberClient(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then((info) => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then((user) => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then((status) => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new ViberClient({\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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = new ViberClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.31","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-vskp93q+UZLJjL5DtiT44SuVcUepvUBrpDQUq22Jrionp0yTc0076RJCbUlCwYQEcKk3LrBBmRtYFnb8WTOdcA==","shasum":"95786b0db4321c0b27b690c031a2ad1f24fc4cdc","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.31.tgz","fileCount":24,"unpackedSize":230280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/AKxCRA9TVsSAnZWagAA6kgP/0kWVlt5h6sWONIN7tf2\nYgNkzlivIj3f8JonXHx0MiKH1PfK3vCi3K6cCTakPvv/01OEBR/3CYgOyDUl\nYWvshiSW8ZUrejIS+gcsddMHYd6VsBDVWbRLs4BJ6b9fBqJnqE3ff1xY0kpr\nU/JkKreYyVgFs9yIF2ClmlDoUxZTwnT5udThSxldL7/O3hm5L3Fipkf27+KG\nYQodAT9ncK193ROle2mFUk2cQINb1v93aDZ3k6WfmXpbgybS/oLKvuNcwCTC\n8USxp63OU0YFeXGgHUqRY1uB8huTJNasy/Uno5VSqUovHo2GO+SO48rn/nX2\nT3nx0gkI5adf5fp9cpYt0jO1AAC8GYDHe2Adtj4PQniC825tuI2O6KzlzlN7\n7hHW1rFJUYLVdkuSKjVC8lNodwhJX3dQVSipvALlKBdQ0MLvfKzp+ahAOdM2\nsPB9EHMMiAIIwP0Bf6ayVt3Tj+VoaeCMKeMs2ixR/c6KUiuITggewloMfSPl\nyMet0/m1S843PD/BnjKJO6aaL//qeKXBqB8UIX7FCkinf91tlmO5xIDN9RoT\nYUQ6Lomx8GoOrf6rUf4JNfkEpmNS2empx00w23WThlZmCDBQ7R82scO1EW6C\n1dww57jfBqV0qxyfNDEy3LqbGypSLhCVWTkFInYGyAYEfSXaP3fM6GMQzGk3\nKvfI\r\n=78bb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+9h6IBvJgtuWCU9gkkuKMYI2LmQrD7YeKWzRzQKEo1wIhAIcaxiaBojE6VlLVXuXQiUfDssCDXUhd0HjtBxD4dE/X"}]},"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-viber_1.0.0-beta.31_1593574064676_0.6301689365545771"},"_hasShrinkwrap":false},"1.0.0-beta.33":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0-beta.33","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0-beta.27","messaging-api-common":"^1.0.0-beta.29","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"engines":{"node":">=10"},"gitHead":"a3f7afb4cef3784c3459f6be0810e0518b1bb384","readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Test](#test)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = new ViberClient(authToken);\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n## `setWebhook(url [, eventTypes])`\n\nSetting a Webhook.\n\n| Param      | Type            | Description                                                                                                                                                                                          |\n| ---------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| url        | `String`        | HTTPS Account webhook URL to receive callbacks & messages from users.                                                                                                                                |\n| eventTypes | `Array<String>` | Indicates the types of Viber events that the account owner would like to be notified about. Possible values: `delivered`, `seen`, `failed`, `subscribed`, `unsubscribed` and `conversation_started`. |\n\nExample:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/');\n```\n\nYou can filter event types using optional parameter:\n\n```js\nclient.setWebhook('https://4a16faff.ngrok.io/', [\n  'delivered',\n  'seen',\n  'conversation_started',\n]);\n```\n\n<br />\n\n## `removeWebhook`\n\nRemoving your webhook.\n\nExample:\n\n```js\nclient.removeWebhook();\n```\n\n<br />\n\n### Send API\n\n## `sendMessage(receiver, message)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#send-message)\n\nSending a message to a user.\n\n| Param    | Type     | Description                     |\n| -------- | -------- | ------------------------------- |\n| receiver | `String` | Unique Viber user id.           |\n| message  | `Object` | Message and options to be sent. |\n\nExample:\n\n```js\nclient.sendMessage(USER_ID, {\n  type: 'text',\n  text: 'Hello',\n});\n```\n\n> Note: Maximum total JSON size of the request is 30kb.\n\n<br />\n\n## `sendText(receiver, text [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#text-message)\n\nSending a text message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481925-61e46008-aeeb-11e7-842f-79fee8066c6a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| text     | `String` | The text of the message.   |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendText(USER_ID, 'Hello');\n```\n\n<br />\n\n## `sendPicture(receiver, picture [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#picture-message)\n\nSending a picture message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481916-5ec6cdac-aeeb-11e7-878b-6c8c4211a760.jpg\" width=\"300\" />\n\n| Param             | Type     | Description                                                                                                                                                       |\n| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver          | `String` | Unique Viber user id.                                                                                                                                             |\n| picture           | `Object` |\n| picture.text      | `String` | Description of the photo. Can be an empty string if irrelevant. Max 120 characters.                                                                               |\n| picture.media     | `String` | URL of the image (JPEG). Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages. |\n| picture.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported.                                                         |\n| options           | `Object` | Other optional parameters.                                                                                                                                        |\n\nExample:\n\n```js\nclient.sendPicture(USER_ID, {\n  text: 'Photo description',\n  media: 'http://www.images.com/img.jpg',\n  thumbnail: 'http://www.images.com/thumb.jpg',\n});\n```\n\n<br />\n\n## `sendVideo(receiver, video [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#video-message)\n\nSending a video message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481918-5fa12074-aeeb-11e7-8287-830197d93b5b.jpg\" width=\"300\" />\n\n| Param           | Type     | Description                                                                                               |\n| --------------- | -------- | --------------------------------------------------------------------------------------------------------- |\n| receiver        | `String` | Unique Viber user id.                                                                                     |\n| video           | `Object` |\n| video.media     | `String` | URL of the video (MP4, H264). Max size 50 MB. Only MP4 and H264 are supported.                            |\n| video.size      | `Number` | Size of the video in bytes.                                                                               |\n| video.duration  | `Number` | Video duration in seconds; will be displayed to the receiver. Max 180 seconds.                            |\n| video.thumbnail | `String` | URL of a reduced size image (JPEG). Max size 100 kb. Recommended: 400x400. Only JPEG format is supported. |\n| options         | `Object` | Other optional parameters.                                                                                |\n\nExample:\n\n```js\nclient.sendVideo(USER_ID, {\n  media: 'http://www.images.com/video.mp4',\n  size: 10000,\n  thumbnail: 'http://www.images.com/thumb.jpg',\n  duration: 10,\n});\n```\n\n<br />\n\n## `sendFile(receiver, file [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#file-message)\n\nSending a file message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481919-600f437e-aeeb-11e7-9f13-7269a055cb86.jpg\" width=\"300\" />\n\n| Param          | Type     | Description                                                                                                                                                         |\n| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| receiver       | `String` | Unique Viber user id.                                                                                                                                               |\n| file           | `Object` |\n| file.media     | `String` | URL of the file. Max size 50 MB. See [forbidden file formats](https://developers.viber.com/docs/api/rest-bot-api/#forbiddenFileFormats) for unsupported file types. |\n| file.size      | `Number` | Size of the file in bytes.                                                                                                                                          |\n| file.file_name | `String` | Name of the file. File name should include extension. Max 256 characters (including file extension).                                                                |\n| options        | `Object` | Other optional parameters.                                                                                                                                          |\n\nExample:\n\n```js\nclient.sendFile(USER_ID, {\n  media: 'http://www.images.com/file.doc',\n  size: 10000,\n  file_name: 'name_of_file.doc',\n});\n```\n\n<br />\n\n## `sendContact(receiver, contact [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#contact-message)\n\nSending a contact message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481924-615ce8b2-aeeb-11e7-8425-2d3bfa115fc1.jpg\" width=\"300\" />\n\n| Param                | Type     | Description                                     |\n| -------------------- | -------- | ----------------------------------------------- |\n| receiver             | `String` | Unique Viber user id.                           |\n| contact              | `Object` |\n| contact.name         | `String` | Name of the contact. Max 28 characters.         |\n| contact.phone_number | `String` | Phone number of the contact. Max 18 characters. |\n| options              | `Object` | Other optional parameters.                      |\n\nExample:\n\n```js\nclient.sendContact(USER_ID, {\n  name: 'Itamar',\n  phone_number: '+972511123123',\n});\n```\n\n<br />\n\n## `sendLocation(receiver, location [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#location-message)\n\nSending a location message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481923-61199a9e-aeeb-11e7-8a25-e3813eceb25b.jpg\" width=\"300\" />\n\n| Param        | Type     | Description                            |\n| ------------ | -------- | -------------------------------------- |\n| receiver     | `String` | Unique Viber user id.                  |\n| location     | `Object` |\n| location.lat | `String` | Latitude (±90°) within valid ranges.   |\n| location.lon | `String` | Longitude (±180°) within valid ranges. |\n| options      | `Object` | Other optional parameters.             |\n\nExample:\n\n```js\nclient.sendLocation(USER_ID, {\n  lat: '37.7898',\n  lon: '-122.3942',\n});\n```\n\n<br />\n\n## `sendURL(receiver, url [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#url-message)\n\nSending an URL message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481921-6069f346-aeeb-11e7-97bf-83a17da0bc7a.jpg\" width=\"300\" />\n\n| Param    | Type     | Description                |\n| -------- | -------- | -------------------------- |\n| receiver | `String` | Unique Viber user id.      |\n| url      | `String` | URL. Max 2,000 characters. |\n| options  | `Object` | Other optional parameters. |\n\nExample:\n\n```js\nclient.sendURL(USER_ID, 'http://developers.viber.com');\n```\n\n<br />\n\n## `sendSticker(receiver, stickerId [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#sticker-message)\n\nSending a sticker message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481922-60c2c444-aeeb-11e7-8fc9-bce2e5d06c42.jpg\" width=\"300\" />\n\n| Param     | Type     | Description                                                                                                          |\n| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |\n| receiver  | `String` | Unique Viber user id.                                                                                                |\n| stickerId | `Number` | Unique Viber sticker ID. For examples visit the [sticker IDs](https://viber.github.io/docs/tools/sticker-ids/) page. |\n| options   | `Object` | Other optional parameters.                                                                                           |\n\nExample:\n\n```js\nclient.sendSticker(USER_ID, 46105);\n```\n\n<br />\n\n## `sendCarouselContent(receiver, richMedia [, options])` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#carousel-content-message)\n\nSending a carousel content message to a user.\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31481917-5f1b43b4-aeeb-11e7-8557-e25951d69b53.jpg\" width=\"300\" />\n\n| Param                         | Type            | Description                                                                              |\n| ----------------------------- | --------------- | ---------------------------------------------------------------------------------------- |\n| receiver                      | `String`        | Unique Viber user id.                                                                    |\n| richMedia.ButtonsGroupColumns | `Number`        | Number of columns per carousel content block. Default 6 columns. Possible values: 1 - 6. |\n| richMedia.ButtonsGroupRows    | `Number`        | Number of rows per carousel content block. Default 7 rows. Possible values: 1 - 7.       |\n| richMedia.Buttons             | `Array<Object>` | Array of buttons. Max of 6 _ ButtonsGroupColumns _ ButtonsGroupRows.                     |\n| options                       | `Object`        | Other optional parameters.                                                               |\n\nExample:\n\n```js\nclient.sendCarouselContent(USER_ID, {\n  Type: 'rich_media',\n  ButtonsGroupColumns: 6,\n  ButtonsGroupRows: 7,\n  BgColor: '#FFFFFF',\n  Buttons: [\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'http://html-test:8080/myweb/guy/assets/imageRMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        '<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>',\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n    {\n      Columns: 6,\n      Rows: 3,\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      Image: 'https://s16.postimg.org/wi8jx20wl/image_RMsmall2.png',\n    },\n    {\n      Columns: 6,\n      Rows: 2,\n      Text:\n        \"<font color=#323232><b>Hanes Men's Humor Graphic T-Shirt</b></font><font color=#777777><br>Hanes</font><font color=#6fc133>$10.99</font>\",\n      ActionType: 'open-url',\n      ActionBody: 'https://www.google.com',\n      TextSize: 'medium',\n      TextVAlign: 'middle',\n      TextHAlign: 'left',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#ffffff>Buy</font>',\n      TextSize: 'large',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n      Image: 'https://s14.postimg.org/4mmt4rw1t/Button.png',\n    },\n    {\n      Columns: 6,\n      Rows: 1,\n      ActionType: 'reply',\n      ActionBody: 'https://www.google.com',\n      Text: '<font color=#8367db>MORE DETAILS</font>',\n      TextSize: 'small',\n      TextVAlign: 'middle',\n      TextHAlign: 'middle',\n    },\n  ],\n});\n```\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    DefaultHeight: true,\n    BgColor: '#FFFFFF',\n    Buttons: [\n      {\n        Columns: 6,\n        Rows: 1,\n        BgColor: '#2db9b9',\n        BgMediaType: 'gif',\n        BgMedia: 'http://www.url.by/test.gif',\n        BgLoop: true,\n        ActionType: 'open-url',\n        ActionBody: 'www.tut.by',\n        Image: 'www.tut.by/img.jpg',\n        Text: 'Key text',\n        TextVAlign: 'middle',\n        TextHAlign: 'center',\n        TextOpacity: 60,\n        TextSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\nWhich in turn will look like this:\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- `broadcastMessage(broadcastList, message)`\n- `broadcastText(broadcastList, text [, options])`\n- `broadcastPicture(broadcastList, picture [, options])`\n- `broadcastVideo(broadcastList, video [, options])`\n- `broadcastFile(broadcastList, file [, options])`\n- `broadcastContact(broadcastList, contact [, options])`\n- `broadcastLocation(broadcastList, location [, options])`\n- `broadcastURL(broadcastList, url [, options])`\n- `broadcastSticker(broadcastList, stickerId [, options])`\n- `broadcastCarouselContent(broadcastList, richMedia [, options])`\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nclient\n  .broadcastText(\n    [\n      'pttm25kSGUo1919sBORWyA==',\n      '2yBSIsbzs7sSrh4oLm2hdQ==',\n      'EGAZ3SZRi6zW1D0uNYhQHg==',\n      'kBQYX9LrGyF5mm8JTxdmpw==',\n    ],\n    'a broadcast to everybody'\n  )\n  .then((result) => {\n    console.log(result);\n    // {\n    //   message_token: 40808912438712,\n    //   status: 0,\n    //   status_message: 'ok',\n    //   failed_list: [\n    //     {\n    //       receiver: 'pttm25kSGUo1919sBORWyA==',\n    //       status: 6,\n    //       status_message: 'Not subscribed',\n    //     },\n    //     {\n    //       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n    //       status: 5,\n    //       status_message: 'Not found',\n    //     },\n    //   ],\n    // }\n  });\n```\n\n<br />\n\n### Get Account Info\n\n## `getAccountInfo()` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-account-info)\n\nIt will fetch the account’s details as registered in Viber.\n\nExample:\n\n```js\nclient.getAccountInfo().then((info) => {\n  console.log(info);\n  // {\n  //   status: 0,\n  //   status_message: 'ok',\n  //   id: 'pa:75346594275468546724',\n  //   name: 'account name',\n  //   uri: 'accountUri',\n  //   icon: 'http://example.com',\n  //   background: 'http://example.com',\n  //   category: 'category',\n  //   subcategory: 'sub category',\n  //   location: {\n  //     lon: 0.1,\n  //     lat: 0.2,\n  //   },\n  //   country: 'UK',\n  //   webhook: 'https://my.site.com',\n  //   event_types: ['delivered', 'seen'],\n  //   subscribers_count: 35,\n  //   members: [\n  //     {\n  //       id: '01234567890A=',\n  //       name: 'my name',\n  //       avatar: 'http://example.com',\n  //       role: 'admin',\n  //     },\n  //   ],\n  // }\n});\n```\n\n<br />\n\n### Get User Details\n\n## `getUserDetails(id)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-user-details)\n\nIt will fetch the details of a specific Viber user based on his unique user ID.\n\n| Param | Type     | Description           |\n| ----- | -------- | --------------------- |\n| id    | `String` | Unique Viber user id. |\n\nExample:\n\n```js\nclient.getUserDetails('01234567890A=').then((user) => {\n  console.log(user);\n  // {\n  //   id: '01234567890A=',\n  //   name: 'John McClane',\n  //   avatar: 'http://avatar.example.com',\n  //   country: 'UK',\n  //   language: 'en',\n  //   primary_device_os: 'android 7.1',\n  //   api_version: 1,\n  //   viber_version: '6.5.0',\n  //   mcc: 1,\n  //   mnc: 1,\n  //   device_type: 'iPhone9,4',\n  // };\n});\n```\n\n<br />\n\n### Get Online\n\n## `getOnlineStatus(ids)` - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#get-online)\n\nIt will fetch the online status of a given subscribed account members.\n\n| Param | Type            | Description                                         |\n| ----- | --------------- | --------------------------------------------------- |\n| id    | `Array<String>` | Array of unique Viber user id. 100 ids per request. |\n\nExample:\n\n```js\nclient\n  .getOnlineStatus(['01234567890=', '01234567891=', '01234567893='])\n  .then((status) => {\n    console.log(status);\n    // [\n    //   {\n    //     id: '01234567890=',\n    //     online_status: 0,\n    //     online_status_message: 'online',\n    //   },\n    //   {\n    //     id: '01234567891=',\n    //     online_status: 1,\n    //     online_status_message: 'offline',\n    //     last_online: 1457764197627,\n    //   },\n    //   {\n    //     id: '01234567893=',\n    //     online_status: 3,\n    //     online_status_message: 'tryLater',\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-viber\n```\n\nIf you want to use custom request logging function, just define your own `onRequest`:\n\n```js\nconst client = new ViberClient({\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 Viber server, specify `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = new ViberClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on production server.\n\n### Manual Mock with [Jest](https://facebook.github.io/jest/)\n\ncreate `__mocks__/messaging-api-viber.js` in your project root:\n\n```js\n// __mocks__/messaging-api-viber.js\nconst jestMock = require('jest-mock');\nconst { ViberClient } = require.requireActual('messaging-api-viber');\n\nmodule.exports = {\n  ViberClient: {\n    connect: jest.fn(() => {\n      const Mock = jestMock.generateFromMetadata(\n        jestMock.getMetadata(ViberClient)\n      );\n      return new Mock();\n    }),\n  },\n};\n```\n\nThen, mock `messaging-api-viber` package in your tests:\n\n```js\n// __tests__/mytest.spec.js\njest.mock('messaging-api-viber');\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-viber@1.0.0-beta.33","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-cGxVaHjyXsHDtiHzgzuqYT4IvoTZ7JvlNzQK+7h1J6k3niyb1UQwjd8uC1dcpB86nO9/P98c7OarkY+TbAk0QA==","shasum":"7a9f1cfffe99f32b23f60a4f24daf5121bc7228a","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0-beta.33.tgz","fileCount":24,"unpackedSize":229419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfF9/DCRA9TVsSAnZWagAAknoP/RrCSI+ETmKzJXT0yuIe\naRU51cAUknVTd5Nw1eP80Jx/wmKCC6MctYHzA0h55ZKVC6eOzm6gTiBKnOVv\ngfccIBYEI14Y2oHjzTminwoHSraWsAtaIzASYUS685Si4a4Zc0kVxTbvuFn+\nhM9C6tGa+uxEWoqyTFrFjleQoro1e9/Pw795tCD1GP8752f3E4e3TgvV/tcn\nuzNYJgpfEwPrINdLC3Idu/Shc894hM6UTld4gCLhcznR6Atk0ITXg2d7hihv\nfXaFHIx25eQsXUwnyaOYBKKmKv64nIgpu4YJK8txJiPX5nhqdU4XTmNYD1s0\nVkXt25RMTSx6XGWCjY2KmRAj7LKq0K5rbRI0DJNGe1rSGlqfcXPFwHpqkQI7\nruD206+kspQ4ehZaJTp0K8GOgEK65sA6itS0T1xzG7VVjqZBCObwKA2vRtCz\ncsNXYwaFM1QJidigMMvkXOKAaQJcnZLaMd2yRGtqOd0kYFNu1Pd6OpD7LiHG\nocQ7EwWn8TFBv8YB68RKVXZzu9Hdi4oxeh6BUmuMP/1ct4KO8JTQBCDfY8sY\nfQt/Px1Lg4jq1j7vcObmL3D6UqRss5+4s7eSBkh6vxPkbL6mKzhxySy1Ruge\nhcGtSqBMeMhrjyt88r2vQbOyVGW3+Wepskp9JBRU5XxfNzYwptxzL4+KB92P\nSbcI\r\n=LzEo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvJG46w5/atnl3J4utBitAbixW56DunvwCYN7NMxZSwgIgevsaxpBnvmnFdb8hNrmXkaLa76d63AkRzEAMEm7BCfU="}]},"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-viber_1.0.0-beta.33_1595400131063_0.21212125801507464"},"_hasShrinkwrap":false},"1.0.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@1.0.0","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-VO+gsQkDgFF2XnjGXLAOh3UBtCuMPx92GcKXqJJON6ADL7Bu6jGzntAg78Lva8uoK7P5dVE5cucZK24fu/dgLg==","shasum":"78fd7afe56e9cd54d1f52f30529c6f8f6f2c183c","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.0.tgz","fileCount":24,"unpackedSize":294069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVfVcCRA9TVsSAnZWagAAk7oQAJwrBwlCAn9oDl9EIbSd\nxQnjMQpVBwVSxvywOXrdD9kKQvzjnlbZZAeyS1v2nh98xlJFnJtOWw2m7rce\nkX/RA/zbjjPeLI/87ySBGDYOi69WKVdwvbOEPfWZ+xOlbtAAMBsb3qwdeqO+\nM0qv1nLAmU2hQyG1hOdJeo/YaAPUjuY7NBUQPDlATdk9DvVtsU7KDQ8c0ttc\nsk0BViWh3URins4GvOWAJgf5eTtilgE7ANXYbV32DtFDDgEXTWcraAGgdTbG\ncKCKTTm+98JqJZiFcqO6N522u1ZSK1Q2CCO4ZcrAljJR6gqZcXCJ+euYXS33\nNgE8fegh7dOkQEBX4tpDLoXGpV1+a9tcmaRanOPtIM6xPKw2+kvyhT0Z5lRO\n4Kd4BRLraksgemI4USdE/1zHaWA6FwnbLVIa3uU1GB/6AVmbA1GSPFv/Z5ey\naNreIAbNwhe/4JJ1ZGzCTwbic96rpjibLmV3k/umHhg/bI8e9e/Rc3q3iUdg\ngJLacStCDXFstRkiPosWNVoDU8TuyfjD8KttjghNVkf7QCYynLVTnCkcFyj5\nLH01QzhU6FV18OU0jFOy2aIK2NA8puCa8301upvg3m/ruKxBNFBbHfycheY3\nBAHlPAE2TmplE+igqBtDkBeTEzCu+0Dgzfg1fag9eRo6fJ4wI/oGJGaU83oJ\ne6jA\r\n=d+AG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIADWDUXJQdeYbrzq2sM3WraUU1kf6K50jc3qGTtVjXsqAiEArCFZ2LAF0LY5ubfcDnnQd6+TA5Ff4NptVoJUx84VOA8="}]},"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-viber_1.0.0_1599468892216_0.674047403004336"},"_hasShrinkwrap":false},"1.0.1":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.1","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.19.2","axios-error":"^1.0.0","messaging-api-common":"^1.0.0","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@1.0.1","_nodeVersion":"13.8.0","_npmVersion":"lerna/3.22.1/node@v13.8.0+x64 (darwin)","dist":{"integrity":"sha512-rcSOzMFiZ66nTejR9f0Rc9cRJqomcEqq9An8sfdpkk2WK/n6cxT+Y5GQZCbpNKjdr/TYB9Er6iox94JrdIpkDg==","shasum":"a2fbc2fea18e5de313c47f953f6f19911e603562","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.1.tgz","fileCount":24,"unpackedSize":293252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaFDdCRA9TVsSAnZWagAAFZ8P/A8hKFBXFy2WPl64YMAY\ny2wnRaCuEDUDNwojySKiS4P51cpQNBwJV0K50l6GL2hMUvxWjhJ1UYpBJCD0\nVoY1r//fJMtxZDhLsY8eAJGGW8OFCL1m5gUlWzyVqiJHdScMEFrWAqyb71dU\n1j3/7ERjF286Cv91JY5G9gMIOWG1uOkI3pq5uJURkFSsLZmCnTRoDcKLdAvD\nOMuCSSZLwtkmWafumpcOAhnrwH5HK+03QSpKw4W5qK9nWS+4bQZvyizsR594\n5uaOC1dmnU2Tl+ykQQUpCk2eFbyuxbhlpcZks0Zunz0gGvf+cRCP8Dv6XH1U\nL2Dg2yQKmSGsQsDDmUo/zIg8X+50hjolQddG956EEGZuWzqg4GLyZSptElia\nzeBYnb33t7PbXTF7MOpBCnMbsXPpSQZNnyQYAgoRBaMI5iOZc3EZu3AN5sis\nY08Bev+VnSG2GI89hUh0VhHb67B1X6OzVz/XbeEIS/+XZPubeVbIpA/LYGuH\nr3wH8nSV33O+ptr37xkhp5oyOR0rpfYtZsm7u4jKbIKWJeSleNa1FTjY3kzw\ngY1ms0XnlO8kXG+q9DCFVTutIKmSoM+s/ExKFpjkJwVGdME0GdGztu4ifA1a\nEca4SAkBfq8pA3ABuAMlHrmICP0iOtnp6opefJJXh/0OHUTidJE8JlfTrBu6\nvuOQ\r\n=bSuM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa/kXW4ZOHybB7zxbhoYhJL1TCDVY9cKr6M01cWk2iZwIhAOJR9K8kaAF6C3JgAcRLfCVCZIV9WaMKGp/Vf9IDV27k"}]},"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-viber_1.0.1_1600671964762_0.2672332433222715"},"_hasShrinkwrap":false},"1.0.4":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.4","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.21.1","axios-error":"^1.0.4","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@1.0.4","_nodeVersion":"14.15.0","_npmVersion":"lerna/3.22.1/node@v14.15.0+x64 (darwin)","dist":{"integrity":"sha512-x9nKPpno8pW1+BczFOh6JC7ihnLlDITgOlEFRj+d8wQWVbrLm6Gp00D4Ke8TnjoOTOcgXi8b88E/jHo+9xmwYA==","shasum":"9786ad1c94ba6e4a33797b2c7d462edef7a0d031","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.4.tgz","fileCount":24,"unpackedSize":293252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf++q8CRA9TVsSAnZWagAAy8AP/1cxWF8OUSYK8Sxr+hps\nuqmLGHlm72cZLBfB+wWlnS28HfMgpHsPgw+acG0zfqFUhKGsjrWwKe61JVj6\nMwIpstSkm3ZMXzwNzg8hzmzdC2GBGF+iPyAzEZqVS/YLG92heQTIMCM4Ao2a\nrJndwM5Le8Nomz854n+GA8V37B/iB6fEtd9AuTPxBIwLMm9ak43jozSJUabL\nh64rW93PGQrraEGUpcUKb0tnpxoEmVWyshXHAec7sWX23GePGIZVqcyQvdpT\nBc1173uxdnnLaaKsUeoIx07CHwL7H/MXphV8jRfmSOXyiNDdlHPZYJxmWQmQ\nyzCEOLkiEypBMiFOnxORIO6WAMvd6xfxwzAU3NRhjHXICm5MicqpbvZkLxW5\nnphvtGvJPF92NWCrSsRNGbU9Pklz7sUeFlLqFSWE6W1qC7i0X688vmQCByeh\nDcF6ClsxzNrpUHfdCku3a+P4oaxo2Ygw5mVEUAt6I2QSFpFUjpBQvOrePO4h\nF9smJm2c/oQwcBzzGC8caHEAx1xqcVKos01EI+nTlRYAdLitHEKaMUo1EbYR\nAg678xPIsI/jc4VzwovNcLjG+Ow38PdKv5KXIuixJTLMi6FY6ir6ySCI5Ky1\n4t65ewcoklSlmUZEbOteodWDifdKnXoSHfShgIUZyNcAraLWk9WqJN0R/Tf+\nNaBW\r\n=gLkC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHk6VvsNSqwVS2i4Cx3v7/NgSjsTRG6cQVNb8WbP3GfAiBPCrjpu6DbJhq2jST0mRwLlEf7eT26OnUaJIuMF01dTQ=="}]},"_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-viber_1.0.4_1610345147926_0.461938418434803"},"_hasShrinkwrap":false},"1.0.6":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.0.6","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.21.1","axios-error":"^1.0.4","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@1.0.6","_nodeVersion":"14.17.5","_npmVersion":"lerna/3.22.1/node@v14.17.5+x64 (darwin)","dist":{"integrity":"sha512-e2U72f5L8bPcubRfX4V1mRbL0d/sdxBxpbptNv3gV70K1diSv2kPXWfiDziMojYQ/Ob66SMR4354iHlm8qWXaw==","shasum":"d796a5cc78750e6c9e86fb7d463013ea00664bee","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.0.6.tgz","fileCount":24,"unpackedSize":293392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMQrbCRA9TVsSAnZWagAA+loP/1LlxP0s86nWjbCIjzeP\n3XL2LD+1ufDPtvxM3ascS603mzwY/rJSJ4MZ8yJ+BrntDuKYDUTcfKBpghh6\nS7oaJtj26vrxmfLRWiK/otcW9xrDEzRuMkNGClLPuszUvWEZM0+vqAv2Av1N\nCjdwvqsMCWSXAigJLI5DJqPd7CNPmoUeEXrD3Yg2wik1oq0Qp7t4U6wcNi7/\n45Te9UrCPBN5GkbjS78pvwFGLwznQj32WNYHS6veECGmmBYLddWBscm3HkGH\n4dpzMWF9uY9EeYY5P1FZ2ycogxHzroYIUqFXSp0SBhYD/g8kMg0zbsWZAI1d\nQXsz09ua9pMahchqcEjDiHBrBjy49fn2M0I3wru8kw1YgXu7Et6hgsrfoL8l\n8ppVf/rx5/Mii2q6iG96bSLAZNgEM0KVpiePSrJBMUOHUF7HyL9u19SjQh+Z\nxFIGzuZSA/eNB8MDpqdvUeJCcVTS/ze044Vlh7m/g2t6MmilngOdVidotwvn\nL2y/Z1PGKZEBqOiz2PDvwbduoxJkGUO597VIXDIyyUhGwgkQCZY+EsvVZYIU\nq9bzxWw1rV03QqIHQjYdCLQ6/vTvU5tEPQKo5MbMfvg6T2T61pn5x2zfv36i\nF/2CEEbQfzq5XV7jw/CJeaSWsn5ZJ/J14Fo9blFsdHB4F6S6iUNFocqMweSg\nIWeE\r\n=owjU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRnYrW2wsBVnhmFvQ1U/rsLntlU4R0yOPye9PyPdjX2AIgBhQZaJbbXMfOxb41DbOV4cy4i5CImXN4Va9AD50QP24="}]},"_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-viber_1.0.6_1630603995051_0.4984428866503916"},"_hasShrinkwrap":false},"1.1.0":{"name":"messaging-api-viber","description":"Messaging API client for Viber","license":"MIT","repository":{"type":"git","url":"git+https://github.com/Yoctol/messaging-apis.git"},"version":"1.1.0","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@types/warning":"^3.0.0","axios":"^0.21.1","axios-error":"^1.0.4","messaging-api-common":"^1.0.4","ts-invariant":"^0.4.4","warning":"^4.0.3"},"keywords":["bot","chatbot","messaging-apis","viber"],"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-viber@1.1.0","_nodeVersion":"14.17.5","_npmVersion":"lerna/4.0.0/node@v14.17.5+x64 (darwin)","dist":{"integrity":"sha512-h9XBFEjzRFD/opv4ZT0DwLWgMDcDZiQKQrL49uzqvyoFimh8d4r1srqRXhYtqMA7IDLwjxE6he4IvCxR+7VeLw==","shasum":"b46dad25bbd3a5ee487e865d18bffc623087aaaf","tarball":"https://registry.npmjs.org/messaging-api-viber/-/messaging-api-viber-1.1.0.tgz","fileCount":24,"unpackedSize":223901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2zF0CRA9TVsSAnZWagAAWrwP/j4YqcHO1ZM5kIZLOhXe\n1z97gtoxe38tsLnbyVy6j4Oy9+9SxxhgfDEZTSFCvBu9E8FdRFigxBmAGMmo\n4hD0CgIwqUN3xnxivQC0u7NYZxmUhsHi/14y8krjwP/9O/Aa6+QN0S5bowqS\nOcjrcadJbUHKfoAVKFCA5+v6+Zjq075lOn8a9qnXL7Gx1wvGv9KN2oX8Q1/V\ntUefAq+urHwwviohLOIpU2blF86YjMH3+ma+KEgoMjZW8l1ACRtsKa5dicqB\nQAWl8AZvu/Mk2Vh3Wa16NGJ7lYisCnE0ETAOTXqltUXgh3yuhXZZSpP0GYET\nL4/qmf8NRZyXg/2fstw8L9cjJO74u2ppybl90MwVWssdAYOri6ec1qTdB0y8\nAsQtxczlbnPXWF4mC968TuP0tX9ovToD4rIdxiGGndqGgqU6Zwt6qJFpQGb6\nzaLNRbM/QYbHglgD8IvUyiPu3MyWX0JUft1LBcm4KBT0xMuzMkvc/Lhfkzwj\nGvu9Mbdr2TIK6Zaz4kPKRXPuLFG1yC8HF5TjwZ+aGAoyjxExGUeOjG8k+r5+\nqRygPfvV5wgzWRrVJsaL5vCCwHTmbTutyimDDMewrkfM+LVYFV+HWPiC5e8I\np1MGguFrA6FCt9+bCnV7/Wcu02vjannrOPdQY4pB0/2DtFrWf4Y3clWnW+qp\ne07E\r\n=X8Sr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4Ti9W1PmpA5F+7IAwWCTwupwPoW+W1rLyvgRbKdBjDAiAf8wTM91b1XLf/qsOzdexm3YQJuwRKbhKh+d6xj39/9A=="}]},"_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-viber_1.1.0_1633326871541_0.0674400666029491"},"_hasShrinkwrap":false}},"readme":"# messaging-api-viber\n\n> Messaging API client for Viber\n\n<img src=\"https://user-images.githubusercontent.com/3382565/31753411-0be75dfc-b456-11e7-9eea-b976d21fcc53.png\" alt=\"Viber\" width=\"150\" />\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n  - [Webhook API](#webhook-api)\n  - [Send API](#send-api)\n  - [Keyboards](#keyboards)\n  - [Broadcast API](#broadcast-api)\n  - [Get Account Info](#get-account-info)\n  - [Get User Details](#get-user-details)\n  - [Get Online](#get-online)\n- [Debug Tips](#debug-tips)\n- [Testing](#testing)\n\n## Installation\n\n```sh\nnpm i --save messaging-api-viber\n```\n\nor\n\n```sh\nyarn add messaging-api-viber\n```\n\n<br />\n\n## Usage\n\n### Initialize\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\n// get authToken from the \"edit info\" screen of your Public Account.\nconst client = new ViberClient({\n  accessToken: authToken,\n  sender: {\n    name: 'Sender',\n  },\n});\n```\n\n### Error Handling\n\n`messaging-api-viber` 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.setWebhook(url).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### Webhook API\n\n- [setWebhook](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#setwebhook)\n- [removeWebhook](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#removewebhook)\n\n<br />\n\n### Send API\n\n- [sendMessage](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendmessage)\n- [sendText](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendtext)\n- [sendPicture](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendpicture)\n- [sendVideo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendvideo)\n- [sendFile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendfile)\n- [sendContact](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendcontact)\n- [sendLocation](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendlocation)\n- [sendURL](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendurl)\n- [sendSticker](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendsticker)\n- [sendCarouselContent](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#sendcarouselcontent)\n\n<br />\n\n<a id=\"keyboards\" />\n\n### Keyboards - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#keyboards)\n\nThe Viber API allows sending a custom keyboard using the send_message API, to supply the user with a set of predefined replies or actions. Keyboards can be attached to any message type and be sent and displayed together. To attach a keyboard to a message simply add the keyboard’s parameters to the options:\n\n```js\nclient.sendText(USER_ID, 'Hello', {\n  keyboard: {\n    type: 'keyboard',\n    defaultHeight: true,\n    bgColor: '#FFFFFF',\n    buttons: [\n      {\n        columns: 6,\n        rows: 1,\n        bgColor: '#2db9b9',\n        bgMediaType: 'gif',\n        bgMedia: 'http://www.url.by/test.gif',\n        bgLoop: true,\n        actionType: 'open-url',\n        actionBody: 'www.tut.by',\n        image: 'www.tut.by/img.jpg',\n        text: 'Key text',\n        textVAlign: 'middle',\n        textHAlign: 'center',\n        textOpacity: 60,\n        textSize: 'regular',\n      },\n    ],\n  },\n});\n```\n\n<img src=\"https://developers.viber.com/docs/img/example_keyboard.png\" width=\"300\" />\n\n<br />\n\n<a id=\"broadcast-api\" />\n\n### Broadcast API - [Official Docs](https://developers.viber.com/docs/api/rest-bot-api/#broadcast-message)\n\nThose API methods use the same parameters as the send methods with a few variations described below. You should specify a list of receivers instead of a single receiver.\n\n- [broadcastMessage](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcastmessage)\n- [broadcastText](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcasttext)\n- [broadcastPicture](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcastpicture)\n- [broadcastVideo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcastvideo)\n- [broadcastFile](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcastfile)\n- [broadcastContact](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcastcontact)\n- [broadcastLocation](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcastlocation)\n- [broadcastURL](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcasturl)\n- [broadcastSticker](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcaststicker)\n- [broadcastCarouselContent](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#broadcastcarouselcontent)\n\n| Param         | Type            | Description                                                                                                                                                        |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| broadcastList | `Array<String>` | This mandatory parameter defines the recipients for the message. Every user must be subscribed and have a valid user id. The maximum list length is 300 receivers. |\n\nExample:\n\n```js\nawait client.broadcastText(\n  [\n    'pttm25kSGUo1919sBORWyA==',\n    '2yBSIsbzs7sSrh4oLm2hdQ==',\n    'EGAZ3SZRi6zW1D0uNYhQHg==',\n    'kBQYX9LrGyF5mm8JTxdmpw==',\n  ],\n  'a broadcast to everybody'\n);\n// {\n//   messageToken: 40808912438712,\n//   status: 0,\n//   statusMessage: 'ok',\n//   failedList: [\n//     {\n//       receiver: 'pttm25kSGUo1919sBORWyA==',\n//       status: 6,\n//       statusMessage: 'Not subscribed',\n//     },\n//     {\n//       receiver: 'EGAZ3SZRi6zW1D0uNYhQHg==',\n//       status: 5,\n//       statusMessage: 'Not found',\n//     },\n//   ],\n// }\n```\n\n<br />\n\n### Get Account Info\n\n- [getAccountInfo](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#getaccountinfo)\n\n<br />\n\n### Get User Details\n\n- [getUserDetails](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#getuserdetails)\n\n<br />\n\n### Get Online\n\n- [getOnlineStatus](https://yoctol.github.io/messaging-apis/latest/classes/messaging_api_viber.viberclient-1.html#getonlinestatus)\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 ViberClient({\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 Viber server, specify the `origin` option when constructing your client:\n\n```js\nconst { ViberClient } = require('messaging-api-viber');\n\nconst client = new ViberClient({\n  accessToken: ACCESS_TOKEN,\n  origin: 'https://mydummytestserver.com',\n});\n```\n\n> Warning: Don't do this on your production server.\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:14.905Z","created":"2017-10-11T08:03:26.217Z","0.4.4":"2017-10-11T08:03:26.217Z","0.4.5":"2017-10-12T05:06:08.061Z","0.4.6":"2017-10-15T07:59:04.342Z","0.4.7":"2017-10-16T08:01:51.738Z","0.5.0-0":"2017-10-20T06:56:58.490Z","0.5.0":"2017-10-20T07:18:39.332Z","0.5.2":"2017-10-26T04:09:12.165Z","0.5.4":"2017-10-30T05:24:59.692Z","0.5.7":"2017-11-09T09:33:16.819Z","0.5.10":"2017-11-21T07:33:44.051Z","0.5.15":"2017-12-04T10:28:56.777Z","0.5.16":"2017-12-05T07:49:23.357Z","0.6.0":"2017-12-07T04:13:48.663Z","0.6.11":"2018-01-22T04:42:47.887Z","0.7.0-alpha.1":"2018-01-22T06:36:28.317Z","0.7.0-alpha.2":"2018-02-05T02:05:22.766Z","0.6.13":"2018-02-12T08:03:31.691Z","0.7.0-beta.1":"2018-03-26T08:59:29.296Z","0.7.0-beta.2":"2018-03-28T08:09:02.304Z","0.7.0-beta.3":"2018-04-02T06:27:04.579Z","0.7.0-beta.4":"2018-04-03T06:40:01.215Z","0.7.0-beta.5":"2018-04-03T09:39:38.877Z","0.7.0-rc.1":"2018-04-09T08:14:23.966Z","0.7.0-rc.2":"2018-04-17T04:20:01.854Z","0.7.0-rc.3":"2018-04-24T03:52:55.256Z","0.7.0":"2018-04-27T13:30:44.233Z","0.7.2":"2018-06-08T04:11:29.546Z","0.7.3":"2018-06-19T04:00:04.591Z","0.7.4":"2018-07-12T04:15:09.987Z","0.7.5":"2018-08-04T12:20:39.641Z","0.7.6":"2018-08-23T07:10:41.680Z","0.7.7":"2018-09-16T09:13:24.284Z","0.7.8":"2018-09-19T05:58:53.341Z","0.7.11":"2018-10-17T14:51:00.470Z","0.8.0":"2019-08-26T10:07:00.830Z","0.8.1":"2019-08-27T04:08:00.255Z","0.8.2":"2019-09-05T07:16:19.370Z","1.0.0-alpha.0":"2019-09-11T09:45:26.395Z","1.0.0-alpha.2":"2019-10-04T06:35:30.247Z","1.0.0-alpha.4":"2019-11-11T11:16:25.625Z","1.0.0-alpha.6":"2019-11-11T11:41:49.469Z","1.0.0-beta.0":"2019-11-14T07:19:27.692Z","1.0.0-beta.1":"2019-11-16T15:30:27.257Z","1.0.0-beta.2":"2019-11-19T05:55:00.212Z","1.0.0-beta.10":"2019-12-09T04:12:16.632Z","1.0.0-beta.16":"2020-04-06T14:32:21.699Z","0.7.17":"2020-04-08T05:14:39.297Z","0.7.18":"2020-04-08T05:21:31.389Z","1.0.0-beta.23":"2020-05-18T09:30:49.425Z","1.0.0-beta.24":"2020-06-11T06:37:11.029Z","1.0.0-beta.25":"2020-06-11T11:30:35.148Z","1.0.0-beta.26":"2020-06-16T08:05:08.767Z","1.0.0-beta.27":"2020-06-23T05:48:31.096Z","1.0.0-beta.29":"2020-06-29T04:34:15.991Z","1.0.0-beta.31":"2020-07-01T03:27:44.834Z","1.0.0-beta.33":"2020-07-22T06:42:11.282Z","1.0.0":"2020-09-07T08:54:52.438Z","1.0.1":"2020-09-21T07:06:05.390Z","1.0.4":"2021-01-11T06:05:48.099Z","1.0.6":"2021-09-02T17:33:15.181Z","1.1.0":"2021-10-04T05:54:31.714Z"},"keywords":["bot","chatbot","messaging-apis","viber"],"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"}}