title: Pulling categories from store via BigCommerce restful API
body: <p>I am tring to pull categories from my store on BigCommerce via API.</p>
  
  <p>When I try my credentials at API Console;
  <a href="https://developer.bigcommerce.com/console" rel="nofollow">https://developer.bigcommerce.com/console</a></p>
  
  <p>it is working fine, but I when send credentials via C# post request it does not work.</p>
  
  <p>I am receiving <code>[{"status":401,"message":"No credentials were supplied in the request."}]</code></p>
  
  <p>My code is like;</p>
  
  <pre><code>List&lt;PostCredential&gt; postCredentials = new List&lt;PostCredential&gt;();
  postCredentials.Add(new PostCredential { name = "store_url", value = ApiPath });
  postCredentials.Add(new PostCredential { name = "username", value = Username });
  postCredentials.Add(new PostCredential { name = "api_key", value = ApiToken });
  JavaScriptSerializer serializer = new JavaScriptSerializer();
  string serialize = serializer.Serialize(postCredentials);
  const string requestUrl = "https://myteststore1234.mybigcommerce.com/api/v2/categories.json";
  
  StringBuilder postData = new StringBuilder();
  postData.Append(serialize);
  string postRequest = PostRequest(requestUrl, postData.ToString());
  
  public static string PostRequest(string url, string postData)
  {
    HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create(url);
    ASCIIEncoding encoding = new ASCIIEncoding();
    byte[] data = encoding.GetBytes(postData);
    httpWReq.Method = "POST";
    httpWReq.ContentType = "application/x-www-form-urlencoded";
    httpWReq.ContentLength = data.Length;
    using (Stream stream = httpWReq.GetRequestStream())
    {
      stream.Write(data, 0, data.Length);
    }
    HttpWebResponse response = (HttpWebResponse)httpWReq.GetResponse();
    Stream responseStream = response.GetResponseStream();
    if (responseStream != null)
    {
      string responseString = new StreamReader(responseStream).ReadToEnd();
      return responseString;
    }
    return null;
  }
  </code></pre>
  
  <p>is there any workaround for this?</p>