Get a microsnippet response
1 min
GET
https://optimizely-edge.com/edge-client/v1/{accountId}/{projectId}
accountIdstringOptimizely Account ID
projectIdstringProject ID of the Performance Edge project.
extend_cookie_lifetimestring<p>Whether or not the snippet should extend cookies. Defaults to true.</p>
<p>Only has an effect on cookies which are already set, according to the Cookie header value. If it has not been set before, the cookie is set regardless of this parameter value.</p>
<p>Currently, this only affects the "OptimizelyEndUserId" cookie.</p>
urlstring<p>Document URL requested, which is used to determine the active pages(s)/experiment(s)</p>
<p>Needs to be passed encoded.</p>
Cookiestring<p>Cookies set on the requested domain. For cookie targeting, userId derivation, bucketing. Include any cookies that your users may want to use to define visitor audiences.</p>
<p>At a minimum, must include the value of the optimizelyEndUserId cookie, if set. If unset, the JavaScript response will instruct the browser to set that cookie on the user’s device.</p>
<p><strong>NOTE</strong> Please review our <a href="https://help.optimizely.com/Account_Settings/PII%3A_Personally_identifiable_information_in_Optimizely" target="_blank">guidance on usage of PII</a> with Optimizely Products.</p>
Refererstring<p>Document URL requested, which is used to determine the active pages(s)/experiment(s), if the “url” query parameter is not specified.</p>
<p>In typical implementations, the Referer header in the script request will equal the URL of the page on which the script was loaded.</p>
User-Agentstring<p>User Agent used to make the request. Optimizely Edge will only serve the JavaScript response to browsers that are detected as having support for it, using this value. Also used for browser, device, platform targeting (<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent" target="_blank">Reference</a>)</p>
X-Forwarded-Forstring<p>A comma-separated list of IP addresses, the first of which will be used as the basis for IP Address and Location experiment targeting. (<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For" target="_blank">Reference</a>)</p>
200Successful response supplies JavaScript code for microsnippet
403Request made not using HTTPS
405Invalid input
curl --request GET \
--url https://optimizely-edge.com/edge-client/v1/{accountId}/{projectId} \
--header 'accept: application/json' \
--cookie string \
--header 'referer: string' \
--header 'user-agent: string' \
--header 'x-forwarded-for: string'