REST API Reference Version 5.2.1.0Search

Create

POST v1/tokens

Description

Create a user session token.

Normal Response Codes

201

HTTP Error Codes

400 401 403 404 409 500 503

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"
   }
}