How to request an authentication token from SAM?

Modified on Mon, 11 Sep 2017 at 10:01 AM

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.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article