moceansdk 1.2.0
moceansdk: ^1.2.0

Dart native js
Flutter Android iOS web

SDK Library Dart to send SMS for FREE using MoceanAPI sms solution.

MoceanAPI Client Library for Dart #

Latest Stable Version Build Status codecov MIT license

This is the Dart library for use Mocean's API. To use this, you'll need a Mocean account. Sign up for free at moceanapi.com.

Installation #

To install the client

  • add moceansdk to your pubspec.yaml
  • run pub get

Usage #

Create a client with your API key and secret

import 'package:moceansdk/moceansdk.dart';

var mocean = Mocean(
  Basic('your api key', 'your api secret')
);

Available API #

mocean.balance.inquiry();       //Get Account Balance
mocean.pricing.inquiry();       //Get Account Pricing
mocean.sms.send();              //Send SMS
mocean.messageStatus.inquiry(); //Get Message Status
mocean.sendCode.send();         //Send Verify Code
mocean.verifyCode.send();       //Check Verify Code
mocean.numberLookup.inquiry();  //Number Lookup
mocean.voice.call();            //Voice

Example #

To use Mocean's SMS API to send an SMS message, call the mocean.sms.send() method.

The API can be called directly, using a simple array of parameters, the keys match the parameters of the API.

var res = await mocean.sms.send({
  'mocean-to': '60123456789',
  'mocean-text': 'hello world',
  'mocean-from': 'dart'
});

print(res);
*All calls will return Future object

Responses #

For your convenient, the API response has been parsed to Map

print(res);           // show full response string
print(res['status']); // show response status, '0' in this case

Documentation #

Kindly visit MoceanApi Docs for more usage

License #

This library is released under the MIT License

2
likes
80
pub points
49%
popularity

SDK Library Dart to send SMS for FREE using MoceanAPI sms solution.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

neosonlam.mocean@gmail.com

License

MIT (LICENSE.txt)

Dependencies

http

More

Packages that depend on moceansdk