List relations
1 min
GET
https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations
Path Parameters
- object_namestringrequiredDescription
Responses
200
- Relation[]Example
[ { "name": "my_relation", "display_name": "My Relationship", "child_object": "child", "join_fields": [ { "parent": "child_id", "child": "child_id" } ] }, { "name": "my_relation2", "display_name": "My Relationship 2", "child_object": "child", "join_fields": [ { "parent": "child_id", "child": "child_id" } ] } ]- child_objectstringrequiredExampleDescription
- namestringrequiredExampleDescription
- display_namestringrequiredExampleDescription
- public_readstringrequiredDescriptionDefaultfalse
- join_fieldsobject[]
- parentstringrequiredExampleDescription
- childstringExampleDescription
400
- object
403
curl
curl --request GET \
--url https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.us1.odp.optimizely.com/v3/schema/objects/{object_name}/relations", 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/schema/objects/{object_name}/relations")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.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/schema/objects/{object_name}/relations"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// OK
[
{
"child_object": "child",
"name": "relation_name",
"display_name": "Relation Display Name",
"public_read": "",
"join_fields": [
{
"parent": "id",
"child": "child_id"
}
]
}
]400
// Bad Request
{}403
// Forbidden