PATCH /fields/{id}
1 min
PATCH
https://api.cmp.optimizely.com/v3/fields/{id}
Path Parameters
- idstringrequiredExampleDescription
Body Parameters
- bodySettingsFieldUpdateRequestrequiredDescription
- objectBaseSettingsFieldUpdatePayload
- typestringrequiredDescription
- namestringExampleDescriptionMin Length1
- helper_textstringExampleDescriptionMax Length120
- is_activebooleanExampleDescription
- objectLabelAndDropdownTypeSettingsFieldUpdatePayload
- typestringrequiredDescription
- namestringExampleDescriptionMin Length1
- helper_textstringExampleDescriptionMax Length120
- is_activebooleanExampleDescription
- is_multi_selectbooleanDescription
- objectGenericNumberTypeSettingsFieldUpdatePayload
- typestringrequiredDescription
- namestringExampleDescriptionMin Length1
- helper_textstringExampleDescriptionMax Length120
- is_activebooleanExampleDescription
- has_thousand_separatorbooleanExampleDescriptionDefaultfalse
- decimal_placesintegerExampleDescriptionDefault2
- objectCurrencyNumberTypeSettingsFieldUpdatePayload
- typestringrequiredDescription
- namestringrequiredExampleDescriptionMin Length1
- helper_textstringrequiredExampleDescriptionMax Length120
- is_activebooleanrequiredExample
- has_thousand_separatorbooleanrequiredExampleDescriptionDefaultfalse
- decimal_placesintegerrequiredExampleDefault2
- currency_codestringExampleDescriptionDefaultUSD
Responses
204
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
422
- ErrorExample
{ "message": "Resource cannot be processed" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
curl
curl --request PATCH \
--url https://api.cmp.optimizely.com/v3/fields/{id} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"type": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"type": ""
});
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.cmp.optimizely.com/v3/fields/{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/fields/{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"
request.body = JSON.dump({
"type": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.cmp.optimizely.com/v3/fields/{id}"
payload = json.dumps({
"type": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
204
// Updated field in an Organization
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": ""
}422
// Unprocessable entity error
{
"message": "Not found",
"errors": ""
}