Update identifier metadata
1 min
POST
https://api.us1.odp.optimizely.com/v3/identifiers
Body Parameters
- bodyUpdateIdentifier[]requiredExamplesExample Payload:
[ { "identifier_value": "[email protected]", "identifier_field_name": "email", "metadata": { "mailbox_provider": "google", "primary_mailbox": true } } ]- identifier_valuestringrequiredDescription
- identifier_field_namestringrequiredDescription
- metadataobject[]
Responses
202
- IdentifierCreatedExample
{ "title": "Accepted", "status": 202, "timestamp": "2019-07-30T23:55:00.519Z" }- eventsobject[]
- namestringExample
- display_namestringExample
- typestringExample
- customersobject[]
- namestringExample
- display_namestringExample
- typestringExample
400
- Error
- titlestringExample
- statusintegerExampleDefault0
- timestampstringExample
- detailobject
- invalidsobject[]
- fieldstringExample
- reasonstringExample
403
curl
curl --request POST \
--url https://api.us1.odp.optimizely.com/v3/identifiers \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '[
{
"identifier_value": "",
"identifier_field_name": ""
}
]'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify([
{
"identifier_value": "",
"identifier_field_name": ""
}
]);
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.us1.odp.optimizely.com/v3/identifiers", 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/identifiers")
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"
request.body = JSON.dump([
{
"identifier_value": "",
"identifier_field_name": ""
}
])
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.us1.odp.optimizely.com/v3/identifiers"
payload = json.dumps([
{
"identifier_value": "",
"identifier_field_name": ""
}
])
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
202
// Accepted
{
"events": [
{
"name": "event_facebook_messenger_id",
"display_name": "Event Facebook Messenger ID",
"type": "identifier"
}
],
"customers": [
{
"name": "facebook_messenger_id",
"display_name": "Last Seen Facebook Messenger ID",
"type": "identifier"
}
]
}400
// Bad Request
{
"title": "Bad Request",
"status": 400,
"timestamp": "2018-08-07T13:44:17.659Z",
"detail": {
"invalids": [
{
"field": "name",
"reason": "already used by another object"
}
]
}
}403
// Forbidden