error when using REST api but not using user and password
Closed this issue · 3 comments
in
----> 1 ice.get_collection_folders("PERSONAL")
/usr/local/lib/python3.6/dist-packages/icebreaker/IceClient.py in get_collection_folders(self, collection)
565 for c in collection
566 ], [])
--> 567 return self.request("GET", "collections/%s/folders" % collection)
568
569
/usr/local/lib/python3.6/dist-packages/icebreaker/IceClient.py in request(self, method, endpoint, params, data, files, response_type)
195 "REQUEST: %s %s\nDATA: %s "% (
196 response.status_code, response.reason,
--> 197 method, url, json.dumps(data, indent=2)
198 ))
199
OSError: ICE request failed with code 401 (Unauthorized):
REQUEST: GET https://public-registry.jbei.org/rest/collections/PERSONAL/folders
DATA: null
I set up a key that it tested using curl from the terminal which works, so it is not from the jbei-ice public instance, accessing using as configuration my credentials works though
found the error, (example for the config is using the wrong variable names )
configuration = dict(
root="https://public-registry.jbei.org",
api_token="xxx",
api_token_client = "kkk"
)
ice = icebreaker.IceClient(configuration)
SHOULD READ !!!
configuration = dict(
root="https://public-registry.jbei.org",
token="xxx",
client = "kkk"
)
ice = icebreaker.IceClient(configuration)
Thanks for that, I updated the README.