Fetch a Single Report
1 min
GET
https://api.optimizely.com/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}
Path Parameters
- project_idintegerrequiredExampleDescription
- environment_keystringrequiredExampleDescription
- report_keystringrequiredExampleDescription
Responses
200
- ReportDescription
- archive_urlobjectDescription
- UrlValue
- archivedbooleanDescription
- created_timestring<date-time>requiredExampleDescriptionFormatdate-time
- delete_urlobjectDescription
- UrlValue
- descriptionstringExampleDescription
- distribution_modestring<manual | stats_accelerator>DescriptionAllowedmanualstats_accelerator
- end_timestring<date-time>ExampleDescriptionFormatdate-time
- fetch_flag_urlobjectDescription
- UrlValue
- fetch_results_api_urlobjectDescription
- UrlValue
- fetch_results_ui_urlobjectDescription
- UrlValue
- flag_keystringrequiredExampleDescription
- flag_namestringExampleDescription
- flag_statestring<enabled | disabled | unarchived | archived | deleted>ExampleDescriptionAllowedenableddisabledunarchivedarchiveddeleted
- idintegerrequiredExampleDescription
- keystringrequiredExampleDescription
- layer_experiment_idintegerDescription
- namestringrequiredExampleDescription
- primary_metricstringExampleDescription
- reset_results_urlobjectDescription
- UrlValue
- revisionintegerDescription
- rolestringExampleDescription
- rule_descriptionstringExampleDescription
- rule_keystringrequiredExampleDescription
- rule_namestringExampleDescription
- rule_statestringExampleDescription
- start_timestring<date-time>ExampleDescriptionFormatdate-time
- typestring<a/b | multi_armed_bandit | feature_rollout>requiredExampleDescriptionAlloweda/bmulti_armed_banditfeature_rollout
- unarchive_urlobjectDescription
- UrlValue
- updated_timestring<date-time>requiredExampleDescriptionFormatdate-time
- urlobjectrequiredDescription
- UrlValue
- urnstringrequiredExampleDescription
400
401
403
404
curl
curl --request GET \
--url https://api.optimizely.com/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key} \
--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/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}", 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/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}")
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/flags/v1//projects/{project_id}/environments/{environment_key}/reports/{report_key}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Successful retrieval of a Report.
The response includes RESTful JSON (https://restfuljson.org/) styled links. If a
link is not present in the response, it indicates a user is not authorized to access
the related resource.
{
"archive_url": {},
"archived": false,
"created_time": "2019-05-08T00:00:00.000Z",
"delete_url": {},
"description": "Detailed context about the report is here.",
"distribution_mode": "",
"end_time": "2019-05-08T00:00:00.000Z",
"fetch_flag_url": {},
"fetch_results_api_url": {},
"fetch_results_ui_url": {},
"flag_key": "recurring_deposit",
"flag_name": "Recurring Deposit",
"flag_state": "unarchived",
"id": 45633910,
"key": "paid_users-45633910",
"layer_experiment_id": 0,
"name": "Paid Users",
"primary_metric": "conversion_rate",
"reset_results_url": {},
"revision": 0,
"role": "admin",
"rule_description": "Paid Users description",
"rule_key": "paid_users",
"rule_name": "Paid Users",
"rule_state": "deleted",
"start_time": "2019-05-08T00:00:00.000Z",
"type": "a/b",
"unarchive_url": {},
"updated_time": "2019-05-08T00:00:00.000Z",
"url": {},
"urn": "reports.flag.optimizely.com::45633910"
}400
// Malformed requests and invalid parameter names and types
401
// Invalid credentials
403
// Do not have permission to perform the operation
404
// Not found. No content