Skip to main content
Question

403 Error Attempting to Change Folder Name

  • May 22, 2025
  • 4 replies
  • 12 views

Forum|alt.badge.img

My client setup an account as a co-owner on a Box parent folder where we are creating folders and copying files via the Box API.  We are using the authorization token for that account to connect to Box.  With that account, I can create folders and copy files to it using the API, but I cannot rename or delete a folder that I created with the same account.  I get this error:

{StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
Date: Wed, 16 Jun 2021 12:20:55 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Strict-Transport-Security: max-age=31536000
WWW-Authenticate: Bearer realm="Service", error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token."
BOX-REQUEST-ID: 09b94dcb0b04b74b12e25bd62c84572a6
}}

Here's the Service URL use in the code below: https://api.box.com/2.0/folders/139188030416

Here's the code used to attempt to rename the folder:

using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

//set authorization header based on received bearer token
client.DefaultRequestHeaders.Add("authorization", $"Bearer {authorizationToken}");

var dataContent = "{\"name\": \"" + newFolderName + "\"}";

var content = new StringContent(dataContent, Encoding.UTF8, "application/json");

HttpResponseMessage response = client.PostAsync($"{serviceURL}" + folderId.ToString(), content).Result;

if (response.IsSuccessStatusCode)
return new ResultData("Success", new Dictionary<string, object> { { "Result", response.Content.ReadAsStringAsync().Result } });
else
return new ResultData("Error", new Dictionary<string, object> { { "Result", response.Content.ReadAsStringAsync().Result } });
}

In speaking with the client they are saying that they do not see any options that they can change that would change the behavior.

Any help would be appreciated.

Jacob

4 replies

Forum|alt.badge.img

To add to this--Jacob is using an app account here and getting the error on renaming a folder--even one that he created using the API (with the app account) without issue.

Would anyone have a suggestion on what could be happening here?

Jason


Forum|alt.badge.img

Hey Jason, 

Would you be able to provide me with your application's client ID so I can take a look in our backend logs for you and provide more info? 

Best,

Kourtney, Box Developer Advocate


Forum|alt.badge.img

Thanks for the reply, Kourtney.  Is there an email address I can send this id to?


Forum|alt.badge.img

I just opened a ticket with you through our support channels so we can communicate there!