Jump to content
  • 0

Separate program threads fail setting account after session creation (REST API)


JulianG

Question

I have a program that uses the REST API. It has a main routine and two threads (written in Python). The main routine and each of the two threads establish their own session using the API (POST /session), then set the account (PUT /session).

This has worked fine for months, but for the last few weeks there has been a problem. The first creation of a session and setting the account works as before. However, when the threads come to set their accounts, I get error 401 and message 'error.security.account-token-invalid'. This program goes straight from creating the session to setting the account and it uses the CST and X-SECURITY-TOKEN returned by the session creation when it sets the account. Creating the session itself returns code 200, which indicates success.

Nothing has changed in my program to cause this. The problem is intermittent and I can improve things by retrying after a few seconds, when it will sometimes work.

Does anyone know of any changes at the IG end that might be causing this? Are there any obvious workarounds. One reason for having the separate sessions for the threads was to avoid any possibility of interference between them. I don't know how necessary this is. However, the program worked before and, even if I have to change it, I'd like to know what is happening.

Thanks for any help or suggestions.

Julian

 

Link to comment

1 answer to this question

Recommended Posts

  • 0

I've had similar problems using the rest api on a demo account. I've been using it for around 18 months now. My experience is this: it all works fine for months, then something happens (maybe they update the software or something) then it all goes flakey, struggling to create a session, errors downloading historic data. This can continue for weeks until finally everything goes back to normal again. Based on my time with IG I would describe what you have experienced as normal behaviour for their rest API. It's a shame and is putting me off from going live to be honest.

Link to comment

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
  • image.png

  • Posts

    • Dopamine emerges as a beacon of innovation in the world of cryptocurrency management, offering a non-custodial, secure, and anonymous mobile app wallet. With over two million downloads and a robust user base, Dopamine is reshaping the landscape of decentralized finance (DeFi) on both Android and iOS platforms. Let's delve into the features and functionalities that make Dopamine a must-have tool for navigating the cryptocurrency market. Key Features: 1. Comprehensive Portfolio Tracking: Dopamine's native token, $DOPE, empowers users to monitor their favorite projects from a vast collection of over 10,000 coins, ensuring informed decision-making in the dynamic crypto market. 2. Enhanced Security Measures: With built-in Anti-Money Laundering services, Dopamine enables users to safeguard their assets by identifying potential fraud and assessing risk scores associated with their wallets. 3. Real-Time Market Insights: Stay ahead of the curve with Dopamine's ability to track market trends and identify coins making significant moves, ensuring users remain informed and proactive in their investment strategies. 4. Cross-Chain NFT Transactions: Seamlessly send and receive NFTs across various blockchains, including Ethereum, BSC, Fusion, and more, providing users with unparalleled flexibility and interoperability. 5. Efficient Information Management: Dopamine simplifies data management by allowing users to save essential information and access it instantly, streamlining their crypto journey with convenience and ease. 6. Convenient Fiat On-Ramp: Facilitating seamless transactions, Dopamine enables users to buy crypto directly from their credit or debit card within the app, eliminating the need for multiple platforms and intermediaries. 7. DeFi Gaming Integration: Dive into the exciting world of decentralized finance gaming with Dopamine, offering users access to a diverse range of DeFi games directly from the app, adding a touch of entertainment to their crypto experience. With its innovative features, commitment to user empowerment and upcoming listing on Bitget exchange, Dopamine stands as a revolutionary platform that caters to the diverse needs of cryptocurrency enthusiasts. As the cryptocurrency market continues to evolve, It remains at the forefront, providing users with a secure, versatile, and intuitive solution for managing their digital assets and exploring new horizons in decentralized finance.
    • Name of stock: Adventus Mining Name of Stock Exchange: TSX Leverage or Share dealing: Share dealing Ticker: ADZN Country of stock: Canada
×
×
  • Create New...
us