Use TM1py with PAaaS instance
Posted: Thu Jan 11, 2024 3:05 pm
Hi - I have been a TM1 / PA developer for a number of years. However, only in the last few months have I started working with a PAaaS cloud instance. I was keen to try out TM1py, so this week I have started learning some python basics. Apologies if this issue has been dealt with elsewhere, but I have searched for an answer without finding what I am looking for. And apologies for the python code - like I say, I'm new to that game, so I am probably breaking all the rules.
The cloud instance is accessed using this URL format: My first test was to see if I could connect to the server - I used the code below to firstly get an access token from the iam.cloud.ibm.com site by using the API key that I had previously generated, and then using the access token to connect to the cloud server. This seemed to be successful because I was able to display a list of the cubes in the SData model. Here is a screenshot of the code:
... and here is the output:
Given that I was able to connect as above, and use the TM1 REST API to return data, I thought that I would be able to connect using TM1py. However, so far I have been unable to achieve this.
I tried tried the code below which passes in the session_id parameter:
However, I got a 401 error in my output (sorry no more screenshots - I've reached my limit of 3!).
I also tried using an access token in the url in case this might get around it, but this gave a 401 error as well.
Just wondering if anyone else has hit this problem, or if anyone can spot that I am missing something obvious?
Thanks and Regards,
Mark
The cloud instance is accessed using this URL format: My first test was to see if I could connect to the server - I used the code below to firstly get an access token from the iam.cloud.ibm.com site by using the API key that I had previously generated, and then using the access token to connect to the cloud server. This seemed to be successful because I was able to display a list of the cubes in the SData model. Here is a screenshot of the code:
... and here is the output:
Given that I was able to connect as above, and use the TM1 REST API to return data, I thought that I would be able to connect using TM1py. However, so far I have been unable to achieve this.
I tried tried the code below which passes in the session_id parameter:
However, I got a 401 error in my output (sorry no more screenshots - I've reached my limit of 3!).
I also tried using an access token in the url in case this might get around it, but this gave a 401 error as well.
Just wondering if anyone else has hit this problem, or if anyone can spot that I am missing something obvious?
Thanks and Regards,
Mark