Skip to main content

PUT /files/{id}

Description

Updates the name of a file and returns a JSON object with the result data

The route handles the HTTP PUT request made to the /files/{id} path.

Parameters

The following path parameters are sent in the request line:

  • id (string) - (required) a path to the file

Payload

The server needs to receive a JSON object with the operation name and new name for a file:

  • operation (string) - (required) the operation name which is "rename"
  • name (string) - (required) a new name of a file

Example:

{ 
operation: "rename",
name: "New name"
}

Response

The server returns a JSON object with the result data for a file (file id and new name):

Example:

{
result:
{
id:"/New name",
name:"New name"
}
}

The HTTP status code shows whether the request succeeds (response.status == 200) or fails (response.status == 500). In case of a failure the error text is returned.


Related articles: