TM1py SaaS

Post Reply
rachanaharia
Posts: 1
Joined: Fri Jul 11, 2025 3:06 pm
OLAP Product: Tm1
Version: SaaS 12
Excel Version: 365

TM1py SaaS

Post by rachanaharia »

Hi, we have created an API gateway to connect to a third party API, we are able to make connections to TM1 REST API via the postman, We are looking to make the connection using these credentials for using TM1py.
The normal connection string (w/o API gateway) for connecting to TM1py looks something like this and is working fine.
--------------------------------------
params = {
"base_url": url,
"user": "apikey",
"password": '',
"async_requests_mode": True,
"ssl": True,
"verify": True,

}
return TM1Service(**params)
-----------------------------------------

In order to use the API gateway we need to pass 2 tokens:
1) "Authorization": f"Bearer {dx_requestor}", (coming from requestor). used to validate on client side
2) "X-Authorization": "Basic XYZ" (using the basic encode) used to validate the IBM side.
Both these tokens need to be passed as headers for TM1py connection.

This is what I am looking to pass
------------------------------------------------------
url = f"{DX_GATEWAY}{endpoint}"
headers = {
"Accept": "application/json;v=1",

"Content-Type": "application/json",
"Authorization": f"Bearer {dx_requestor}",
"X-Authorization": "Basic XYZ",

}
-------------------------------------------------------
My question here is how to pass these tokens as header in TM1py connection string.
Thanks!
Post Reply