I am trying to test an API connection to TM1 using the TM1py library in Python. I believe I have everything configured, per my welcome kit, however I keep getting the following error. I do not see a token mentioned anywhere in my welcome kit, so I am unsure where to go from here. Any advice?
Failed to connect to TM1 server: Text: '{ "error":"access_denied", "error_description":"Failed to verify OAuth information. Transaction ID=60786123" }' - Status Code: 401 - Reason: 'Unauthorized' - Headers: {'Date': 'Tue, 05 Nov 2024 16:48:39 GMT', 'Server': '', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'Content-Type': 'application/json', 'WWW-Authenticate': 'Bearer', 'X-Backside-Transport': 'FAIL FAIL', 'Vary': 'Accept-Encoding', 'Content-Encoding': 'gzip', 'X-Content-Type-Options': 'nosniff', 'Content-Length': '118', 'Keep-Alive': 'timeout=5, max=100', 'Connection': 'Keep-Alive'}
This is my code, with credentials nullified.
from TM1py import TM1Service
from TM1py.Objects import Process
from TM1py.Exceptions import TM1pyException
# Connection details
config = {
"address": "",
"port": "",
"user": "",
"password": "",
"namespace": "",
"ssl": True
}
try:
# Establish a connection
with TM1Service(**config) as tm1:
print("Connection to TM1 server was successful!")
except TM1pyException as e:
print(f"Failed to connect to TM1 server: {e}")
------------------------------
Peter Lombardo
------------------------------