Reputation: 61
I am getting the error
The remote server returned an error: (401) Unauthorized
Here is the the code.
String sFolderURL = @"https://www.box.com/api/";
string Headers = string.Format("BoxAuth api_key={0}&auth_token={1}", api_key, authToken);
String sParam = "2.0/folders/0";
String sURL = sFolderURL + sParam;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sURL);
request.Method = "POST";
request.Headers.Add("Authorization", Headers);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Upvotes: 1
Views: 3825
Reputation: 8705
A 401 is only returned in the case of sending an expired/invalid access_token. You probably need to either
Upvotes: 2