Logon

Logon returns a token that will be used to authenticate other api calls that require to be authenticated.

There are 6 ways to ‘log in’:

  1. With a username and password
  2. With an access token
  3. Using Kerberos
  4. Using SAML
  5. With AMS username and password
  6. With AuthToken
  7. Optional: With two-factor authentication

1. With username (Email) and password.

Input Parameter Type Description
Email* String Account email
Password* String Account password
LocationID* String Unique ID of device
TwoFactorCode (if required) Integer Code generated with the Google Authenticator app
Remember Boolean Optionally return a rember token if allowed (see password policy)
Output Parameter Type Description
Token String Security token, False on failure
Account AccountInfo

*=required

CURL EXAMPLE
curl -v 'https://example.com/ctrller/api.php?Task=Logon&Email=user@example.com&Password=password&LocationID=56e77cd4-5aa4-4c7b-9045-2c3bc3c514ed'
Using Kerberos : curl -u AD_USERNAME:AD_PASSWORD https://secure.nomadesk.com/ctrller/api.php?Task=Logon
RESPONSE
<Response>
    <Status>1</Status>
    <Message></Message>
    <Token>realorgc0vl7jtipak1qra1nc3</Token>
    <AccountInfo>
        <FirstName>api</FirstName>
        <LastName>003</LastName>
        <Email>api@nomadesk.com</Email>
        <Language>en-us</Language>
        <BrandingID>NMD</BrandingID>
        <IsTrial>true</IsTrial>
    </AccountInfo>
</Response>

2. With an access token

Logon with an access token is done like this:

Input Parameter Type Description
AccessToken* String
Password String Only required when the AccessToken is password protected
Output Parameter Type Description
Token String Security token
StorageAPIUrl URL Link to the correct storage server for the fileserver
FileserverName String Name of the fileserver
Path Path
Subject String
Message String
ExpiryDstamp TimeStamp
Sender String FirstName & LastName or Emailaddress of the account that created the AccessToken
ShowSubDirs Boolean Indicates access to subdirs

*=required

CURL EXAMPLE
curl -v 'https://example.com/ctrller/api.php?Task=Logon&AccessToken=49fe57c9-f467-0995-78eb-20444c8c6931'
RESPONSE
<Response>
    <Status>1</Status>
    <Message></Message>
    <Token>255mrbr0bff3ruqocshp37e576</Token>
    <AccessInfo>
        <StorageAPIUrl>https://example.com/storage/api.php</StorageAPIUrl>
        <Email>sender@example.com</Email>
        <FileserverName>nmsa000164</FileserverName>
        <Path>/dir</Path>
        <Subject>subjectmsg</Subject>
        <Sender>Firstname Lastname</Sender>
        <Message>messagetext</Message>
        <AccessType>ReadOnly</AccessType>
        <ExpiryDstamp>2009-10-29 10:46:46</ExpiryDstamp>
    </AccessInfo>
</Response>

In case you log on with an Access Token for a widget you’ll get a response in the following format:

<Response>
    <Status>1</Status>
    <Message></Message>
    <Token>255mrbr0bff3ruqocshp37e576</Token>
    <AccessInfo>
        <StorageAPIUrl>https://storage001.example.com/storage/api.php</StorageAPIUrl>
        <FileserverName>nmsa000164</FileserverName>
        <Path>/dir</Path>
        <Sender>Firstname Lastname</Sender>
        <WebsiteUrl>http://mysite.com</WebsiteUrl>
        <LogoUrl>http://mysite.com/images/mylogo.png</LogoUrl>        
    </AccessInfo>       
</Response>

4. With SAML

Input Parameter Type Description
AuthMethod* String must be SAML
Email* String email address to log in using saml
ShortUrl String optional short url, direct link to the IDP
Output Parameter Type Description
Token String Security token, False on failure
Account AccountInfo

*=required

CURL EXAMPLE
https://example.com/ctrller/api.php?Task=Logon&AuthMethod=SAML&Email=email@example.com
RESPONSE
<Response>
    <Status>1</Status>
    <Message></Message>
    <Token>realorgc0vl7jtipak1qra1nc3</Token>
    <AccountInfo>
        <FirstName>myFirstName</FirstName>
        <LastName>myLastName</LastName>
        <Email>email@example.com</Email>
        <Language>en-us</Language>
        <BrandingID>NMD</BrandingID>
        <IsTrial>true</IsTrial>
    </AccountInfo>
</Response>

5. With AMS username and password

Input Parameter Type Description
AMSUsername* String Account user/email
AMSPassword* String Account password
Remember Boolean Optionally return a rember token if allowed (see password policy)
Output Parameter Type Description
Token String Security token, False on failure
Account AccountInfo

*=required

CURL EXAMPLE
curl -v 'https://example.com/ctrller/api.php?Task=Logon&AMSUsername=user@example.com&AMSPassword=password'
RESPONSE
<Response>
  <Status>1</Status>
  <Message>Success</Message>
  <Token>realorgc0vl7jtipak1qra1nc3</Token>

  <MobileDeviceControlSettings>
    <IdleLogoutTimer>0</IdleLogoutTimer>
    <AllowLocalCache>true</AllowLocalCache>
    <AllowVaultRemoval>true</AllowVaultRemoval>
    <AllowOpenWith>true</AllowOpenWith>
    <AllowRememberMe>true</AllowRememberMe>
  </MobileDeviceControlSettings>

  <Type>AMS</Type>
</Response>

6. With AuthToken

Authtoken is an authentication token used in combination with 'Remember Me'

When logging on with email/password or with ams username and password an optional Remember=true can be passed,
when used a token will be returned that can be used for 14days.

Input Parameter Type Description
AuthToken* String Account email
Email* String Account password
Context* String Code generated with the Google Authenticator app
Output Parameter Type Description
Token String Security token, False on failure
Account AccountInfo

*=required

CURL EXAMPLE
    curl -v 'https://example.com/ctrller/api.php?Task=Logon&Email=user@example.com&Context=EmailPassword&AuthToken=abb607910c5edca6b4b7eb7fa3721a508117862ca6f10a083a0fdea134ed8cfcec35cc5df0d1c8f81cf11a9551de35677ef6c8d81f852f162edd4d8a3754849b'
RESPONSE
    <Response>
        <Status>1</Status>
        <Message></Message>
        <Token>realorgc0vl7jtipak1qra1nc3</Token>
        <AccountInfo>
            <FirstName>api</FirstName>
            <LastName>003</LastName>
            <Email>api@nomadesk.com</Email>
            <Language>en-us</Language>
            <BrandingID>NMD</BrandingID>
            <IsTrial>true</IsTrial>
        </AccountInfo>
    </Response>

7. Optional: Logon with two-factor authentication

Input Parameter Type Description
Email* String Account email
Password* String Account password
TwoFactorCode* Integer Code generated with the Google Authenticator app
Output Parameter Type Description
Token String Security token, False on failure
Account AccountInfo

*=required

CURL EXAMPLE
curl -v 'https://secure.nomadesk.com/ctrller/api.php?Task=Logon&Email=api@nomadesk.com&Password=password&TwoFactorCode=123456'
RESPONSE
<Response>
    <Status>1</Status>
    <Message></Message>
    <Token>realorgc0vl7jtipak1qra1nc3</Token>
    <AccountInfo>
        <FirstName>api</FirstName>
        <LastName>003</LastName>
        <Email>api@nomadesk.com</Email>
        <Language>en-us</Language>
        <BrandingID>NMD</BrandingID>
        <IsTrial>true</IsTrial>
    </AccountInfo>
</Response>