Home Page > POST api/logon

Gets the token of the account for logging into Governance Automation Online.

Examples

C#

var logonInfo = new
            {
                userName = "I am username",
                passWord = "I am password"
            };
            string url = "https://iamgaoapiurl/api/logon";
            HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(url);
            httpRequest.ContentType = "application/json";
            ServicePointManager.ServerCertificateValidationCallback += ((sender, certificate, chain, sslPolicyErrors) => true);
            httpRequest.Method = "POST";
             
            //Write the login information to the web request.
            System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
            byte[] data = encoding.GetBytes(JsonConvert.SerializeObject(logonInfo));
            httpRequest.ContentLength = data.Length;
            using (Stream requestStream = httpRequest.GetRequestStream())
            {
                requestStream.Write(data, 0, data.Length);
            }
            
            //Get response on the web request from Governance Automation Online Web API.
            string logonToken = string.Empty;
            HttpWebResponse response = (HttpWebResponse)httpRequest.GetResponse();
            using (Stream responseStream = response.GetResponseStream())
            {
                using (StreamReader responseReader = new StreamReader(responseStream, Encoding.UTF8))
                {
                    string reply = responseReader.ReadToEnd();
                    logonToken = JsonConvert.DeserializeObject(reply) as string;               
                }
            };

Body Parameters

LogonModel

Request Information

URI Parameters

NameDescriptionType
userName

Gets or sets the username used to log into Governance Automation Online.

string
passWord

Gets or sets the password used to log into Governance Automation Online.

string

Request Formats

application/json, text/json

Sample:
{
  "userName": "sample string 1",
  "passWord": "sample string 2"
}

application/xml, text/xml

Sample:
<LogonModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.avepoint.com">
  <passWord>sample string 2</passWord>
  <userName>sample string 1</userName>
</LogonModel>

Response Information

string

Response Formats

application/json, text/json

Sample:
"sample string"

application/xml, text/xml

Sample:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">sample string</string>