Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

position.close(): status 400 > "invalid JSON body, must be an object" #24

Open
FXGears opened this issue May 12, 2017 · 2 comments
Open

Comments

@FXGears
Copy link

FXGears commented May 12, 2017

Latest v20 release gices me: "Invalid JSON body, must be an object" as the error message on a 400 response to using the position.close command.

my code looks like this:
req = api.position.close('account_id', 'EUR_USD')

Auth and everything else works (same API context can place orders, list orders, get account info.. etc..)

It appears to only work if I include the longUnits or shortUnits variables... but the documentation and method both suggest this should not be needed.

@darnes
Copy link

darnes commented Aug 19, 2022

The same happens just listening price data as well.

@darnes
Copy link

darnes commented Aug 20, 2022

There are plenty of cases when the JSON loaded without try-catch blocks.... Wondering it is blind trust to oanda APIs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants