Authorization: Bearer Īn authentication token is valid for 10 minutes. The valid token is passed to the Translator service as a bearer token in the Authorization. Pass secret key using query string parameterĪnd here are example requests to obtain a token given a secret key for a regional resource located in Central US: // Pass secret key using headerĬurl -header "Ocp-Apim-Subscription-Key: " -data "" ""Ī successful request returns the encoded access token as plain text in the response body. Here are example requests to obtain a token given a secret key for a global resource: // Pass secret key using headerĬurl -header 'Ocp-Apim-Subscription-Key: ' -data "" '' To obtain an authorization token, make a POST request to the following URL: Resource type This token is included with each request as the Authorization header. Authenticating with an access tokenĪlternatively, you can exchange your secret key for an access token. If you pass the secret key in the query string with the parameter Subscription-Key, then you must specify the region with query parameter Subscription-Region. It must be the same region you selected when you signed up for your multi-service subscription through the Azure portal. The region you select is the only region that you can use for text translation when using the multi-service key. Region is required for the multi-service Text API subscription. The value is the region of the multi-service resource. The value is the Azure secret key for your multi-service resource. There are two headers that you need to call the Translator. When you use a multi-service secret key, you must include two authentication headers with your request. d ""Īuthenticating with a Multi-service resourceĪ multi-service resource allows you to use a single API key to authenticate requests for multiple services. Here's an example request to call the Translator using the global translator resource // Pass secret key using headers The value is the Azure secret key for your subscription to Translator. When you use a global translator resource, you need to include one header to call the Translator. Add the Ocp-Apim-Subscription-Key: header to your request. The first option is to authenticate using the Ocp-Apim-Subscription-Key header. This value is optional when using a global translator resource. The value is the region of the multi-service or regional translator resource. Use with multi-service and regional translator resource. Use with Azure AI services subscription if you're passing an authentication token. Use with Azure AI services subscription if you're passing your secret key. This table describes how each is used: Headers There are three headers that you can use to authenticate your subscription. Subscribe to Translator or multi-service in Azure AI services, and use your key (available in the Azure portal) to authenticate. H "Ocp-Apim-Subscription-Region: switzerlandnorth" \Ģ Custom Translator isn't currently available in Switzerland. And a sample request to translate is: // Pass secret key and region using headers to a custom endpoint For example: If you create a Translator resource in Azure portal with 'Resource region' as 'Switzerland North' and your resource name is my-swiss-n, then your custom endpoint is https​ ://. 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. Korea South, Japan East, Southeast Asia, and Australia EastĪĪĮast US, South Central US, West Central US, and West US 2ġ Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. All requests are processed among the datacenters within the geography. To force the request to be handled within a specific geography, use the desired geographical endpoint. If there's a datacenter failure when using the global endpoint, the request may be routed outside of the geography. Requests to Translator are, in most cases, handled by the datacenter that is closest to where the request originated. More informative language detection results.Dictionary to look up alternative translations of a term, to find back-translations and examples showing terms used in context.Language detection, translation, and transliteration in one request.Translation to multiple languages in one request.Transliteration to convert text in one language from one script to another script.It improves usability and performance by consolidating existing features into fewer operations and it provides new features. Version 3.0 of the Translator provides a modern JSON-based Web API.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |