Socket
Socket
Sign inDemoInstall

quick-api-messenger

Package Overview
Dependencies
218
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

quick-api-messenger

Tự build chon bạn api gửi tin nhắn facebook một cách nhanh chóng . ## INSTALL + Cài đặt môi trường node js cho server của bạn : + Cài đặt package: ``` npm install --save quick-api-messenger ``` + Run code


Version published
Maintainers
1
Weekly downloads
1
decreased by-50%

Weekly downloads

Readme

Source

QUICK API MESSENGER

Tự build chon bạn api gửi tin nhắn facebook một cách nhanh chóng .

INSTALL

  • Cài đặt môi trường node js cho server của bạn :
  • Cài đặt package:
npm install --save quick-api-messenger
  • Run code
const api = require('../index');
api({
    email: "EMAIL",
    password: "PASS"
}, { /*
 //nếu sài webhook thì thêm
 webhook: 'http://localhost/trywebhook/' 
 */ });

CHẠY THÔI

PORT=1234 node server.js

Trong đó 1234 là port bạn muốn server listen.

Nếu login bị lỗi vui lòng tắt xác thực và accept login trên facebook.

HOW TO USE

Sau khi build thành công api sẽ lắng nghe request ở PORT bạn đặt.

GỬI TIN NHẮN

url: http://www.domain.com/sendMessage/?body=<nội dung>&target<ID người nhận>&attachment=<url ảnh hoặc âm thanh>&type<audio||image>

LISTEN WEBHOOK

Cấu hình url webhook như sau

const api = require('../index');
api({ email: "EMAIL", password: "PASS" }, { webhook: 'http://localhost/routerWebhook/' });

Server webhook demo (NODEJS);

const app = require('express')();
const bodyParser = require('body-parser');
const urlencodeParser = bodyParser.urlencoded({ extended: false })
const { PORT = 80 } = process.env;
app.listen(PORT, () => console.log('Listen in port', PORT));
app.post('/trywebhook', urlencodeParser, function (req, res) {
    console.log(req.body);
    res.end();
});

Thanks for used

Contributors

Trần ĐứcÝ
Trần Đức Cường (notekunn)

FAQs

Last updated on 14 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc