Azure Document Translator client library for Java - version 1.0.0-beta.1

Microsoft Azure Cognitive Services Document Translator API enables you to translate documents in batch.

Source code | Package (Maven) | Product Documentation | Samples

Getting started

Prerequisites

For more information about creating the resource or how to get the location and sku information see here.

Include the Package

<dependency>
  <groupId>com.azure</groupId>
  <artifactId>azure-ai-documenttranslator</artifactId>
  <version>1.0.0-beta.1</version>
</dependency>

Authenticate the client

In order to interact with the Document Translator service, you'll need to create an instance of the BatchDocumentTranslationClient class. You will need an endpoint and an API key to instantiate a client object.

Get API Key

You can obtain the endpoint and API key from the resource information in the Azure Portal from your Document Translator resource. The endpoint is of format https://<NAME-OF-YOUR-RESOURCE>.cognitiveservices.azure.com.

Example
String endpoint = String.format("https://%s.cognitiveservices.azure.com/translator/text/batch/v1.0-preview.1",
    "<document-translator-resource-name>");
String apiKey = "<document-translator-api-key>";

BatchDocumentTranslationRestClient client = new BatchDocumentTranslationClientBuilder()
    .credential(new AzureKeyCredential(apiKey))
    .endpoint(endpoint)
    .httpClient(new NettyAsyncHttpClientBuilder().build())
    .buildRestClient();

Key concepts

Examples

More examples can be found in samples.

Troubleshooting

Enabling Logging

Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help locate the root issue. View the [logging][logging] wiki for guidance about enabling logging.

Next steps

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a [Contributor License Agreement (CLA)][cla] declaring that you have the right to, and actually do, grant us the rights to use your contribution.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments.

Impressions