Skip to Content

No one else has contributed to the SAP River Video Dare, so I wanted to add two more videos myself. The first video provides a tip on how to change data in River via the REST API and the second video shows how to export to BIOnDemand.

h2. Using the X-Coghead-Authtoken Header 

Note: Thanks to the River developers in Israel who helped me solve this problem. 

The River Rest API is the avenue through which most developers will be developing with River. I was experimenting with this API and I kept getting an error when attempting to change data via the REST API.  I discovered the importance of the X-Coghead-Authtoken HTTP Header when using the interface.  Although there are a few sentences describing this token in the REST API documentation, I had to experience its importance first hand. 

This video shows the use of this token to change data in a collection. 

 

h2. River to BIOnDemand 

This video shows how to export data from the River to SAP’s OnDemand BI platform . This export code is based on a custom action that originated from Juergen Schmerder – a member of the River who has been active from the start – Thanks.  I made a few changes so that it is now possible to update an existing dataset rather than creating a new one every time.  The update replaces the old dataset entirely – an update on a partial selection of rows in the dataset is currently not possible via the BIOnDemand REST API. 

 

 

Here is the action code:

 

// credentials for BIOD

// BIOD will determine the account based on the logon data

var $USER = 'yourBIODUser';

var $PWD  = 'yourBIODPassword;

 

// helper function for Base64 encoding of credentials

function encode64(input) {

 var keyStr = "ABCDEFGHIJKLMNOP" +

              "QRSTUVWXYZabcdef" +


              “ghijklmnopqrstuv” </pre><pre>               “wxyz0123456789/” </pre><pre>               “=”;</pre><pre>  var output = “”;</pre><pre>  var chr1, chr2, chr3 = “”;</pre><pre>  var enc1, enc2, enc3, enc4 = “”;</pre><pre>  var i = 0;</pre> <pre>  do {</pre><pre>     chr1 = input.charCodeAt(i);</pre><pre>     chr2 = input.charCodeAt(i);</pre><pre>     chr3 = input.charCodeAt(i+);var body = “” + boundary + “\r\n”;</pre><pre>body += metadataHeaders + “\r\n” + metadataXML + “\r\n\r\n”;</pre><pre>body += “” + boundary + “\r\n” + dataHeaders + “\r\n” + dataXML;


body += “\r\n” + boundary + “\r\n”; 

req.appendToBody(body);

var res = $UTILS.http.sendRequest(req);

$UTILS.log.info(res.body.replace(/\n/g,""));

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply