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
|400|BadRequest|Arequiredparameterismissing, empty, or null. Or, the value passed to either a required or optional parameter is invalid. A common issue is a header that is too long. |
1255
+
| 401 | Unauthorized | The request is not authorized. Check to make sure your subscription key or token is valid and in the correct region. When managing your subscription on the Azureportal, pleaseensureyou'reusingthe **Translator** single-serviceresource_not_the **CognitiveServices** multi-serviceresource.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/quickstart-translator.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: translator-text
10
10
ms.topic: quickstart
11
-
ms.date: 09/14/2020
11
+
ms.date: 07/06/2021
12
12
ms.author: erhopf
13
13
ms.custom: cog-serv-seo-aug-2020
14
14
keywords: translator, translator service, translate text, transliterate text, language detection
@@ -28,8 +28,11 @@ In this quickstart, you learn to use the Translator service via REST. You start
28
28
29
29
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
30
30
* Once you have an Azure subscription, [create a Translator resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
31
-
* You'll 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 below later in the quickstart.
32
-
* You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.
31
+
* You'll 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 below later in the quickstart. You can find these values on the Azure portal **Keys and Endpoint** page:
32
+
33
+
:::image type="content" source="media/keys-and-endpoint-portal.png" alt-text="Screenshot: Azure portal keys and endpoint page.":::
34
+
35
+
* You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.
33
36
34
37
## Platform setup
35
38
@@ -2815,9 +2818,19 @@ After a successful call, you should see the following response. For more informa
2815
2818
2816
2819
## Troubleshooting
2817
2820
2821
+
### Common HTTP status codes
2822
+
2823
+
| HTTP status code | Description | Possible reason |
| 400 | Bad Request | A required parameter is missing, empty, or null. Or, the value passed to either a required or optional parameter is invalid. A common issue is a header that is too long. |
2827
+
| 401 | Unauthorized | The request is not authorized. Check to make sure your subscription key or token is valid and in the correct region. *See also*[Authentication](reference/v3-0-reference.md#authentication).|
2828
+
| 429 | Too Many Requests | You have exceeded the quota or rate of requests allowed for your subscription. |
2829
+
| 502 | Bad Gateway | Network or server-side issue. May also indicate invalid headers. |
2830
+
2818
2831
### Java users
2819
2832
2820
-
If you're encountering connection issues, it may be that your SSL certificate has expired. To resolve this issue, install the [DigiCertGlobalRootG2.crt](http://cacerts.digicert.com/DigiCertGlobalRootG2.crt) to your private store.
2833
+
If you're encountering connection issues, it may be that your SSL certificate has expired. To resolve this issue, install the [DigiCertGlobalRootG2.crt](http://cacerts.digicert.com/DigiCertGlobalRootG2.crt) to your private store.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/reference/v3-0-reference.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: translator-text
10
10
ms.topic: reference
11
-
ms.date: 8/11/2020
11
+
ms.date: 07/06/2021
12
12
ms.author: lajanuar
13
13
---
14
14
@@ -32,18 +32,18 @@ Microsoft Translator is served out of multiple datacenter locations. Currently t
32
32
***Asia Pacific:** Korea South, Japan East, Southeast Asia, and Australia East
33
33
***Europe:** North Europe, West Europe
34
34
35
-
Requests to the Microsoft Translator are in most cases handled by the datacenter that is closest to where the request originated. In case of a datacenter failure, the request may be routed outside of the geography.
35
+
Requests to the Microsoft Translator are in most cases handled by the datacenter that is closest to where the request originated. If there is a datacenter failure, the request may be routed outside of the geography.
36
36
37
37
To force the request to be handled by a specific geography, change the Global endpoint in the API request to the desired geographical endpoint:
<sup>1</sup> Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. To ensure that requests are handled in Switzerland, create the Translator resource in the ‘Resource region’ ‘Switzerland North’ or ‘Switzerland West’, then use the resource’s custom endpoint in your API requests. For example: If you create a Translator resource in Azure portal with ‘Resource region’ as ‘Switzerland North’ and your resource name is ‘my-ch-n’ then your custom endpoint is “https://my-ch-n.cognitiveservices.azure.com”. And a sample request to translate is:
46
+
<sup>1</sup> Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. To ensure that requests are handled in Switzerland, create the Translator resource in the ‘Resource region’ ‘Switzerland North’ or ‘Switzerland West’, then use the resource’s custom endpoint in your API requests. For example: If you create a Translator resource in Azure portal with ‘Resource region’ as ‘Switzerland North’ and your resource name is ‘my-ch-n’, then your custom endpoint is “https://my-ch-n.cognitiveservices.azure.com”. And a sample request to translate is:
47
47
```curl
48
48
// Pass secret key and region using headers to a custom endpoint
49
49
curl -X POST " my-ch-n.cognitiveservices.azure.com/translator/text/v3.0/translate?to=fr" \
@@ -90,7 +90,7 @@ curl -X POST "https://api.cognitive.microsofttranslator.com/translate?api-versio
90
90
#### Authenticating with a regional resource
91
91
92
92
When you use a [regional translator resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation).
93
-
There are 2 headers that you need to call the Translator.
93
+
There are two headers that you need to call the Translator.
94
94
95
95
|Headers|Description|
96
96
|:-----|:----|
@@ -112,7 +112,7 @@ curl -X POST "https://api.cognitive.microsofttranslator.com/translate?api-versio
112
112
113
113
When you use a Cognitive Service’s multi-service resource. This allows you to use a single secret key to authenticate requests for multiple services.
114
114
115
-
When you use a multi-service secret key, you must include two authentication headers with your request. There are 2 headers that you need to call the Translator.
115
+
When you use a multi-service secret key, you must include two authentication headers with your request. There are two headers that you need to call the Translator.
116
116
117
117
|Headers|Description|
118
118
|:-----|:----|
@@ -153,7 +153,7 @@ An authentication token is valid for 10 minutes. The token should be reused when
153
153
154
154
## Virtual Network support
155
155
156
-
The Translator service is now available with Virtual Network (VNET) capabilities in all regions of the Azure public cloud. To enable Virtual Network, please see[Configuring Azure Cognitive Services Virtual Networks](../../cognitive-services-virtual-networks.md?tabs=portal).
156
+
The Translator service is now available with Virtual Network (VNET) capabilities in all regions of the Azure public cloud. To enable Virtual Network, *See*[Configuring Azure Cognitive Services Virtual Networks](../../cognitive-services-virtual-networks.md?tabs=portal).
157
157
158
158
Once you turn on this capability, you must use the custom endpoint to call the Translator. You cannot use the global translator endpoint ("api.cognitive.microsofttranslator.com") and you cannot authenticate with an access token.
159
159
@@ -192,6 +192,7 @@ For example, a customer with a free trial subscription would receive the followi
192
192
}
193
193
}
194
194
```
195
+
195
196
The error code is a 6-digit number combining the 3-digit HTTP status code followed by a 3-digit number to further categorize the error. Common error codes are:
196
197
197
198
| Code | Description |
@@ -228,12 +229,12 @@ The error code is a 6-digit number combining the 3-digit HTTP status code follow
228
229
| 403000| The operation is not allowed.|
229
230
| 403001| The operation is not allowed because the subscription has exceeded its free quota.|
230
231
| 405000| The request method is not supported for the requested resource.|
231
-
| 408001| The translation system requested is being prepared. Please retry in a few minutes.|
232
+
| 408001| The translation system requested is being prepared. Retry in a few minutes.|
232
233
| 408002| Request timed out waiting on incoming stream. The client did not produce a request within the time that the server was prepared to wait. The client may repeat the request without modifications at any later time.|
233
234
| 415000| The Content-Type header is missing or invalid.|
234
235
| 429000, 429001, 429002| The server rejected the request because the client has exceeded request limits.|
235
236
| 500000| An unexpected error occurred. If the error persists, report it with date/time of error, request identifier from response header X-RequestId, and client identifier from request header X-ClientTraceId.|
236
-
| 503000| Service is temporarily unavailable. Please retry. If the error persists, report it with date/time of error, request identifier from response header X-RequestId, and client identifier from request header X-ClientTraceId.|
237
+
| 503000| Service is temporarily unavailable. Retry. If the error persists, report it with date/time of error, request identifier from response header X-RequestId, and client identifier from request header X-ClientTraceId.|
237
238
238
239
## Metrics
239
240
Metrics allow you to view the translator usage and availability information in Azure portal, under metrics section as shown in the below screenshot. For more information, see [Data and platform metrics](../../../azure-monitor/essentials/data-platform-metrics.md).
@@ -250,6 +251,6 @@ This table lists available metrics with description of how they are used to moni
250
251
| TotalErrors| Number of calls with error response.|
251
252
| BlockedCalls| Number of calls that exceeded rate or quota limit.|
252
253
| ServerErrors| Number of calls with server internal error(5XX).|
253
-
| ClientErrors| Number of calls with clientside error(4XX).|
254
+
| ClientErrors| Number of calls with client-side error(4XX).|
254
255
| Latency| Duration to complete request in milliseconds.|
255
256
| CharactersTranslated| Total number of characters in incoming text request.|
0 commit comments