Forum Discussion
Opentext Content Server
I have used documents in OpenText from Power BI via the OpenText REST API... but the problem I have is I need to hard code the API credentials in the Power Query code and I haven't found a way to integrate with Power BI's credential manager. The Power Query I used to open an Excel file from OpenText was (substitute in the username, password and appropriate OpenText API URLs and document ID for your org):
let
GetJson = Web.Contents("https://<opentext auth server>/authentication/credentials",
[
Headers = [#"Content-Type"="application/json"],
Content = Text.ToBinary("{""user_name"":""<user>"", ""password"":""<password>""}")
]
),
FormatAsJson = Json.Document(GetJson),
Ticket = FormatAsJson[ticket],
DocID = "1234567",
ExcelFile = Web.Contents("https://<opentext api server>/api/v1/nodes/" & DocID & "/content",
[
Headers = [#"OTDSTicket"=Ticket]
]
),
ExcelWorkbook = Excel.Workbook(ExcelFile)
in
ExcelWorkbook
If someone has a better way that doesn't have hard coded credentials I'd really appreciate that.
Re: your question on hard coded credentials - you can store the credentials within parameters and then reference your parameter in place of the hard coded credentials:
Content = Text.ToBinary("{""user_name"":"""&SPUserName&""", ""password"":"""&SPPassword&"""}")]),
So SPUserName is the name of the parameter that stores my username and the Current Value of the parameter is my hard coded username.