Page 3 of 3
Re: TM1 REST API ( Any early adopters )
Posted: Wed Jan 21, 2015 12:29 am
by RJ!
I'll keep keep testing it till I can get a response I guess.
Re: TM1 REST API ( Any early adopters )
Posted: Wed Jan 21, 2015 12:44 am
by nick_leeson
Have a read through this
https://developer.chrome.com/extensions/xhr but I am still confused whether using session id will be enough for you to get REST API working.
Best of luck.
Re: TM1 REST API ( Any early adopters )
Posted: Fri Feb 13, 2015 4:48 am
by RJ!
After many, many hours... And remebering a few things from last years TM1 Conference I finally cracked it!!
All you need is Dojo and a method to insert your Username & Password as Base64.
The JavaScript Code is as easy as:
Code: Select all
require([ "dojo/request" ], function (request) {
request("http://Localhost:port/api/v1/Processes", {
headers: {
"X-Requested-With": null,
"Authorization": Basic *Username:password
},
withCredentials: true
});
});
*Encoded as Base64
This is obviously the most basic way of getting connected to the REST API while using "IntegratedSecurityMode=1 or 2".
I'm not sure about the NTLM methods though am assuming it will be similar except for the Token instead of username:password.
If you have any improvements to the code, please add them here!!
Re: TM1 REST API ( Any early adopters )
Posted: Wed Jul 01, 2015 7:52 am
by RJ!
I'm now trying to use SSL so make the connection a bit more secure.
I have:
Updated the tm1s.cfg with the below parameters:
HTTPSPortNumber=XXXX
UseSSL=T
My HTML landing page is:
http://myTM1Server:XXXX/tm1web/test/test.html
My POST request is:
https://myTM1Server:XXXX/api/v1/Cubes('Fin_GL')/Views('Default')/tm1.Execute
Is changing the POST request from HTTP to HTTPS all that is required to get SSL to work?
Are there any other parameters or settings that need to be changed anywhere?
I get a timeout error when executing that post command at the moment, I didn't get that when SSL was not activated.
Re: TM1 REST API ( Any early adopters )
Posted: Wed Jul 01, 2015 8:47 am
by lotsaram
Pretty sure the config parameter remains HTTPPortNumber and you just change UseSSL to true.
Re: TM1 REST API ( Any early adopters )
Posted: Tue Jul 07, 2015 12:49 am
by RJ!
so should my "post" command use "https"?
Re: TM1 REST API ( Any early adopters )
Posted: Tue Jul 07, 2015 9:24 am
by qml
RJ! wrote:so should my "post" command use "https"?
Yes, just not your tm1s.cfg parameter.
Re: TM1 REST API ( Any early adopters )
Posted: Mon Aug 22, 2016 3:38 am
by anmolmalhotra
Hi Folks,
I am bit new in using TM1 rest api, i have a same problem of sending the post request to the server.I don't want to use jquery , can someone got the another way of doing that.
Also without any plugins

Re: TM1 REST API ( Any early adopters )
Posted: Fri Aug 26, 2016 3:36 am
by RJ!
I've seen a generic "Login/Test" page that was created by an IBM Dev that's supposedly out in the wild now.
It allows you to login, test your GET & POST commands and see the resulting data from TM1.
I'm sure if you ask your IBM rep or TM1 consultant really nicely, they'll give it to you.
TM1 Rest API and Google Sheets
Posted: Wed Aug 31, 2016 2:27 am
by whitej_d
I used this tool which was very helpful for querying the TM1 rest API - Post or Get, including authentication:
https://www.hurl.it/
I actually managed to host a TM1 server on an Amazon AWS instance, and then using the REST Api, successfully managed to get a cube view onto a Google Sheet using a Google script. I'll attach the script in case it helps anyone get started, but I'm not a programmer and it's really just me hacking around, so it's not pretty! The Amazon server isn't running either, so don't expect it to work as is!
I also tried to turn DBRW into a function for google using a google worksheet to query the Rest API. It worked, but due to the way Google scripts run on a separate server to the Google sheet itself, there doesn't seem to be a way of getting anything like DBRW functionality onto Google with adequate performance.
Re: TM1 REST API ( Any early adopters )
Posted: Wed Aug 31, 2016 2:33 am
by whitej_d
For the sake of sharing, here was my attempt at DBRW functionality in Google Sheets using Google script and the TM1 Rest API. As I mentioned, I think it's a dead end due to the way the cache service is on a different server to the sheet service and communication between the two is too slow to put the data in the relevant place.
Re: TM1 REST API ( Any early adopters )
Posted: Fri Oct 28, 2016 11:45 am
by ambrus
For anybody interested in interactively learning and exploring the Rest API of TM1 I can only recommend the swagger UI. For the good of the community find it hosted (and connected to a Planning Sample model) on
http://swagger-ui.cubeac.com
Blog post with further details:
http://cubeac.com/blog/learning-tm1-res ... wagger-ui/
Cheers,
Ambrus
Re: TM1 REST API ( Any early adopters )
Posted: Tue Nov 29, 2016 1:08 pm
by pramodbugudai