The following API can be called to get a cached authentication token from SAM, which can be used for Samples, Registration Brochure, Dynamic assets, etc




Where MYCALLBACK_FUNCTION_NAME is the function name of the callback function.

This callback will be called asynchronously with an authtoken: 

{"authtoken":"THE_AUTH_TOKEN", "error" : "0"}


Sample code snippet: 

window.location.href =‘ni-action:regetauthtoken?cb=callback’;// the following function will be called asynchronouslywindow.callback = function(data) { console.log(data); //=> {"authtoken":"THE_AUTH_TOKEN", "error" : "0"}}


To request a new token when the old one has expired, the following api can be called:




This can be used in the same manner of getauthtoken.

MI Desktop code in Curl:

curl -s -D- -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "uEmail=YOUREMAIL&uPassword=YOURPASSWORD&version=1" "" | grep authtoken


The returned error number is zero or an error code. Generally should not fail, unless you have no internet, or the credentials are wrong.

callback MUST be a global function (attached to the window object)

callback is called asynchronously.