Skip to content

Latest commit

 

History

History
164 lines (114 loc) · 6.33 KB

README.md

File metadata and controls

164 lines (114 loc) · 6.33 KB

dyspatch-java

Dyspatch API

  • API version: 2019.10
    • Build date: 2019-11-19T10:21:29.886-08:00

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. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - Java - Javascript - Python - C# - Go - Ruby

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

Automatically generated by the Swagger Codegen

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>io.dyspatch</groupId>
  <artifactId>dyspatch-java</artifactId>
  <version>3.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "io.dyspatch:dyspatch-java:3.0.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/dyspatch-java-3.0.0.jar
  • target/lib/*.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.DraftsApi;

import java.io.File;
import java.util.*;

public class DraftsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: Bearer
        ApiKeyAuth Bearer = (ApiKeyAuth) defaultClient.getAuthentication("Bearer");
        Bearer.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //Bearer.setApiKeyPrefix("Token");

        DraftsApi apiInstance = new DraftsApi();
        String draftId = "draftId_example"; // String | A draft ID
        String targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates.
        try {
            DraftRead result = apiInstance.draftsDraftIdGet(draftId, targetLanguage);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DraftsApi#draftsDraftIdGet");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

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

Class Method HTTP request Description
DraftsApi draftsDraftIdGet GET /drafts/{draftId} Get Draft by ID
DraftsApi draftsDraftIdLocalizationKeysGet GET /drafts/{draftId}/localizationKeys Get localization keys
DraftsApi draftsDraftIdLocalizationsGet GET /drafts/{draftId}/localizations Get localizations on a draft
DraftsApi draftsDraftIdLocalizationsLanguageIdDelete DELETE /drafts/{draftId}/localizations/{languageId} Remove a localization
DraftsApi draftsDraftIdLocalizationsLanguageIdPut PUT /drafts/{draftId}/localizations/{languageId} Create or update a localization
DraftsApi draftsDraftIdLocalizationsLanguageIdTranslationsPut PUT /drafts/{draftId}/localizations/{languageId}/translations Set translations for language
DraftsApi draftsDraftIdPublishRequestPost POST /drafts/{draftId}/publishRequest Submit the draft for approval
DraftsApi draftsGet GET /drafts List Drafts
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

[email protected]