Forum Discussion
Connect to Business Object Webi report through RESTful request
- 9 years ago
Continuing my previous post:
2 issues arise when I upload to Power BI service and try to refresh through the data gateway:
1) functions are not accepted - fixed easily by adding the logon function within the main query as a subquery
2) the main query credential (anonymous) isn't accepted by Power BI services - fixed by using relativepath in my webcontent()
Also I have added to my query a first subquery to retrieve the report ID of the latest instance of the report stored in Business Object.
If anyone is interested to see the details I am happy to share my query.
Hi,
which webcontent is failing ? The one to get the token ?
Can you first make sure that your authentication process works ?
Hi,
Thanks to the post, it is useful but I have problems with the authentication anonymous.
I use the next code
let
body = Text.ToBinary("<attrs>
<attr name=""userName"" type=""string"">usuario</attr>
<attr name=""password"" type=""string"">pass</attr>
<attr name=""auth"" type=""string"" possibilities=""secEnterprise,secLDAP,secWinAD,secSAPR3"">secEnterprise</attr>
</attrs>"),
actualUrl = "http://baseURL:6405/biprws/",
options = [
Headers =[#"Content-type"="application/xml",#"Accept"="application/json"],
RelativePath="logon/long",
Content=body
],
result = Web.Contents(actualUrl, options),
#"Imported JSON" = Json.Document(result,1252),
logonToken = #"Imported JSON"[logonToken],
#"Latest Instance ID"="123456",
#"pageID"="2",
optionsCSV = [
Headers =[#"Content-type"="application/xml",#"Accept"="text/csv",#"X-SAP-LogonToken"=logonToken],
RelativePath="raylight/v1/documents/"&#"Latest Instance ID"&"/reports/"&#"pageID"],
CSV = Web.Contents(actualUrl,optionsCSV)
in
CSV
And in CSV fails, said that "We couldn't authenticate with the credentials provided. Please try again."
The authentication process works fine, because I can see the token in Power BI. I don't understand why the web.contents works with the part of logon but in the part of CSV fails.
I send a photo where the request to Power BI
You can help me?
Thanks