Get Plan & Usage information for all products
1 min
GET
https://api.optimizely.com/v2/plan
Responses
200
- Plan
- account_idinteger<int64>ExampleDescriptionFormatint64
- plan_namestringExampleDescription
- product_usagesProductUsage[]Description
- allocation_term_in_monthsinteger<int64>ExampleDescriptionFormatint64
- end_timestring<date-time>DescriptionFormatdate-time
- last_update_timestring<date-time>DescriptionFormatdate-time
- overage_cents_per_visitornumber<float>ExampleDescriptionFormatfloat
- product_namestring<Optimizely X AB Testing | Classic AB Testing | Personalization | Mobile | Full Stack | Recommendations | Over The Top | Impressions>DescriptionAllowedOptimizely X AB TestingClassic AB TestingPersonalizationMobileFull StackRecommendationsOver The TopImpressions
- projectsmap<string, integer>Description
- start_timestring<date-time>DescriptionFormatdate-time
- usageinteger<int64>ExampleDescriptionFormatint64
- usage_allowanceinteger<int64>ExampleDescriptionFormatint64
- statusstring<trial | active | inactive>DescriptionAllowedtrialactiveinactive
- unit_of_measurementstring<Monthly Unique Visitors | Impressions>DescriptionAllowedMonthly Unique VisitorsImpressions
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/plan \
--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/plan", 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/plan")
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/plan"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Return Plan & Usage information
{
"account_id": 1234567,
"plan_name": "Enterprise - Premium Optimizely X Web",
"product_usages": [
{
"allocation_term_in_months": 6,
"end_time": "",
"last_update_time": "",
"overage_cents_per_visitor": 0.001,
"product_name": "",
"projects": "",
"start_time": "",
"usage": 12345,
"usage_allowance": 123456
}
],
"status": "",
"unit_of_measurement": ""
}401
// Invalid credentials
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}403
// You do not have permission to access Plan & Usage information
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}default
// Unexpected error
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}