Hi Richard / Rick, (Twins?)
Thanks for this, interesting approach. We have to use mode 3 and (for the moment at least) want to limit the solution to direct RestAPI calls only.
From the info Hubert provided we have successfully made the connection from a windows OS to windows OS with
> httr::GET(url, verbose(), authenticate(':', '', type='gssnegotiate'))
However R is actually running on a unix machine, the same request from this machine does not work (we had had to update the url too), returning a 401 unauthorized error.
We assume no general connectivity issues as this connection can be made from Unix to Windows with a mode 1 connection.
Cheers
------------------------------
Steven Rowe
------------------------------
Original Message:
Sent: Fri October 23, 2020 09:49 AM
From: Richard Stevenson
Subject: Sample connection string for RestAPI and mode 3
How do you connect to TM1 using Rest API with CAM security mode 5? Can you use a config.ini file to store settings?
Here is what I have in the config file. I got this working with CAM without a config.ini file within my python script.
Config.ini file:
[tm1srv01]
address=ForQuest01
user=rstevenson
password=####
namespace=ForQuest
gateway=
port=8046
ssl=False
decode_b64=True
Py Script:
with TM1Service(
address='ForQuest01',
port='8046',
user='rstevenson',
password='####',
namespace='ForQuest',
gateway=None,
ssl=False) as tm1:
------------------------------
Richard Stevenson
Original Message:
Sent: Thu October 22, 2020 06:37 AM
From: Steven Rowe
Subject: Sample connection string for RestAPI and mode 3
Hi,
We're trying to set up a RestAPI connection from R to PAL.
We have this working with mode 1 security, however we need it to work with mode 3.
Mode 3 is supported and touched on very briefly on page 9 of this document .
Does anyone have a sample connection script for connecting in mode 3?
Example of the mode 1 connection below.
TIA for any pointers.
```{r}
username <- "myusername"
password <- "password"
adminhost <- "host.name"
httpport <- "23456"
auth_type <- "Basic"
usernamepwd <- paste(username, password, sep = ":")
tm1_auth_key <- paste(auth_type, jsonlite::base64_enc(usernamepwd), sep = " ")
httr::set_config(httr::config(ssl_verifypeer = FALSE))
httr::set_config(httr::config(ssl_verifyhost = FALSE))
u1 <- "https://"
u2 <- adminhost
u3 <- ":"
u4 <- httpport
u5 <- "/api/v1/Configuration"
url <- paste0(u1, u2, u3, u4, u5)
httr::GET(url, httr::add_headers(Authorization = tm1_auth_key))
```
------------------------------
Steven Rowe
------------------------------
#PlanningAnalyticswithWatson