8000 GitHub - blaggotech/nodejs-client-sdk: Blaggo blackbox nodejs client sdk
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

blaggotech/nodejs-client-sdk

Repository files navigation

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);

About

Blaggo blackbox nodejs client sdk

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0