A UserKey can be used to authenticate in lieu of a Username and Password. Additionally, a UserKey remains constant, whereas a password will change periodically. So it is important to obtain a UserKey for long-term repeated authentication.
When calling the method '/authenication', you will want to use Basic Authentication (see: Authentication Methods).
There are no required parameters or query strings, so this call is as simple as it gets!
Note: The APIKey used in this example will not work on this method. If you do not already have your own set of credentials, you will have to email in a request.
Below is a sample '/authentication' request in C#
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/authentication"); req.Headers[System.Net.HttpRequestHeader.Authorization] = "Basic " + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes("6C135EDF-C37C-4039-AEF3-5DFC079F9E6A:Statementone:sonedemo")); req.Method = "GET"; req.ContentType = "text/xml";
//and here's the response stream.
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
The output will be similar to the following