PATCH /folders/{id}
1 min
PATCH
https://api.cmp.optimizely.com/v3/folders/{id}
Path Parameters
- idstringrequiredExampleDescription
Body Parameters
- bodyFolderUpdateRequestrequiredDescription
- object
- object
Responses
200
- FolderResponse
- idstringrequiredExampleDescription
- namestringrequiredExampleDescription
- parent_folder_idstringrequiredExampleDescription
- pathstringrequiredExampleDescription
- created_atstring<date-time>requiredExampleDescriptionFormatdate-time
- modified_atstring<date-time>requiredExampleDescriptionFormatdate-time
- linksobjectrequiredDescription
- selfstringrequiredExampleDescription
- parent_folderstringrequiredExampleDescription
- child_foldersstringrequiredExampleDescription
- assetsstringrequiredExampleDescription
400
- ErrorExample
{ "message": "Unsupported arguments: a,b,c" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
401
- ErrorExample
{ "message": "Unauthorized" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
403
- ErrorExample
{ "message": "You do not have the permission to perform this operation" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
404
- ErrorExample
{ "message": "Resource not found" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
curl
curl --request PATCH \
--url https://api.cmp.optimizely.com/v3/folders/{id} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.cmp.optimizely.com/v3/folders/{id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.cmp.optimizely.com/v3/folders/{id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.cmp.optimizely.com/v3/folders/{id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Updated Folder
{
"id": "5d7f910551b00a722e0418830cee6632",
"name": "icons",
"parent_folder_id": "1d9d8aeca10811ebbc640242ac12001b",
"path": "/images/icons",
"created_at": "2019-10-06T13:15:30Z",
"modified_at": "2019-10-07T13:15:30Z",
"links": {
"self": "https://api.cmp.optimizely.com/v3/folders/5d7f910551b00a722e0418830cee6632",
"parent_folder": "https://api.cmp.optimizely.com/v3/folders/1d9d8aeca10811ebbc640242ac12001b",
"child_folders": "https://api.cmp.optimizely.com/v3/folders?parent_folder_id=5d7f910551b00a722e0418830cee6632",
"assets": "https://api.cmp.optimizely.com/v3/assets?folder_id=5d7f910551b00a722e0418830cee6632&include_subfolder_assets=false"
}
}400
// Client error
{
"message": "Not found",
"errors": ""
}401
// Authorization error
{
"message": "Not found",
"errors": ""
}403
// Permission error
{
"message": "Not found",
"errors": ""
}404
// Not found error
{
"message": "Not found",
"errors": ""
}