Update Object
1 min
POST
https://api.us1.odp.optimizely.com/v3/objects/{object_name}
Path Parameters
- object_namestringrequiredDescription
Body Parameters
- bodyObject[]requiredExamplesExample Payload:
[ { "primary_key": 123, "field_example": true }, { "primary_key": 456, "field_example": false } ]
Responses
202
- GenericUpdateResponse
- titlestring
- statusinteger<int32>Formatint32
- timestampstring
400
- 40xResponseExample
{ "title": "Bad Request", "status": 400, "timestamp": "2018-09-10T21:07:10-05:00", "detail": { "invalids": [ { "field": "delimiter", "reason": "Unrecognized delimiter, valid options are comma, tab or pipe" } ] } }- titlestring
- statusinteger<int32>Formatint32
- timestampstring
- detailobject
- invalidsobject[]
- eventinteger
- messagestring
403
- 403ResponseExample
{ "message": "Forbidden" }- messagestring
404
- 40xResponseExample
{ "title": "Bad Request", "status": 404, "timestamp": "2018-09-10T21:07:10-05:00", "detail": { "message": "Not found description" } }- titlestring
- statusinteger<int32>Formatint32
- timestampstring
- detailobject
- invalidsobject[]
- eventinteger
- messagestring
curl
curl --request POST \
--url https://api.us1.odp.optimizely.com/v3/objects/{object_name} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.us1.odp.optimizely.com/v3/objects/{object_name}", 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.us1.odp.optimizely.com/v3/objects/{object_name}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.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.us1.odp.optimizely.com/v3/objects/{object_name}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
202
// Accepted
{
"title": "",
"status": "",
"timestamp": ""
}400
// Bad Request
{
"title": "",
"status": "",
"timestamp": "",
"detail": {
"invalids": [
{
"event": 0,
"message": ""
}
]
}
}403
// Forbidden
{
"message": ""
}404
// Not Found
{
"title": "",
"status": "",
"timestamp": "",
"detail": {
"invalids": [
{
"event": 0,
"message": ""
}
]
}
}