0

我正在尝试学习教程,了解有关从笔记本调用 API 的更多信息。似乎教程方向不再与 bluemix 平台保持一致,因为我应该提供翻译服务,然后从凭据中提取我的用户名和密码。由于创建的唯一凭据如下所示,有人可以告诉我如何找到用户名和密码吗?

{
  "apikey": "uK7Wv6hfKjTO_p56lhzZy302QmTZCyPI_FYFkqMLGOS0",
  "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:language-translator:us-south:a/bff2d8201267d05e8b5580a56638c7a0:5eb84a08-7dd1-4a12-8385-b1eb043e1fcc::",
  "iam_apikey_name": "auto-generated-apikey-eb2957a2-f849-4f89-a830-2f6d688ec4a9",
  "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Manager",
  "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/bff2d8201267d05e8b5580a56638c7a0::serviceid:ServiceId-2588fac4-f9ea-4461-8e6c-be358855f9c7",
  "url": "https://gateway.watsonplatform.net/language-translator/api"
}
4

1 回答 1

0

您是否遵循以下说明: https : //www.ibm.com/watson/developercloud/language-translator/api/v3/curl.html ibm.com?如果您可以分享您的教程,这也可能会有所帮助。(另外,您的问题暴露了您的 api 密钥;我建议删除它并创建一个新密钥。)

这是一个 curl 调用示例:

curl --user apikey:{apikey} "https://gateway.watsonplatform.net/language-translator/api/v3/identifiable_languages?version=2018-05-01"

其中用户名是 apikey,密码是实际的 api 密钥(用于 curl)。这也可能有帮助: https ://console.bluemix.net/docs/services/language-translator/getting-started.html#gettingstarted

于 2018-07-05T21:16:17.307 回答