Dyspatch API
- API version: 2020.11
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.
Dyspatch provides API Clients for popular languages and web frameworks.
-
For more information, please visit https://docs.dyspatch.io
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.8+
- Maven/Gradle
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.
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>
Add this dependency to your project's build file:
compile "io.dyspatch:dyspatch-java:7.0.0"
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
Please follow the installation instruction and execute the following Java code:
// Import classes:
import io.dyspatch.client.ApiClient;
import io.dyspatch.client.ApiException;
import io.dyspatch.client.Configuration;
import io.dyspatch.client.auth.*;
import io.dyspatch.client.models.*;
import io.dyspatch.client.api.DraftsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.dyspatch.io");
// 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(defaultClient);
String draftId = "draftId_example"; // String | A draft ID
String languageId = "languageId_example"; // String | A language ID (eg: en-US)
String accept = "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 (ApiException e) {
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();
}
}
}
All URIs are relative to https://api.dyspatch.io
Class | Method | HTTP request | Description |
---|---|---|---|
DraftsApi | deleteLocalization | DELETE /drafts/{draftId}/localizations/{languageId} | Remove a localization |
DraftsApi | getDraftById | GET /drafts/{draftId} | Get Draft by ID |
DraftsApi | getDraftLocalizationKeys | GET /drafts/{draftId}/localizationKeys | Get localization keys |
DraftsApi | getDrafts | GET /drafts | List Drafts |
DraftsApi | getLocalizationForDraft | GET /drafts/{draftId}/localizations | Get localizations on a draft |
DraftsApi | saveLocalization | PUT /drafts/{draftId}/localizations/{languageId} | Create or update a localization |
DraftsApi | setTranslation | PUT /drafts/{draftId}/localizations/{languageId}/translations | Set translations for language |
DraftsApi | submitDraftForApproval | POST /drafts/{draftId}/publishRequest | Submit the draft for approval |
LocalizationsApi | getLocalizationById | GET /localizations/{localizationId} | Get Localization Object by ID |
TemplatesApi | getTemplateById | GET /templates/{templateId} | Get Template by ID |
TemplatesApi | getTemplates | GET /templates | List Templates |
- APIError
- CompiledRead
- Cursor
- DraftMetaRead
- DraftRead
- DraftsRead
- InlineObject
- LocalizationKeyRead
- LocalizationMetaRead
- LocalizationRead
- TemplateMetaRead
- TemplateRead
- TemplatesRead
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.