GetSecurityToken

The GetSecurityToken API returns a Mongoose security token for a specific user, which can be used to authenticate requests when calling the API directly.

Note: This topic is for REST version 2. See GetSecurityToken for the REST version 1.
GET /token/{config}/{username}/{password}
http://localhost/IDORequestService/ido/token/CSI_DALS/sa/Passwe1rd

Parameters

Name In Required? Description
config Path Yes The name of a configuration available on the application server
username Path Yes The username for the Mongoose user
password Path No The password for the Mongoose user

Headers

None

Request data

None

Response data

{
   "Message": null,
   "Success": true,
   "Token": "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…=="
}

Example

This example code retrieves a Mongoose security token that can be used in succeeding requests.

string json = string.Empty;
 
using ( var client = new HttpClient() )
{
   string config = "MG_DEV";
   string username = "sa";
   string password = string.Empty;
   string requestUrl = $"http://server/IDORequestService/ido/token/{config}/{username}/{password}";
 
   // send the get request
   HttpResponseMessage response = client.GetAsync( requestUrl ).Result;
 
   using ( HttpContent content = response.Content )
   {
      Task<string> result = content.ReadAsStringAsync();
      // get the response containing the token
      json = result.Result;
   }
}