Code Monkey home page Code Monkey logo

quiubas-java's Introduction

Quiubas Java Library

Library version: 1.4.1

Build Status Packagist Quiubas

Requirements

  • JDK 1.8+
  • JRE 1.8+
  • org.json library
  • apache.commons.codec library

Installation

Install java .jar file inside your libraries and then import the package with import com.quiubas.api.*;. Remember you can replace the * with any of the available Classes in case you require only a specific class for a specific endpoint.

Available classes:

  • Quiubas
  • Sms
  • Balance
  • Base
  • Network
  • TwoFactor
  • Mnp

Quickstart

//Imports
//The library package import
import com.quiubas.api.*;
//Others imports
import java.util.Map;
import java.util.HashMap;

public class MyApp {
    
    //Main
    public static void main(String[] args) {
        //Create an instance of the Quiubas class
        Quiubas Quiubas = new Quiubas();
        //Set the authentification information (API_KEY, API_SECRET)
        Quiubas.setAuth("YOUR_API_KEY", "YOUR_API_SECRET");
        //Lets create an example SMS, first create an instance of the Sms class
        Sms Sms = new Sms();
        //Then, we create a Map for the parameters
        Map<String, String> data = new HashMap<>();
        //Required parameters are "to_number" and "message"
        data.put("to_number", "PHONE_NUMBER");
        data.put("message", "Hello world");
        //Now, lets send it.
        try{
            //If we don't have errors, we get a response as a JSONObject, so
            //we can get, for example, the sms_id and print it
            System.out.println(Sms.send(data).getInt("id"));
        }catch(Exception e){
            //If we have errors, we show the error message
            System.out.println(e.getMessage());
        }
    }
    
}

quiubas-java's People

Contributors

asfo avatar pedroxs avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.