Create

POST v1/tokens

Description

Create a user session token.

Normal Response Codes

201

HTTP Error Codes

400 401 403 404 409 500 503

Detail Codes

SM_auth

SM_cannot_read_object

SM_invalid_arg_value

SM_invalid_path_variable

SM_invalid_query_param

SM_malformed_url

SM_missing_arg

SM_no_method_for_URL_pattern

SM_no_operation_found

SM_no_path_found

SM_session_create

SM_unexpected_arg

SM_unexpected_child

SM_unexpected_query_param

SM_version_name

Request

Parameter Type JSON Type Description Default Mandatory Deprecated
username NsDomainUser string User name for the session. Active Directory username. String up to 104 printable characters. Example: 'joe-91'.   true  
password NsDomainPassword string Password for the user. A password is required for creating a token. Active Directory user password. String up to 255 printable characters. Example: 'password-91'.   false  
app_name NsAppName string Application name. String of 0-255 printable ASCII characters. Example: 'GUI'. '' false  
source_ip NsIPAddress string IP address from which the session originates. Four numbers in the range [0,255] separated by periods. Example: '128.0.0.1'. The source IP address obtained from the socket information. false  

JSON Request


            

{
   "data" : {
      "password" : "admin",
      "username" : "admin"
   }
}

      
         

Response

Parameter Type JSON Type Description Deprecated
id NsObjectID string Object identifier for the session token. A 42 digit hexadecimal number. Example: '2a0df0fe6f7dc7bb16000000000000000000004817'.  
session_token NsToken string Token used for authentication. String of 31 or 32 alphanumeric characters. Example: '9f53a789f1e9eae7b9385f4d8873fb1'.  
username NsDomainUser string User name for the session. Active Directory username. String up to 104 printable characters. Example: 'joe-91'.  
app_name NsAppName string Application name. String of 0-255 printable ASCII characters. Example: 'GUI'.  
source_ip NsIPAddress string IP address from which the session originates. Four numbers in the range [0,255] separated by periods. Example: '128.0.0.1'.  
creation_time NsTime number Time when this token was created. Seconds since last epoch i.e. 00:00 January 1, 1970. Example: '3400'.  
last_modified NsTime number Time when this token was last modified. Seconds since last epoch i.e. 00:00 January 1, 1970. Example: '3400'.  

JSON Response


            

{
   "data" : {
      "app_name" : "",
      "session_token" : "1c1cfbac915f84816abbfda1280b9387",
      "last_modified" : 1426802065,
      "id" : "1900000000000004d3000000000000000000000002",
      "creation_time" : 1426802065,
      "username" : "admin",
      "source_ip" : "127.0.0.1"
   }
}