Skip to content

Repository files navigation

dyspatch-java

Dyspatch API

  • API version: 2020.11

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.

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

Gradle users

Add this dependency to your project's build file:

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

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/dyspatch-java-7.0.0.jar
  • target/lib/*.jar

Getting Started

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

// Import classes:importio.dyspatch.client.ApiClient;
importio.dyspatch.client.ApiException;
importio.dyspatch.client.Configuration;
importio.dyspatch.client.auth.*;
importio.dyspatch.client.models.*;
importio.dyspatch.client.api.DraftsApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.dyspatch.io");
// Configure API key authorization: BearerApiKeyAuthBearer = (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");DraftsApiapiInstance = newDraftsApi(defaultClient);
StringdraftId = "draftId_example"; // String | A draft IDStringlanguageId = "languageId_example"; // String | A language ID (eg: en-US)Stringaccept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"try {
apiInstance.deleteLocalization(draftId, languageId, accept);
} catch (ApiExceptione) {
System.err.println("Exception when calling DraftsApi#deleteLocalization");
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://api.dyspatch.io

ClassMethodHTTP requestDescription
DraftsApideleteLocalizationDELETE /drafts/{draftId}/localizations/{languageId}Remove a localization
DraftsApigetDraftByIdGET /drafts/{draftId}Get Draft by ID
DraftsApigetDraftLocalizationKeysGET /drafts/{draftId}/localizationKeysGet localization keys
DraftsApigetDraftsGET /draftsList Drafts
DraftsApigetLocalizationForDraftGET /drafts/{draftId}/localizationsGet localizations on a draft
DraftsApisaveLocalizationPUT /drafts/{draftId}/localizations/{languageId}Create or update a localization
DraftsApisetTranslationPUT /drafts/{draftId}/localizations/{languageId}/translationsSet translations for language
DraftsApisubmitDraftForApprovalPOST /drafts/{draftId}/publishRequestSubmit the draft for approval
LocalizationsApigetLocalizationByIdGET /localizations/{localizationId}Get Localization Object by ID
TemplatesApigetTemplateByIdGET /templates/{templateId}Get Template by ID
TemplatesApigetTemplatesGET /templatesList Templates

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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages