{ "parameters": [ ], "response_fields": [ ], "requests": [ { "request_headers": { }, "request_query_parameters": { "session_id": "session_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:36 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:36 GMT", "Cache-Control": "no-cache, no-store, must-revalidate", "X-Request-Id": "f4a84544-444b-49ed-b271-bca835333e42", "X-Runtime": "0.006377", "X-Workarea-Segments": "first_time_customer", "Expires": "0", "Content-Length": "1038" }, "request_method": "GET", "request_path": "/api/storefront/system_content/home_page?session_id=session_1", "request_body": null, "request_content_type": null, "response_status": 200, "response_status_text": "OK", "response_body": "{\n \"id\": \"5dddc8971241596aa5204b4f\",\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\": \"5dddc8981241596aa5204b50\",\n \"type\": \"text\",\n \"area\": \"default\",\n \"data\": {\n \"text\": \"Thanks for your order!\"\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?session_id=session_1\" -X GET " }, { "request_headers": { }, "request_query_parameters": { "session_id": "session_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:36 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:36 GMT", "Cache-Control": "no-cache, no-store, must-revalidate", "X-Request-Id": "11d049a0-74f8-48c0-b300-b71ff108f751", "X-Runtime": "0.006377", "X-Workarea-Segments": "returning_customer", "Expires": "0", "Content-Length": "1059" }, "request_method": "GET", "request_path": "/api/storefront/system_content/home_page?session_id=session_2", "request_body": null, "request_content_type": null, "response_status": 200, "response_status_text": "OK", "response_body": "{\n \"id\": \"5dddc8971241596aa5204b4f\",\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\": \"5dddc8981241596aa5204b51\",\n \"type\": \"text\",\n \"area\": \"default\",\n \"data\": {\n \"text\": \"Welcome back repeat customer!\"\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?session_id=session_2\" -X GET " } ], "resource": "Segmentation", "description": "Using session IDs for segmenting non-authenticated users", "route": "/api/storefront/system_content/home_page", "explanation": "

Workarea supports segmenting users by number of orders, revenue, etc.
\nFor this functionality to work for users without accounts, you'll
\nneed to maintain and pass a session_id consistently throughout calls
\nto the API.

\n\n

An instance of Metrics::User will be found or created for that
\nsession_id, and data about the user will be tracked there.

\n\n

Assuming use of the session_id consistently through checkout, this
\nexample shows getting home page content for two different anonymous
\nusers and getting segmented content back.

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