toloco / pyoanda

Oanda’s API python wrapper. Robust and Fast API wrapper for your Forex bot Python library that wraps Oanda API. Built on top of requests, it’s easy to use and makes sense.
http://oanda.com
MIT License
66 stars 24 forks source link

Client: "The account ID provided is invalid" #12

Closed bogomazov closed 9 years ago

bogomazov commented 9 years ago

Just followed instructions from README

Traceback (most recent call last): File "oanda.py", line 54, in access_token=API_TOKEN File "/usr/local/lib/python2.7/site-packages/pyoanda/client.py", line 23, in init if not self.get_credentials(): File "/usr/local/lib/python2.7/site-packages/pyoanda/client.py", line 36, in get_credentials response = self._Clientcall(uri=url) File "/usr/local/lib/python2.7/site-packages/pyoanda/client.py", line 73, in call raise BadRequest(msg) pyoanda.exceptions.BadRequest: OCode-404: The account ID provided is invalid

elyobo commented 9 years ago

That's oanda indicating that the credentials that you've provided are invalid. I had noticed the same problem with the SANDBOX environment (which doesn't need authentication, I believe, but this lib does require it) - if you're certain that your credentials are correct, try using the PRACTICE environment (and post more code so that we can see what you're actually running).

elyobo commented 9 years ago

@bogomazov I've had a look further at this and using the PRACTICE environment instead should work for you.

I've also addressed the problems with the sandbox in PR #13. Oanda sets up the sandbox environment without the normal account IDs that it gives you, so you need to create an account using the API before you can make other calls. Once #13 is merged you'll be able to use the SANDBOX environment using the instructions there.

toloco commented 9 years ago

13 Will fix this issue, it just neeeds some grooming and It will good to go.

toloco commented 9 years ago

Pending to generate a new pypi version (0.7)