Skip to content

Latest commit

 

History

History

README.md

emnify-api

EMnify Rest API

  • API version: 1.3

Rest API resources of the EMnify System.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  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.emnify.sdk</groupId>
  <artifactId>emnify-api</artifactId>
  <version>1.1.0-SNAPSHOT</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.emnify.sdk:emnify-api:1.1.0-SNAPSHOT"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/emnify-api-1.1.0-SNAPSHOT.jar
  • target/lib/*.jar

Getting Started

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

// Import classes:
import com.emnify.sdk.ApiClient;
import com.emnify.sdk.ApiException;
import com.emnify.sdk.Configuration;
import com.emnify.sdk.models.*;
import com.emnify.sdk.api.AuthenticationApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://cdn.emnify.net");

    AuthenticationApi apiInstance = new AuthenticationApi(defaultClient);
    Authentication authentication = new Authentication(); // Authentication | Authentication using Application Tokens or user/password combination
    try {
      AuthenticationResponse result = apiInstance.authenticate(authentication);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AuthenticationApi#authenticate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://cdn.emnify.net

Class Method HTTP request Description
AuthenticationApi authenticate POST /api/v1/authenticate Retrieve Authentication Token
EndpointApi createEndpoint POST /api/v1/endpoint Create Endpoint
EndpointApi deleteEndpointDataQuotaById DELETE /api/v1/endpoint/{endpoint_id}/quota/data Remove Data Quota
EndpointApi endpointQuotaDataByEndpointIdGet GET /api/v1/endpoint/{endpoint_id}/quota/data Retrieve Data Quota details
EndpointApi endpointQuotaDataByEndpointIdPost POST /api/v1/endpoint/{endpoint_id}/quota/data Set Data Quota
EndpointApi getEndpoints GET /api/v1/endpoint List Endpoints

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

bearerAuth

  • 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