Return the Optimizely config for the given environment
1 min
GET
/v1/config
Responses
200
- OptimizelyConfig
- environmentKeystring
- sdkKeystring
- revisionstring
- experimentsMapmap<string, OptimizelyExperiment>
- featuresMapmap<string, OptimizelyFeature>
- attributesOptimizelyAttribute[]
- idstring
- keystring
- audiencesOptimizelyAudience[]
- idstring
- namestring
- conditionsstring
- eventsOptimizelyEvent[]
- idstring
- keystring
- experimentIdsstring[]
401
403
- Error
- errorstring
curl
curl --request GET \
--url /v1/config \
--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("/v1/config", 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("/v1/config")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "/v1/config"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Valid response
{
"environmentKey": "",
"sdkKey": "",
"revision": "",
"experimentsMap": "",
"featuresMap": "",
"attributes": [
{
"id": "",
"key": ""
}
],
"audiences": [
{
"id": "",
"name": "",
"conditions": ""
}
],
"events": [
{
"id": "",
"key": "",
"experimentIds": [
""
]
}
]
}401
// Unauthorized, invalid JWT
403
// You do not have necessary permissions for the resource
{
"error": ""
}