Get Features by Project
1 min
GET
https://api.optimizely.com/v2/features
Query Parameters
- per_pageintegerDescriptionDefault25Maximum100
- pageintegerDescriptionDefault1
- project_idinteger<int64>requiredDescriptionFormatint64
Responses
200
- Feature[]
- archivedbooleanDescriptionDefaultfalse
- createdstring<date-time>DescriptionFormatdate-time
- descriptionstringDescription
- environmentsmap<string, FeatureEnvironment>Description
- idinteger<int64>DescriptionFormatint64
- keystringrequiredExampleDescriptionMax Length64Pattern^[a-zA-Z0-9_\-]+$
- last_modifiedstring<date-time>DescriptionFormatdate-time
- namestringExampleDescription
- project_idinteger<int64>requiredDescriptionFormatint64
- variablesFeatureVariable[]Description
- archivedbooleanDescriptionDefaultfalse
- default_valuestringrequiredExampleDescription
- idinteger<int64>DescriptionFormatint64
- keystringrequiredDescription
- typestring<boolean | string | double | integer | json>requiredExampleDescriptionAllowedbooleanstringdoubleintegerjson
401
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
403
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
default
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
curl
curl --request GET \
--url 'https://api.optimizely.com/v2/features?per_page=25&page=1&project_id=integer%3Cint64%3E' \
--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.optimizely.com/v2/features?per_page=25&page=1&project_id=integer<int64>", 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.optimizely.com/v2/features?per_page=25&page=1&project_id=integer<int64>")
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.optimizely.com/v2/features?per_page=25&page=1&project_id=integer<int64>"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Return all Features in a specified Project
[
{
"archived": false,
"created": "",
"description": "",
"environments": "",
"id": "",
"key": "new_checkout_page",
"last_modified": "",
"name": "the checkout feature",
"project_id": "",
"variables": [
{
"archived": false,
"default_value": "0.05",
"id": "",
"key": "",
"type": "double"
}
]
}
]401
// Invalid credentials
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}403
// You do not have permission to access to the Features in the specified Project
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}default
// Unexpected error
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}