Workaround to get contents of Personal Folder of current user
Purpose:
We are building a different front end to browse user content in lieu of using BI LaunchPad. One requirement is for the user to access links to their personal folders. After reading the BIPRWS guide I did not see anything to derive the ID of the logged on user’s folder to query using infostore/123/children for example…
Approach:
I wanted to avoid relying on JAVA or .NET platform SDKs to query for the ID so I thought back to how I knew Lumira Desktop now can connect to BIP and get information back including user’s personal folder using BIPRWS. So I got to sniffing the HTTP traffic in Fiddler. Sure enough, it used traditional biprws/logon/long to log in but then I saw a few new entries called biprws/teamserver/v2/userinfo.
Workaround:
So while I’m pretty sure these are specific to Lumira and probably reserved for that use, it’s pretty clear judgin on the HTTP traffic that teamserver/v2/userinfo was created for my same problem as it only returns 2 pieces of information – The logged in user’s personal folder ID, and it’s CUID. Perfect!!
Below is some primitive HTML code I used to see it work, and perhaps it will be helpful to others, as I’ve seen this same question asked here before in my searching and never saw an answer that I liked based on my approach of not using Java/.NET SDKs
NOTE: This does require Lumira Server for BI Platform to be installed.
// https://websmp107.sap-ag.de/~sapidb/012002523100011517922015E/sbo41sp5_bip_rest_ws_en.pdf
var token;
var userInfo = null;
var rwsurl = "http://bi.example.com:6405/biprws";
var that = this;
function getFavs() {
$.ajax({
type : "GET",
url : rwsurl + "/teamserver/v2/userinfo",
cache : false,
headers : {
"Accept" : "application/json",
"X-SAP-LogonToken" : token
},
dataType : "json",
complete : function(resp, status){
var o = jQuery.parseJSON(resp.responseText);
userInfo = o;
getDocs(userInfo.favFolderID + "/children");
}
});
}
function getDocs(id){
$.ajax({
type : "GET",
url : rwsurl + "/infostore/" + id,
cache : false,
headers : {
"Accept" : "application/json",
"X-SAP-LogonToken" : token
},
dataType : "json",
complete : function(resp, status){
console.log(resp.responseText);
var o = jQuery.parseJSON(resp.responseText);
var h = "<ul>";
var items = o.entries;
for(var i=0;i<items.length;i++){
var item = items[i];
h+="<li><a href='"+item.__metadata.uri+"?token="+token+"'>"+item.name+"</a></li>";
}
h+="</ul>"
that.$().html(h + "<br/>" + JSON.stringify(o));
}
});
}
$.ajax({
type : "GET",
url : rwsurl + "/logon/adsso",
cache : false,
headers : {
"Accept" : "application/json"
},
complete : function(resp, status){
if(status !="success"){
alert("Unsuccessful logon.");
}else{
token = resp.getResponseHeader("X-SAP-LogonToken");
getFavs();
}
}
});
Hi Mike,
thank you for sharing this useful information, it is now more than one year you wrote this blog and googling "teamserver/v2/userinfo" (with quotes) returns only this single post, which means that this topic is probably still not documented at all by SAP!
Did you investigate this solution deeper? I tried it on both BI4.1SP5 and BI4.2SP3 and it works perfectly as long as you specify JSON for the return format (XML is not supported).
Yet I have one doubt. You are writing at the end of the post "NOTE: This does require Lumira Server for BI Platform to be installed". Did you try it on a platform without Lumira Server installed?
Lumira Server is installed on my both platforms, but I stopped and disabled the Lumira Server and it still works! Then I wonder if it works because the add-on is installed, regardless of whether the server is up or not (may be I should try to uninstall the add-on), or if this API is present in the standard installation, but not documented, since several SP.
Christian
I think even if the Lumira Server is disabled, the teamserver/v2 REST URI is active. I'm 99% sure that this is not available without installing Lumira Server, though.