Hi,
I am trying to authenticate to my Rest API. Here is my site:
http://www.jmawebtechnologies.com/rest/ecommerce.sku/all
I am using my administrator user name and password, but I get a 401.1 authorized error. What user name and password do I use? I have basic as the authentication setting in the Kentico admin. Here is my code:
public List<COM_SKU> GetAllSKUS()
{
HttpClientHandler handler = new HttpClientHandler();
handler.Credentials = new NetworkCredential(m_UserName, m_Password);
HttpClient client = new HttpClient(handler)
{
BaseAddress = new Uri(m_BaseUrl),
};
string url = String.Format("/rest/ecommerce.sku/all");
HttpResponseMessage response = client.GetAsync(url).Result;
if (response.IsSuccessStatusCode)
{
List<COM_SKU> result = response.Content.ReadAsAsync<List<COM_SKU>>().Result;
return result;
}
return null;
}