![]() ![]() 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Ī Cognitive Service 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 Cognitive Services multi-service and regional translator resource. ![]() Use with Cognitive Services subscription if you're passing an authentication token. Use with Cognitive 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 Cognitive Services multi-service in Azure Cognitive 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 "". 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |