Reputation: 479
I want to use IBM Watson Discovery Services but I am receiving an error message when trying to.
The error message is: WatsonException: Unauthorized: Access is denied due to invalid credentials
import sys
import os
import json
from watson_developer_cloud import DiscoveryV1
discovery = DiscoveryV1(
username="{bbbaaaaa}",
password="{aaaaaabbbb}",
version="2017-09-01"
)
qopts = {'query': 'enriched_text.entities.text:IBM'}
my_query = discovery.query('system', 'news', qopts)
print(json.dumps(my_query, indent=2))
Upvotes: 2
Views: 704
Reputation: 1962
Remove the {
and the }
from your username and password.
It should now be
discovery = DiscoveryV1(
username="aaaaabbbbbb",
password="bbbbbaaaaa",
version="2017-09-01"
)
Upvotes: 2