Update file content
Updates content of file specified by $FILE_ID.
The offset query parameter can be used to start writing from a certain byte
in the file, in such case the file is NOT truncated (bytes beyond the overwritten
fragment will be preserved).
If no offset query is given, the file is truncated and the previous file content
is completely overwritten.
Example cURL requests
Update file content starting from specified offset:
# originally, the file content is "abcdefghijklmno"
curl -H "X-Auth-Token: $TOKEN" \
-X PUT "https://$HOST/api/v3/oneprovider/data/$FILE_ID/content?offset=4" \
-H "Content-Type: application/octet-stream" -d "WXYZ"
# upon success, the file content is "abcdWXYZijklmno"
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Id of the file. |
Query parameters
| Parameter | Type & Description |
|---|---|
| offset | integer Offset at which data sent as request body should be written to file. |
Request body
File content to be written at specified offset.
No schema provided.
Request Examples
cat new_content.txt | oneprovider-rest-cli updateFileContent id=$PARENT_ID -Responses
File content updated successfully.
Invalid request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Forbidden request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}File not found.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Internal server error.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}