【问题标题】:Microsoft Translator API Cognitive Services - What is the correct endpoint?Microsoft 翻译 API 认知服务-正确的端点是什么?
【发布时间】:2018-03-30 15:15:43
【问题描述】:

TextTranslator 的 Microsoft Azure 门户提供以下端点:

https://api.cognitive.microsoft.com/sts/v1.0

然而,此端点为 issueToken 返回 200,为 Translate 返回 404。样本指的是一个端点:

https://api.microsofttranslator.com/v2/http.svc/

鉴于翻译器以 datamarket 结尾,文档已过时是我最初的假设。但是,文档端点为 Translate 方法返回。

http://docs.microsofttranslator.com/text-translate.html#!/default/get_Translate

我们应该使用哪个端点?

如果应该使用 api.microsofttranslator.com,那么 Azure 中的 api.cognitive.microsoft.com 是做什么用的?

【问题讨论】:

    标签: microsoft-cognitive


    【解决方案1】:

    您可以通过 2 种方式使用 Microsoft Translator API (see the docs):

    【讨论】:

      【解决方案2】:

      对于翻译API,您需要先获取一个授权令牌(第一个链接),然后您可以使用此令牌调用Translate api(第二个链接)。

      您可以了解有关身份验证步骤here 的更多信息。

      【讨论】:

      • 谢谢。我懂了。诡异的。不太确定我是否相信从一项服务获取 API 令牌,然后将它们与另一项服务一起使用。如果将其用作一般模式,这似乎是一个适合创建安全漏洞的场景。
      • api.cognitive.microsoft.com/sts/v1.0/issueToken 返回 404。docs.microsofttranslator.com/oauth-token.html 的交互工具返回“错误”:“服务器无响应”。有谁知道微软是否在进行维护或发生了什么?
      • 终于让它与标题中的 POST 和 Ocp-Apim-Subscription-Key 一起使用。
      猜你喜欢
      • 2017-08-11
      • 1970-01-01
      • 2019-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-11
      • 2020-03-06
      • 2010-12-31
      相关资源
      最近更新 更多