Coder Social home page Coder Social logo

messente-phonebook-java's Introduction

Messente Phonebook API

PhonebookApi - Java client for Messente Phonebook API

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.messente.phonebook</groupId>
  <artifactId>phonebook-java</artifactId>
  <version>0.2.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.messente.phonebook:phonebook-java:0.2.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/phonebook-java-0.2.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.messente.*;
import com.messente.auth.*;
import com.messente.phonebook.*;

public class BlacklistApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR_MESSENTE_API_USERNAME");
        basicAuth.setPassword("YOUR_MESSENTE_API_PASSWORD");

        BlacklistApi apiInstance = new BlacklistApi();

        try {
            FetchBlacklistSuccess response = apiInstance.fetchBlacklist();
            System.out.println(response);
        } catch (ApiException e) {
            System.err.println("Exception when calling fetchBlacklist");
            e.printStackTrace();
        }

//      try {
//          apiInstance.addToBlacklist(new NumberToBlacklist().phoneNumber("+37255555555"));
//      } catch (ApiException e) {
//          System.err.println("Exception when calling addToBlacklist");
//          e.printStackTrace();
//      }
//
//  try {
//      apiInstance.isBlacklisted("+37255555555");
//  } catch (ApiException e) {
//      System.err.println("Exception when calling isBlacklisted");
//      e.printStackTrace();
//  }
//
//      try {
//          apiInstance.removeFromBlacklist("+37255555555");
//      } catch (ApiException e) {
//          System.err.println("Exception when calling removeFromBlacklist");
//          e.printStackTrace();
//      }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.messente.com/v1

Class Method HTTP request
BlacklistApi addToBlacklist POST /phonebook/blacklist
BlacklistApi fetchBlacklist GET /phonebook/blacklist
BlacklistApi isBlacklisted GET /phonebook/blacklist/{phone_number}
BlacklistApi removeFromBlacklist DELETE /phonebook/blacklist/{phone_number}

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

[email protected]

messente-phonebook-java's People

Contributors

realerikrani avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.