Reputation: 61
Trying to query Watson discovery news with the following curl command and get error 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"
I found documents on the IBM site to create and query your own environments but not help with how to access the news.
Upvotes: 0
Views: 196
Reputation: 61
It turned out my url was incorrect. I got this to work.
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"
Upvotes: 1
Reputation: 4747
Your curl looks correct, which may indicate that your apikey is incorrect. Try running the curl command to list environments:
curl -u "apikey":"{apikey}" "https://gateway.watsonplatform.net/discovery/api/v1/environments?version=2019-04-30"
that should verify that you have the correct apikey.
Upvotes: 0