0.0.7 • Published 2 years ago

blaggo-blackbox v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Blaggo Blackbox NodeJS Client SDK

Node.js CI

API Documentation

Getting Started

Installation

npm i blaggo-blackbox

Authentication

const blaggo = require("blaggo-blackbox");

// env can either be `test`, `stage`, or `prod`.
const options = {env: "test"};

// When `options` is not provided the `env` is considered `prod`
const res = await blaggo.Authenticate({
 client_id: "API client id",
 client_secret: "API client secret",
}, options);

console.log(res.data);

Blackbox Initialization

const blaggo = require("blaggo-blackbox");

// env can either be `test`, `stage`, or `prod`.
const options = {
 env: "test",
 credentials: {
  client_id: "API client id",
  client_secret: "API client secret",
 }
};

const blackbox = new blaggo.Blackbox(options);

Inbox Messages

  • Getting Inbox Messages

    // Other values for `status` can be found in the API docs.
    const unreads = await blackbox.getInboxMessages({status: "0"});
    console.log(unreads);
  • Updating an Inbox Message

    // Other values for `status` can be found in the API docs.
    const res = await blackbox.updateInboxMessage({
     id: "message id",
     status: "3",
    });
    
    console.log(res);
  • Sending Inbox Message

    // Although `sender_id` is required, the logged in user will automatically
    // as the sender of the message.
    const res = await blackbox.createPayload({
     sender_id: "blaggo user id",
     receiver_id: "blaggo user id",
     subject: "Test",
     body: "Test message",
    });
    
    console.log(res);

Subscription

  • Getting Pending Subscriptions

    // Other values for `status` can be found in the API docs.
    const res = await blackbox.querySubscribers({
     status: "pending",
    });
    
    console.log(res);
  • Updating Subscription

    const res = await blackbox.createPayload({
     aggregator_id: "blaggo biller id",
     customer_code: "QV2341TG",
     profile_id: "blaggo user id",
     status: "approved",
    });
    
    console.log(res);
0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago