Planning Analytics

Planning Analytics

Get AI-infused integrated business planning

 View Only
  • 1.  Unable to connect tm1phy on IBM Cloud

    Posted Mon April 08, 2024 11:30 AM

    Hi all,

    Hope you are doing well!

    I'm trying to connect to a tm1 database named "SKU" on cloud, so I have this code:

    `from TM1py import TM1Service

    params = {
    "base_url": "https://XXXXXXX.planning-analytics.ibmcloud.com/tm1/api/SKU/",
    "user": "zied.XXXXX",
    "password": "%%%%%%%",
    "async_requests_mode": True,
    "ssl": True,
    "verify": True
    }

    with TM1Service(**params) as tm1:
    print(tm1.server.get_product_version())`

    When I run the code I get this response:

    TM1pyRestException: Text: '' - Status Code: 401 - Reason: 'Unauthorized'

    Version
    TM1py 3.12.2
    TM1 Server Version: 2.0.94

    Any ideas what I'm doing wrong?
    Thank you in advance,

    Zied



    ------------------------------
    zied ben hmida
    ------------------------------


  • 2.  RE: Unable to connect tm1phy on IBM Cloud

    Posted Tue April 09, 2024 02:12 PM

    I believe your are missing the following argument: 

    namespace="LDAP"


    ------------------------------
    Luc Cusiel
    ------------------------------



  • 3.  RE: Unable to connect tm1phy on IBM Cloud

    Posted Wed April 10, 2024 12:39 PM

    I use this code to connect to the cloud

    serveur = TM1Service(base_url=lstinfos[3],  user=lstinfos[1], password=lstinfos[2], namespace=lstinfos[4])
    Look the same as you with namespace add. Your base_url look ok. Remember to use a non interractive user.


    ------------------------------
    Frederic Arevian
    ------------------------------



  • 4.  RE: Unable to connect tm1phy on IBM Cloud

    Posted Wed April 10, 2024 12:52 PM

    HI Freeeeeeeeeeed happy to hear you!!! 

    C'est Zied de FINLAB ^^

    pour le cloud il faut utilser le non non-interactive user avec le 

    namespace="LDAP"

    et ça marchait pour moi, 

    On doit organiser un dej!!

    Zied



    ------------------------------
    zied ben hmida
    ------------------------------



  • 5.  RE: Unable to connect tm1phy on IBM Cloud

    Posted Wed April 10, 2024 12:50 PM

    Hi Luc, thank you for your reply, 

    it works for me actually what i should do is to use the non interactive account ^^

    with the namespace="LDAP",

    best regards,

    Zied



    ------------------------------
    zied ben hmida
    ------------------------------



  • 6.  RE: Unable to connect tm1phy on IBM Cloud

    Posted Wed April 10, 2024 03:17 AM

    Hi,

    also make sure your user and password are not your ibmid but an non-interactive account

    Regards

    Peter



    ------------------------------
    Peter D'Haeyer
    ------------------------------



  • 7.  RE: Unable to connect tm1phy on IBM Cloud

    Posted Wed April 10, 2024 12:53 PM

    Hi Peter, thank you for your reply, 

    it works for me actually what i should do is to use the non interactive account ^^

    with the namespace="LDAP",

    best regards,

    Zied



    ------------------------------
    zied ben hmida
    ------------------------------