{ "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\": \"\\n\"\n }\n ]\n}", "response_content_type": "application/json", "curl": "curl -g \"https://www.example.com/api/storefront/system_content/home_page?sessions=1\" -X GET " }, { "request_headers": { }, "request_query_parameters": { "sessions": "2" }, "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": "30666cef-8a67-4268-a8cf-eb13f27a4bec", "X-Runtime": "0.006299", "X-Workarea-Segments": "returning_visitor", "Expires": "0", "Content-Length": "1011" }, "request_method": "GET", "request_path": "/api/storefront/system_content/home_page?sessions=2", "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\": \"5dddc8991241596aa5204b59\",\n \"type\": \"text\",\n \"area\": \"default\",\n \"data\": {\n \"text\": \"Welcome back!\"\n },\n \"hidden_breakpoints\": [\n\n ],\n \"position\": 1,\n \"html\": \"\\n\"\n }\n ]\n}", "response_content_type": "application/json", "curl": "curl -g \"https://www.example.com/api/storefront/system_content/home_page?sessions=2\" -X GET " } ], "resource": "Segmentation", "description": "Specifying session count for segmentation", "route": "/api/storefront/system_content/home_page", "explanation": "

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).

\n\n

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.

\n\n

This example shows getting a home page with segmented content based
\non the number of sessions.

\n", "http_method": "GET" }