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.
Get Security Token
Note: This topic is for REST Version 1. There is also an API for REST Version 1.

Parameters

Name In Required? Description
config Path Yes This is the name of a configuration available on the application server.
username Path Yes This is the username for the Mongoose user.
password Path No This is 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;
   }
}