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 can you give me some more details.
When I pass this for logging into the system
Logon: POST
http://SERVERapp01.ORGnet.org:6405/biprws/logon/long
Now it is returning just the attributes and I am unable to pass the username/password to retreive the report content.
I even tried by using my report URL
http://SERVERapp01.ORGnet.org:6405/biprws/raylight/v1/documents/7555555/reports/5
Did you sucessfully get back the report content if so please guide me here.
What am I missing.
Hi,
you need to post the logon string as a POST call (not GET).
To do that you need to use the Web.Content() with the content option (adding a content option to webcontent transforms the WebContent call into a POST call).
Also you need to have the logon string as a binary using the Text.ToBinary() function.
Username and password need to be hard coded in the xml logon string. Just replace the red text of the below xml code with your username, password and authentication type.
"<attrs>
<attr name=""userName"" type=""string""><username></attr>
<attr name=""password"" type=""string""><password></attr>
<attr name=""auth"" type=""string"" possibilities=""secEnterprise,secLDAP,secWinAD,secSAPR3"">secWinAD</attr>
</attrs>"
Look at my first post to see the complete query I used to get the logon token back from logon API.
To export the report content I used the following function:
Export latest instance as CSV = Web.Contents(baseUrl,[ Headers =[#"Content-type"="application/xml",#"X-SAP-LogonToken"=token,#"Accept"="text/csv"], RelativePath="raylight/v1/documents/"&#"Latest Instance ID"&"/reports/"&#"pageID"&"?]"])
with
baseUrl = http://server:6405/biprws
token = the result of the logon query (see my first post)
LatestInstanceID= ID of the document
pageID=ID of the report
And before that query is made I have another query browsing the document repository to find the latest instance of the report (scheduled to run every our on BO).