Hi,
I am experimenting with your API package for Python and using your exemple script DarwinAPIClassesExample.py.
I have activated the following code in the example:
Let's create the access token variable:
AUTH_CREDS = {'access_token': 'fe1e00f4-bdf6-313d-915b-3ac4eea325d1',
'consumer_key': 'IR5UvEGyEMK8combIVBLbcof_WMa',
'consumer_secret': 'WKcuZy981a14pmvyj1cPTK6cjo4a',
'refresh_token': '1e109063-4a36-3565-86d6-d9d46c2e7467',}
darwinexInfo = DWX_Info_API(AUTH_CREDS, _version=2.0, _demo=True)
DWX_Info_API:
darwinUniverse = darwinexInfo.Get_DARWIN_Universe(_status='ACTIVE', _iterate=True, _perPage=50)
pprint.pprint(darwinUniverse)
darwinUniverse.to_csv('/Users/Dan/darwin-api-tutorials-master/PYTHON/NOTEBOOKS/12_quant_workflow_algo_trading_darwin_api/darwinUniverse.csv')
When I run the code, I receive the following message:
[INIT] - Creating AUTH creds...
[INIT] - Access token will be created again at 1599829976.2918148 UNIX timestamp
[INIT] - Creating AUTH creds...
[INIT] - Access token will be created again at 1599829976.292811 UNIX timestamp
[DarwinInfoAPI] Getting first 50 DARWINs..
[DECORATOR] - The expiration time has NOT reached yet > Continue...
**** FULL URL ENDPOINT ****: https://api.darwinex.com/darwininfo/2.0/products?status=ACTIVE&page=0&per_page=50
<Response [403]>
{"fault":{"code":900908,"message":"Resource forbidden ","description":"Access failure for API: /darwininfo/2.0, version: 2.0 status: (900908) - Resource forbidden "}}
It appears that I need "Authorization: Bearer ACCESS_TOKEN", but I do not know how to do that.
I have provided the authorization tokens above that is newly created on https://www.darwinex.com/data/darwin-api.
I would very much appreciate your assistance.