Jump to content
  • 0

IG API - switch account?



I want to switch between two live accounts, but I ger an error. What's wrong? This is how I've tried to do:

1. I get X-SECURITY-TOKEN and CST via https://api.ig.com/gateway/deal/session.
2. I make a PUT request to the same url with a json of {"accountId":"--the-acoountid--","defaultAccount":False}. The response is {'trailingStopsEnabled': False, 'dealingEnabled': True, 'hasActiveDemoAccounts': True, 'hasActiveLiveAccounts': True}
3. The switch seems to work, but then - when I try to use the API I get an error an all requests: {'errorCode': 'error.security.account-token-invalid'}

What’s wrong? :o

Link to comment

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...