0

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.

suresh_chinthy
  • 377
  • 2
  • 12

2 Answers2

0

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.

Wuzardor
  • 119
  • 1
  • 10
  • Hi @Wuzardor ,,Tried your approaches,1 ) Tried with https but it is resulted an error "The idea of that error was need to go with http". 2) Then I replaced the computer name instead of local host.No Luck mate,,, – suresh_chinthy Jan 16 '21 at 13:13
0

Since you are providing namespace in TM1py example, I guess, you are using CAM security.

Postman.
In Authorization tab set Type to 'No Auth'. Set the following Authorization header:

CAMNamespace base64(user:password:namespace)

In your case the string will look like so:

CAMNamespace cG06SUJNRGVtMHM6SGFybW9ueSBMREFQ

Now you can execute the query.

References:
https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=api-authenticating-managing-sessions
https://www.base64encode.org/

EAA
  • 45
  • 5