Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

messageapi-im

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

messageapi-im

Send and receive messages from any chat app, using one API

  • 1.0.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

MessageAPI.im

The MessageAPI Node library provides convenient access to the MessageAPI API from applications written in server-side JavaScript.

Please keep in mind that this package is for use with server-side Node that uses MessageAPI App secret keys. To get your MessageAPI App secret you need to Sign up

Documentation

See the Node API docs.

Installation

Install the package with:

npm install messageapi-im --save

Usage

The package needs to be configured with your account's secret key which you will get after Sign up. Require it with the key's value:

var messageApiIm = require('messageapi-im')('[YOUR_APP_SECRET]');

Quick Start:

After sign up you need to complete these 3 steps to start sending messages

  1. Connect one or more of your messaging channels via the Create integration setup
  2. Create a webhook and get messages back from your customer, on top, via the webhook you will get message events like : delivered, seen , etc. To note you can skip this step and get the messages via get message
  3. Create a customer and add his user id in the relevant messaging channel

We have created this example using the Viber channel, to learn how to connect other channels, see the Node API docs.

Create Integration

messageApiIm.integrations.Create({
    "type": "viber",
    "auth_token": "[VIBER_AUTH_TOKEN]"
 }).then(function (result) {
    var integration = result.integration;
 });

Create a Webhook

messageApiIm.webhooks.Create({
    "webhook_url":"https://url.com"
}).then(function (result) {
    var webhook = result.webhook;
});

Create a Customer

messageApiIm.customers.Create({
    "viber": {"user_id": "[USER_ID_OF_VIBER]"}
}).then(function (result) {
    var customer = result.customer;
});

Send a Message

messageApiIm.messages.Send({
    "customer_id": "<customer_id>",
    "integration_id": "<integration_id>",
    "data": {
        "type": "text",
        "content": "your text"}
}).then(function (result) {
    var message = result.message;
});

More Information

See the Node API docs.

Keywords

FAQs

Package last updated on 02 Nov 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc