Skip to content

phil-ma/dyspatch-java

 
 

Repository files navigation

Dyspatch API Client

Introduction

The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our Implementation Guide for more details on how to implement Dyspatch.

This Java package is automatically generated by the Swagger Codegen project:

  • API version: 2018.08
  • Package version: 1.0.0

For more information, please visit https://docs.dyspatch.io

Installation

via maven (preferred) Add the following to your pom.xml:

<!-- in the repositories section -->
<repository>
        <id>repo</id>
        <url>https://github.com/get-dyspatch/dyspatch-mvn/raw/master/releases</url>
</repository>

<!-- in the dependencies section -->
<dependency>
        <groupId>io.dyspatch</groupId>
        <artifactId>dyspatch-java</artifactId>
        <version>1.0.0</version>
</dependency>

via wget:

$ wget https://github.com/sendwithus/sendwithus-mvn-repo/raw/master/releases/com/sendwithus/java-client/2.1.1/java-client-2.1.1.jar

Getting Started

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

import io.dyspatch.client.*;
import io.dyspatch.client.auth.*;
import io.dyspatch.client.model.*;
import io.dyspatch.client.api.TemplatesApi;


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

        // Configure API key authorization: Bearer
        ApiKeyAuth Bearer = (ApiKeyAuth) defaultClient.getAuthentication("Bearer");
        Bearer.setApiKey("DYSPATCH_API_KEY");
        Bearer.setApiKeyPrefix("Bearer");

        TemplatesApi apiInstance = new TemplatesApi();
        String accept = "application/vnd.dyspatch.2018.08+json"; // String | A version of the API that should be used for the request. For example, to use version \"2018.08\", set the value to \"application/vnd.dyspatch.2018.08+json\"
        
        try {
            ApiResponse<TemplatesRead> result = apiInstance.templatesGetWithHttpInfo(accept, "");
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TemplatesApi#templatesGet");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.dyspatch.io

Class Method HTTP request Description
LocalizationsApi localizationsLocalizationIdGet GET /localizations/{localizationId} Get Localization Object by ID
TemplatesApi templatesGet GET /templates List Templates
TemplatesApi templatesTemplateIdGet GET /templates/{templateId} Get Template by ID

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Bearer

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Recommendation

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

Author

support@dyspatch.io

About

An OpenAPI generated Dyspatch client in Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.5%
  • Scala 0.5%