Read a page
1 min
GET
https://api.optimizely.com/v2/pages/{page_id}
Path Parameters
- page_idinteger<int64>requiredDescriptionFormatint64
Responses
200
- Page
- activation_codestringExampleDescription
- activation_typestring<immediate | manual | polling | callback | dom_changed | url_changed>ExampleDescriptionAllowedimmediatemanualpollingcallbackdom_changedurl_changed
- archivedbooleanDescriptionDefaultfalse
- categorystring<article | cart | category | checkout | home | landing_page | pricing | product_detail | search_results | other>DescriptionDefaultotherAllowedarticlecartcategorycheckouthomelanding_pagepricingproduct_detailsearch_resultsother
- conditionsstringExample
[ "and", { "type": "url", "match_type": "substring", "value": "optimize" } ]Description - createdstring<date-time>DescriptionFormatdate-time
- edit_urlstringrequiredExampleDescription
- idinteger<int64>ExampleDescriptionFormatint64
- keystringExampleDescriptionMax Length500Pattern^[a-zA-Z0-9_]+$
- last_modifiedstring<date-time>DescriptionFormatdate-time
- namestringrequiredExampleDescription
- page_typestring<single_url | url_set | global>DescriptionAllowedsingle_urlurl_setglobal
- project_idinteger<int64>requiredExampleDescriptionFormatint64
- single_usebooleanDescription
400
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
401
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
403
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
404
- 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/pages/{page_id} \
--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/pages/{page_id}", 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/pages/{page_id}")
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/pages/{page_id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Return Page info
{
"activation_code": "function callbackFn(activate, options) { activate(); }",
"activation_type": "callback",
"archived": false,
"category": "",
"conditions": "[\"and\", {\"type\": \"url\", \"match_type\": \"substring\", \"value\": \"optimize\"}]",
"created": "",
"edit_url": "https://www.optimizely.com",
"id": 4000,
"key": "home_page",
"last_modified": "",
"name": "Home Page",
"page_type": "",
"project_id": 1000,
"single_use": false
}400
// Invalid ID supplied
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}401
// Invalid credentials
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}403
// You do not have permission to access the specified page
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}404
// Page not found
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}default
// Unexpected error
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}