Credentials.json
Closed this issue · 2 comments
danipolo commented
Hello,
I'm trying to use the script but I don't know if I'm writing a good credentials.json.
Here's my file credentials.json:
{
"url": "https://gateway.watsonplatform.net/discovery/api",
"username": "demo@demo.com",
"password": "userdemopass",
"version": "2017-09-01",
"environment_id": "xxxxxxx-2485-4554-8109-7a7a03ec6ed0",
"collection_id": "xxxxx-556e-4180-xxx-3b9529e9eff0",
"apikey": "xxxxxxxxxxxxxlz59xU4uBJI7kXqxW0pC_dDblzdm"
}
I get this error after run it:
➜ discovery-files (master) ✗ ./discofiles.py ./serps
Traceback (most recent call last):
File "./discofiles.py", line 301, in <module>
main(parse_command_line())
File "./discofiles.py", line 230, in main
iam_apikey=args.iam_api_key)
File "/usr/local/lib/python3.7/site-packages/ibm_watson/discovery_v1.py", line 130, in __init__
authentication_type=authentication_type)
File "/usr/local/lib/python3.7/site-packages/ibm_cloud_sdk_core/base_service.py", line 152, in __init__
'You must specify your IAM api key or username and password service '
ValueError: You must specify your IAM api key or username and password service credentials (Note: these are different from your IBM Cloud id)
bruceadams commented
Hmm. I'm not quite sure what is going wrong here. Can you try removing username
and password
so that only apikey
gets used as the credential? (I'm not in a good spot to try this myself right now.)
danipolo commented
My bad, wrong credentials. Working now. Thanks @bruceadams :)