簡體   English   中英

IBM Watson Discovery 新聞 curl 禁止錯誤

[英]IBM Watson Discovery news curl forbidden error

嘗試使用以下 curl 命令查詢 Watson 發現新聞並收到錯誤 403 forbidden。 curl -u "apikey":"{apikey}" "https://gateway.watsonplatform.net/discovery/api/v1/environments/system/collections/news-en/query?version=2019-04-30&query=relations.action.lemmatized:acquire&count=3&filter=entities.text:IBM&return=text"

我在 IBM 站點上找到了用於創建和查詢您自己的環境的文檔,但對如何訪問新聞沒有幫助。

原來我的網址不正確。 我得到了這個工作。

curl -u "apikey":"{apikey}" "https://api.eu-gb.discovery.watson.cloud.ibm.com/instances/96a866f9-11bb-4b55-af26-a0f826807fec/v1/environments/system/collections/news-en/query?version=2019-04-30&query=enriched_title.semantic_roles:(action.normalized:acquire,object.entities:(type::Company))&count=3"

您的 curl 看起來正確,這可能表明您的 apikey 不正確。 嘗試運行 curl 命令來列出環境:

curl -u "apikey":"{apikey}" "https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2019-04-30"

這應該驗證您是否擁有正確的apikey。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM