You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/document-translation/how-to-guides/use-rest-api-programmatically.md
Document Translation is a cloud-based feature of the [Azure Translator](../../translator-overview.md) service. You can use the Document Translation API to asynchronously translate whole documents in [supported languages](../../language-support.md) and various [file formats](../overview.md#supported-document-formats) while preserving source document structure and text formatting. In this how-to guide, you'll learn to use Document Translation APIs with a programming language of your choice and the HTTP REST API.
19
+
Document Translation is a cloud-based feature of the [Azure Translator](../../translator-overview.md) service. You can use the Document Translation API to asynchronously translate whole documents in [supported languages](../../language-support.md) and various [file formats](../overview.md#supported-document-formats) while preserving source document structure and text formatting. In this how-to guide, you learn to use Document Translation APIs with a programming language of your choice and the HTTP REST API.
20
20
21
21
## Prerequisites
22
22
@@ -27,11 +27,11 @@ ms.custom: mode-other
27
27
> * Document Translation is **only** supported in the S1 Standard Service Plan (Pay-as-you-go) or in the D3 Volume Discount Plan. _See_[Cognitive Services pricing—Translator](https://azure.microsoft.com/pricing/details/cognitive-services/translator/).
28
28
>
29
29
30
-
To get started, you'll need:
30
+
To get started, you need:
31
31
32
32
* An active [**Azure account**](https://azure.microsoft.com/free/cognitive-services/). If you don't have one, you can [**create a free account**](https://azure.microsoft.com/free/).
33
33
34
-
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You'll create containers to store and organize your blob data within your storage account.
34
+
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You create containers to store and organize your blob data within your storage account.
35
35
36
36
* A [**single-service Translator resource**](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) (**not** a multi-service Cognitive Services resource):
37
37
@@ -84,16 +84,16 @@ Requests to the Translator service require a read-only key for authenticating ac
84
84
1. If you've created a new resource, after it deploys, select **Go to resource**. If you have an existing Document Translation resource, navigate directly to your resource page.
85
85
1. In the left rail, under *Resource Management*, select **Keys and Endpoint**.
86
86
1. Copy and paste your key in a convenient location, such as *Microsoft Notepad*.
87
-
1. You'll paste it into the code ample to authenticate your request to the Document Translation service.
87
+
1. You paste it into the code sample to authenticate your request to the Document Translation service.
88
88
89
89
:::image type="content" source="../../media/translator-keys.png" alt-text="Image of the get your key field in Azure portal.":::
90
90
91
91
## Create Azure blob storage containers
92
92
93
-
You'll need to [**create containers**](../../../../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) in your [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM) for source and target files.
93
+
You need to [**create containers**](../../../../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) in your [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM) for source and target files.
94
94
95
95
***Source container**. This container is where you upload your files for translation (required).
96
-
***Target container**. This container is where your translated files will be stored (required).
96
+
***Target container**. This container is where your translated files are stored (required).
97
97
98
98
> [!NOTE]
99
99
> Document Translation supports glossaries as blobs in target containers (not separate glossary containers). If want to include a custom glossary, add it to the target container and include the` glossaryUrl` with the request. If the translation language pair is not present in the glossary, it will not be applied. *See*[Translate documents using a custom glossary](#translate-documents-using-a-custom-glossary)
@@ -114,7 +114,7 @@ The `sourceUrl` , `targetUrl` , and optional `glossaryUrl` must include a Share
114
114
115
115
## HTTP requests
116
116
117
-
A batch Document Translation request is submitted to your Translator service endpoint via a POST request. If successful, the POST method returns a `202 Accepted` response code and the batch request is created by the service. The translated documents will be listed in your target container.
117
+
A batch Document Translation request is submitted to your Translator service endpoint via a POST request. If successful, the POST method returns a `202 Accepted` response code and the service creates a batch request. The translated documents are listed in your target container.
118
118
119
119
### HTTP headers
120
120
@@ -269,7 +269,7 @@ gradle init --type basic
269
269
270
270
* When prompted to choose a **DSL**, select **Kotlin**.
271
271
272
-
* Update the `build.gradle.kts` file. Keep in mind that you'll need to update your `mainClassName` depending on the sample:
272
+
* Update the `build.gradle.kts` file. Keep in mind that you need to update your `mainClassName` depending on the sample:
273
273
274
274
```java
275
275
plugins {
@@ -324,7 +324,7 @@ gradle run
324
324
325
325
#### Locating the `id` value
326
326
327
-
* You'll find the job `id` in the POST method response Header `Operation-Location` URL value. The last parameter of the URL is the operation's job **`id`**:
327
+
* You find the job `id` in the POST method response Header `Operation-Location` URL value. The last parameter of the URL is the operation's job **`id`**:
328
328
329
329
|**Response header**|**Result URL**|
330
330
|-----------------------|----------------|
@@ -1100,7 +1100,7 @@ func main() {
1100
1100
1101
1101
### Brief overview
1102
1102
1103
-
Cancelcurrentlyprocessingorqueuedjob. Onlydocumentsforwhichtranslationhasn't started will be canceled.
1103
+
Cancelcurrentlyprocessingorqueuedjob. Onlydocumentsforwhichtranslationhasn't started are canceled.
Try the latest version of Azure Translator. In this quickstart, you'll get started using the Translator service to [translate text](reference/v3-0-translate.md) using a programming language of your choice or the REST API. For this project, we recommend using the free pricing tier (F0), while you're learning the technology, and later upgrading to a paid tier for production.
24
+
Try the latest version of Azure Translator. In this quickstart, get started using the Translator service to [translate text](reference/v3-0-translate.md) using a programming language of your choice or the REST API. For this project, we recommend using the free pricing tier (F0), while you're learning the technology, and later upgrading to a paid tier for production.
25
25
26
26
## Prerequisites
27
27
28
-
To get started, you'll need an active Azure subscription. If you don't have an Azure subscription, you can [create one for free](https://azure.microsoft.com/free/cognitive-services/)
28
+
You need an active Azure subscription. If you don't have an Azure subscription, you can [create one for free](https://azure.microsoft.com/free/cognitive-services/)
29
29
30
30
* Once you have your Azure subscription, create a [Translator resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) in the Azure portal.
31
31
32
32
* After your resource deploys, select **Go to resource** and retrieve your key and endpoint.
33
33
34
-
* You need the key and endpoint from the resource to connect your application to the Translator service. You'll paste your key and endpoint into the code later in the quickstart. You can find these values on the Azure portal **Keys and Endpoint** page:
34
+
* You need the key and endpoint from the resource to connect your application to the Translator service. You paste your key and endpoint into the code later in the quickstart. You can find these values on the Azure portal **Keys and Endpoint** page:
35
35
36
36
:::image type="content" source="media/quickstarts/keys-and-endpoint-portal.png" alt-text="Screenshot: Azure portal keys and endpoint page.":::
37
37
@@ -50,7 +50,7 @@ To get started, you'll need an active Azure subscription. If you don't have an A
50
50
51
51
## Headers
52
52
53
-
To call the Translator service via the [REST API](reference/rest-api-guide.md), you'll need to include the following headers with each request. Don't worry, we'll include the headers for you in the sample code for each programming language.
53
+
To call the Translator service via the [REST API](reference/rest-api-guide.md), you need to include the following headers with each request. Don't worry, we include the headers for you in the sample code for each programming language.
54
54
55
55
For more information on Translator authentication options, _see_ the [Translator v3 reference](./reference/v3-0-reference.md#authentication) guide.
56
56
@@ -67,7 +67,7 @@ Header|Value| Condition |
67
67
68
68
## Translate text
69
69
70
-
The core operation of the Translator service is translating text. In this quickstart, you'll build a request using a programming language of your choice that takes a single source (`from`) and provides two outputs (`to`). Then we'll review some parameters that can be used to adjust both the request and the response.
70
+
The core operation of the Translator service is translating text. In this quickstart, you build a request using a programming language of your choice that takes a single source (`from`) and provides two outputs (`to`). Then we review some parameters that can be used to adjust both the request and the response.
71
71
72
72
### [C#: Visual Studio](#tab/csharp)
73
73
@@ -381,7 +381,7 @@ After a successful call, you should see the following response:
381
381
mkdir translator-text-app; cd translator-text-app
382
382
```
383
383
384
-
1. Run the `gradle init` command from the translator-text-app directory. This command will create essential build files for Gradle, including _build.gradle.kts_, which is used at runtime to create and configure your application.
384
+
1. Run the `gradle init` command from the translator-text-app directory. This command creates essential build files for Gradle, including _build.gradle.kts_, which is used at runtime to create and configure your application.
385
385
386
386
```console
387
387
gradle init --type basic
@@ -422,7 +422,7 @@ After a successful call, you should see the following response:
0 commit comments