-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I'm following the documentation but I'm not able to successfully get it to work. The following is my script:
from sacapi.sacapi import SACConnection
from sacapi import sacapi
SAC_CLIENT_ID = ''
SAC_CLIENT_SECRET = ''
SAC_MODEL_ID = ''
1 Make a connection to my own SAC
sac = sacapi.SACConnection("", "")
2 Setup authentication
sac.connect(SAC_CLIENT_ID, SAC_CLIENT_SECRET)
All good so far but when I run the following statement:
md = sac.getModelMetadata(SAC_MODEL_ID)
I get this error:
KeyError Traceback (most recent call last)
File ~\Documents\WinPython\WPy64-31241\notebooks\sacapi\sacapi.py:614, in SACConnection.getModelMetadata(self, providerID)
613 mdMembers = {}
--> 614 for cdMember in currDimResponseJson["value"]:
615 if "DATE" in cdMember:
KeyError: 'value'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
Cell In[36], line 1
----> 1 md = sac.getModelMetadata(SAC_MODEL_ID)
File ~\Documents\WinPython\WPy64-31241\notebooks\sacapi\sacapi.py:649, in SACConnection.getModelMetadata(self, providerID)
647 except Exception as e:
648 errorMsg = "Unknown error during token acquisition."
--> 649 if e.status_code:
650 errorMsg = "%s Status code %s from server. %s" % (errorMsg, e.status_code, e.error)
651 raise RESTError(errorMsg)
AttributeError: 'KeyError' object has no attribute 'status_code'
I appreciate if someone can help me.