Skip to main content
Question

Cannot rename and move a file or folder with PUT update: 405 response

  • May 22, 2025
  • 1 reply
  • 16 views

Forum|alt.badge.img

API calls are made with Postman:

cUrl version:

curl --location --request PUT 'https://upload.box.com/api/2.0/folders/12858XXX9798' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer R3Tw4fOBrEPlGl3k7mxxx0Ty0yE41PeP' \
--data-raw '{
"name": "New folder name"
}'

Okhttp version (my case in my app):

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"name\": \"New folder name\"\r\n }");
Request request = new Request.Builder()
.url("https://upload.box.com/api/2.0/folders/12858XXX9798")
.method("PUT", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer R3Tw4fOBrEPlGl3k7mxxx0Ty0yE41PeP")
.build();
Response response = client.newCall(request).execute();

The call has exactly the same structure as on: https://developer.box.com/reference/put-folders-id/ 

Response : 405 method not allowed??

Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
Allow: OPTIONS, POST, GET, HEAD
Strict-Transport-Security: max-age=31536000

Method PUT not allowed???

I have tried with POST: return 415!

After spending hours on this simple call ... I wonder if there is not a problem with your server?

Note that I have no problem with all my other requests: uploads, chunk uploads, list, delete, copy etc ...

Any help would be really appreciated.

Thank you in advance.

 

1 reply

Forum|alt.badge.img

I'm tracing this thread back because I still don't have an answer.
Thanks