Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
447 views
in Technique[技术] by (71.8m points)

python - comparing tm1py authentication method with postman commands

I successfully used tm1py package and was able to get the cubes information using below code.

from TM1py.Services import TM1Service

with TM1Service(address= "localhost",port="51130",user= "pm",password= "IBMDem0s",namespace="Harmony LDAP",ssl= False) as tm1:
    df =tm1.cubes.cells.execute_view_dataframe(cube_name ="PUR_Sales_Planning",view_name="View1",private= False)

Now I need to check the same thing using Postman commands. I tried https://code.cubewise.com/blog/mastering-the-tm1-rest-api-with-postman to test that

.So I used Authorization Type as 'Basic Auth'.User name as pm,password as IBMDemos.And the URL as follows.http://localhost:51130/api/v1/Cubes (I just need all the cube names).

But I got an error from postman '401 Unauthorized'.Can anyone advise what has gone wrong here.Do I need to enter namespace name field in somewhere in postman.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Did you try https instead of http? Because for me when I tried your example on postman I use HTTPS and it works for me. And in the example it's HTTPS too.

Moreover you have to put the servername of the server where your TM1server is (instead of localhost). After you have to put the httpportnumber entered in your tm1s.cfg file.

Here is an exemple: https://'servername':'httpportnumber'/api/v1/Cubes

Please let me know how you handle with it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...