简体   繁体   English

将 tm1py 身份验证方法与 postman 命令进行比较

[英]comparing tm1py authentication method with postman commands

I successfully used tm1py package and was able to get the cubes information using below code.我成功使用了 tm1py package 并能够使用以下代码获取多维数据集信息。

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.现在我需要使用 Postman 命令检查同样的事情。 I tried https://code.cubewise.com/blog/mastering-the-tm1-rest-api-with-postman to test that我试过https://code.cubewise.com/blog/mastering-the-tm1-rest-api-with-postman来测试

.So I used Authorization Type as 'Basic Auth'.User name as pm,password as IBMDemos.And the URL as follows. .所以我使用授权类型作为“基本身份验证”。用户名作为pm,密码作为IBMDemos。URL如下。 http://localhost:51130/api/v1/Cubes (I just need all the cube names). http://localhost:51130/api/v1/Cubes (我只需要所有的立方体名称)。

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.但是我从 postman '401 Unauthorized' 收到一个错误。谁能告诉我这里出了什么问题。我需要在 postman 的某个地方输入命名空间名称字段吗?

Did you try https instead of http?您是否尝试过 https 而不是 http? Because for me when I tried your example on postman I use HTTPS and it works for me.因为对我来说,当我在 postman 上尝试您的示例时,我使用 HTTPS 它对我有用。 And in the example it's HTTPS too.在示例中,它也是 HTTPS。

Moreover you have to put the servername of the server where your TM1server is (instead of localhost).此外,您必须将服务器的服务器名称放在您的 TM1server 所在的位置(而不是 localhost)。 After you have to put the httpportnumber entered in your tm1s.cfg file.在您必须将输入的 httpportnumber 放入您的 tm1s.cfg 文件中之后。

Here is an exemple: https://'servername':'httpportnumber'/api/v1/Cubes这是一个例子:https://'servername':'httpportnumber'/api/v1/Cubes

Please let me know how you handle with it.请让我知道你如何处理它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM