Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
mike_howles4
Active Contributor

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();
     }
   }
});
2 Comments
Labels in this area