You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print('Example of margin output:')
print(json.dumps(results['portfolio_margin'], indent=4, sort_keys=True))
The response for the post request is <Response [403]> and I get this error:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\scanner.py", line 37, in _scan_once
nextchar = string[idx]
IndexError: string index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "g:\My Drive\Melanion\Jean Marc\MarginsGit\SSDF_Margins_Parser_API.py", line 52, in
results.json()
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson_init_.py", line 525, in loads
return _default_decoder.decode(s)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\scanner.py", line 79, in scan_once
return _scan_once(string, idx)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\scanner.py", line 39, in _scan_once
raise JSONDecodeError(errmsg, string, idx)
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered:
Hello, I am running the following code:
import requests
import json
url_base = ("https://api.developer.deutsche-boerse.com/prod/prisma-margin-estimator-2-0/2.0.0/")
api_header = {"X-DBP-APIKEY": 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'}
etd = {'line_no': 1, 'product_id': 'A2CR', 'maturity': 202112, 'net_ls_balance': 1}
results = requests.post(url_base + 'estimator',
headers = api_header,
json = {'portfolio_components':[
{'type': 'etd_portfolio', 'etd_portfolio': [etd]},
],
'clearing_currency': 'EUR'})
results.json()
print('Example of margin output:')
print(json.dumps(results['portfolio_margin'], indent=4, sort_keys=True))
The response for the post request is <Response [403]> and I get this error:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\scanner.py", line 37, in _scan_once
nextchar = string[idx]
IndexError: string index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "g:\My Drive\Melanion\Jean Marc\MarginsGit\SSDF_Margins_Parser_API.py", line 52, in
results.json()
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson_init_.py", line 525, in loads
return _default_decoder.decode(s)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\scanner.py", line 79, in scan_once
return _scan_once(string, idx)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\simplejson\scanner.py", line 39, in _scan_once
raise JSONDecodeError(errmsg, string, idx)
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered: