GetTokenUserNamePassword – To be Deprecated, use GetToken instead
Used to retrieve an encryptedToken based on user credentials as opposed to an encrypted API key.
URI GET rest/v1/tokenusernamepassword/{userName}/{salt}
Returns – A RequestResponse containing the encryptedToken string in the ReturnValue property. The encryptedToken will be an encrypted value of your token. This will be sent with almost every call to the web service regarding user handling and session creation. (See RequestResponse in Appendix B)
Parameters
Name | Type | Description |
---|---|---|
username | string | Required. User’s username, their email address. |
encryptedPassword | string | Required. The encrypted password for the user. |
salt | string | Required. Any combination of text and numbers that was used to encrypt the plain text password into encryptedPassword. |
Example – C#
[gdlr_notification icon=”none” type=”color-border” border=”#31BEF9″ color=”#000000″]
string uri = “rest/v1/tokenusernamepassword/{0}/{1}”;
string salt = “Z1s6aXNQpjQ75wRX1ulI551sR1uHyg3YsOcPLeL9TaM”;
string responseString = string.Empty;
JavaScriptSerializer jss = new JavaScriptSerializer();
RequestResponse requestResponse;
uri = string.Format(uri, userName, salt);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(host + uri);
request.Headers.Add(“Authorization” , encryptedPassword);
request.Method = “GET”;
request.ContentType = “application/json”;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
requestResponse = jss.Deserialize<RequestResponse>(responseString);
[/gdlr_notification]