Jump to content
The Twitter Feeds are now back on the Platform ×
  • 0

DEMO API 500 - Internal Server Error


martik

Question

Hello!

I'm facing issues with the API's for DEMO account.
I can successfully connect to the account, but cannot execute any other API calls like fetching open positions.

It works well for LIVE account.
I'm using IG Python Libraries, with below base urls:

D_BASE_URL = {"live": "https://api.ig.com/gateway/deal", "demo": "https://demo-api.ig.com/gateway/deal"}

As it throws 500 (Internal Server Error) this is something on IG end(or at least it doesn't give me a correct output if there is anything on my end). 

Anyone else facing the same issue or has any suggestion how I can proceed?

<-- LOG -->

#DEMO
ACTION:
create
ENDPOINT:
/session
PARAMS:
{'identifier': '***', 'password': '***'}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7fba0276bcc0>), ('http://', <requests.adapters.HTTPAdapter object at 0x7fba0276bd68>)])}
VERSION:
2
{'accountType': 'CFD', 'accountInfo': {***}
**ACCOUNTID**

Connected to account Demo-cfd(**ACCOUNTID**), Balance : *** SEK

 

trader.fetchOpenPositions - fetching open positions!
trading_ig.fetch_open_positions
ACTION:
read
ENDPOINT:
/positions
PARAMS:
{}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7fba0276bcc0>), ('http://', <requests.adapters.HTTPAdapter object at 0x7fba0276bd68>)])}
VERSION:
1
<Response [500]>
{'errorCode': None}



#LIVE
ACTION:
create
ENDPOINT:
/session
PARAMS:
{'identifier': '***', 'password': '***'}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7f71ee767940>), ('http://', <requests.adapters.HTTPAdapter object at 0x7f71ee7679e8>)])}
VERSION:
2
{'accountType': 'CFD', 'accountInfo': {***}
**ACCOUNTID**

Connected to account CFD(**ACCOUNTID**), Balance : *** SEK

 

trader.fetchOpenPositions - fetching open positions!
trading_ig.fetch_open_positions
ACTION:
read
ENDPOINT:
/positions
PARAMS:
{}
{'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'auth': None, 'proxies': {}, 'hooks': {'response': []}, 'params': {}, 'stream': False, 'verify': True, 'cert': None, 'max_redirects': 30, 'trust_env': True, 'cookies': <RequestsCookieJar[]>, 'adapters': OrderedDict([('https://', <requests.adapters.HTTPAdapter object at 0x7f71ee767940>), ('http://', <requests.adapters.HTTPAdapter object at 0x7f71ee7679e8>)])}
VERSION:
1
<Response [200]>
{'positions': []}
Open positions : 0



 


 

Link to comment

1 answer to this question

Recommended Posts

  • 0
Guest Stesol

Hi,

I have the same issue since yesterday, just the other way round: OK for Demo, response 500 (errorCode: none) for Live (also in the REST companion).

BR

Stef

 

 

 

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
  • General Statistics

    • Total Topics
      21,697
    • Total Posts
      92,061
    • Total Members
      41,981
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    mixer50x350
    Joined 31/03/23 21:31
  • Posts

    • Hello everyone, i am looking to hold shares long term Apple Tesla in a spreadbetting account just wounded if there is a calculation example Tesla $195.00 1 share = ? ponds per point spread bet. Thanks for any help
    • #USDCAD: Time For PullbackUSDCAD reached a key level.Testing that, the price broke and closed above the resistance line of a falling wedge pattern.I expect a pullback now.Goals: 1.355 / 1.3577  
    • Charting the Markets: 31 March The FTSE 100, DAX 40 and Nasdaq 100 surge higher on a positive outlook as EUR/USD, GBP/USD pause their ascents while USD/JPY continues to rise as the greenback appreciates. WTI remains capped by resistance, gold forms a technical triangle as Robusta coffee trades near six-month highs.   Axel Rudolph FSTA | Senior Financial Analyst, London | Publication date: Friday 31 March 2023                 This is here for you to catch up but if you have any ideas on markets or events you want us to relay to the TV team we’re more than happy to.
×
×
  • Create New...