{ "parameters": [ ], "response_fields": [ ], "requests": [ { "request_headers": { }, "request_query_parameters": { "sessions": "1" }, "response_headers": { "X-Frame-Options": "SAMEORIGIN", "X-XSS-Protection": "1; mode=block", "X-Content-Type-Options": "nosniff", "X-Download-Options": "noopen", "X-Permitted-Cross-Domain-Policies": "none", "Referrer-Policy": "strict-origin-when-cross-origin", "Date": "Wed, 27 Nov 2019 00:51:37 GMT", "Content-Type": "application/json; charset=utf-8", "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "*", "Access-Control-Allow-Methods": "GET, POST, PATCH, PUT, DELETE, OPTIONS", "X-Workarea-Segmented-Content": "true", "X-Requested-With": "", "Vary": "X-Requested-With, X-Workarea-Segments", "Last-Modified": "Wed, 27 Nov 2019 00:51:37 GMT", "Cache-Control": "no-cache, no-store, must-revalidate", "X-Request-Id": "78e758bb-111a-45e9-b45c-38b616e0c18b", "X-Runtime": "0.006550", "X-Workarea-Segments": "first_time_visitor", "Expires": "0", "Content-Length": "1014" }, "request_method": "GET", "request_path": "/api/storefront/system_content/home_page?sessions=1", "request_body": null, "request_content_type": null, "response_status": 200, "response_status_text": "OK", "response_body": "{\n \"id\": \"5dddc8991241596aa5204b57\",\n \"name\": \"Home Page\",\n \"url\": \"http://www.example.com/api/storefront/system_content/Home%20Page\",\n \"browser_title\": \"Home Page\",\n \"meta_description\": \"Shop online for Workarea API products\",\n \"content_blocks\": [\n {\n \"id\": \"5dddc8991241596aa5204b58\",\n \"type\": \"text\",\n \"area\": \"default\",\n \"data\": {\n \"text\": \"Hello visitor!\"\n },\n \"hidden_breakpoints\": [\n\n ],\n \"position\": 0,\n \"html\": \"
Workarea supports segmenting users by number of sessions, e.g.
\nfirst-time vs returning visitors. To support this in the storefront
\nAPI, the client will be responsible for managing this since the API
\nis stateless (doesn't have cookies/session).
To get session-based segments functioning, you need to pass a
\nsessions
parameter in each request. Workarea will use that as
\nthe number of sessions for determing the segments for the response.
\nThis works for all requests across the storefront API.
This example shows getting a home page with segmented content based
\non the number of sessions.