@adlanarifzr/macrokiosk-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

Macrokiosk (BOLD for SMS) unofficial SDK

This repository contains the open source Node.js client for Macrokiosk's API.

Installation

npm install @adlanarifzr/macrokiosk-sdk

Usage

Typescript with ES6 import (or .mjs with Node >= v13):

import Macrokiosk, { MessageType, SendMessageOptions, SendMessageResult } from '@adlanarifzr/macrokiosk-sdk';
const macrokiosk = new Macrokiosk('<USERNAME>', '<PASSWORD>', '<SENDER_ID>', '<SERVICE_ID>');

Send message:

// Options is optional
const options: SendMessageOptions = {
    type: MessageType.ASCII,
    showDetail: true,
};
const result: SendMessageResult = await macrokiosk.sendMessage(['<MOBILE_NUMBER>'], 'This is just a test', options);

// Result object:
{
  recipients: {
    '60123456789': {
      messageId: '24677783439',
      status: 200,
      description: 'Successful',
      currency: 'MYR',
      chargedAmount: 0.072
    }
  },
  remainingBalance: 0,
  totalRecipients: 1
}

Notes

Other than MessageType.ASCII, you would need to format/encode the message based on the documentation.

Package Sidebar

Install

npm i @adlanarifzr/macrokiosk-sdk

Weekly Downloads

8

Version

0.0.7

License

Unlicense

Unpacked Size

9.27 kB

Total Files

5

Last publish

Collaborators

  • adlanarifzr