### Product Array Example (Simple) Source: https://app.squeezely.tech/developer/api/docs A basic example of the 'products' array format, containing only the mandatory 'id' for each product. ```json [{"id": "ABC123"}] ``` -------------------------------- ### Product Image Links Example (XML List) Source: https://app.squeezely.tech/developer/api/docs Provides an example of how to supply multiple image URLs for a product using an XML list format. ```xml http://images.example.com/TV_123456.png http://images.example.com/TV_654321.png ``` -------------------------------- ### Product Array Example (Detailed) Source: https://app.squeezely.tech/developer/api/docs A detailed example of the 'products' array, including optional fields like 'name', 'price', 'quantity', and 'category_ids'. ```json [ { "id": "ABC123", "name": "Produkt 1", "price": 29.99, "quantity": 2 }, { "id": "XYZ_789", "name": "Product 2", "price": 39.99, "quantity": 1, "category_ids": ["ZYX", "ABC1"] } ] ``` -------------------------------- ### Example GET Request (Path-based) Source: https://app.squeezely.tech/developer/api/docs This example shows how to make a GET request to the contacts endpoint using a path-based URL. It includes a limit parameter to control the number of results and a filter to only include contacts with a non-empty email. ```http GET /api/v1/contacts?limit=100&filters[email_not_empty]=1 ``` -------------------------------- ### Example GET Request (Host-based) Source: https://app.squeezely.tech/developer/api/docs This example demonstrates a host-based GET request to the contacts endpoint. It specifies the full URL, including the domain, and applies a filter for non-empty emails. ```http GET https://api.squeezely.tech/v1/contacts?limit=100&filters[email_not_empty]=1 ``` -------------------------------- ### Example GET Request with CamelCase Filters Source: https://app.squeezely.tech/developer/api/docs This example illustrates using camelCase for filter parameters in a GET request. It includes filters for non-empty emails and to expand categories. ```http GET https://api.squeezely.tech/v1/contacts?limit=100&filters[emailNotEmpty]=1&filters[expandCategories]=1 ``` -------------------------------- ### Products Array Example (Detailed) Source: https://app.squeezely.tech/developer/api/docs A detailed example of the products array for the ViewContent event, including ID, name, price, and category IDs. ```json [ { "id": "ABC123", "name": "Produkt 1", "price": 29.99 }, { "id": "XYZ_789", "name": "Product 2", "price": 39.99, "category_ids": ["ZYX", "ABC1"] } ] ``` -------------------------------- ### Product Date Availability Example Source: https://app.squeezely.tech/developer/api/docs An example of how to structure date availability for travel products, specifying check-in dates and the number of nights. ```json [ { "checkin" : "2019-09-23", "nights" : 7 }, { "checkin" : "2019-09-23", "nights" : 6 }, ] ``` -------------------------------- ### Product Array Example 1 Source: https://app.squeezely.tech/developer/api/docs This is a basic example of the product array format for events like PrePurchase or Return, containing only the product ID. ```json [{"id": "ABC123"}] ``` -------------------------------- ### Product Array Example 2 Source: https://app.squeezely.tech/developer/api/docs This example shows a more detailed product array format, including product name, price, quantity, and category IDs. ```json [ { "id": "ABC123", "name": "Produkt 1", "price": 29.99, "quantity": 2 }, { "id": "XYZ_789", "name": "Product 2", "price": 39.99, "quantity": 1, "category_ids": ["ZYX", "ABC1"] } ] ``` -------------------------------- ### Example GET Request with Snake_case Filters Source: https://app.squeezely.tech/developer/api/docs This example shows how to use snake_case for filter parameters in a GET request. It filters for non-empty emails and requests expanded categories. ```http GET https://api.squeezely.tech/v1/contacts?limit=100&filters[email_not_empty]=1&filters[expand_categories]=1 ``` -------------------------------- ### Example Audience Members Request (Host-based) Source: https://app.squeezely.tech/developer/api/docs Demonstrates a host-based GET request to retrieve audience members with a limit and email filter. ```http GET https://api.squeezely.tech/audiences/123/members?limit=100&filter[email_not_empty]=1 ``` -------------------------------- ### Callback URL Example Source: https://app.squeezely.tech/developer/api/docs This is an example of a callback URL that might be provided upon successful report generation. ```url "https://yourwebsite.com/callback?download_url=..." ``` -------------------------------- ### Example Request (PHP) Source: https://app.squeezely.tech/developer/api/docs An example of how to make a request to the Squeezely API using PHP and cURL. ```APIDOC ## Example requests #### PHP ```php $url = "https://api.squeezely.tech/v1/"; $fields = [ "some_field" => "some_value" ]; $json = json_encode($fields); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "X-AUTH-ACCOUNT: ", "X-AUTH-APIKEY: ", "Content-Type: application/json", "Content-Length: " . strlen($json) ]); $result = curl_exec($ch); curl_close($ch); ``` ``` -------------------------------- ### Example Audience Members Request (Path-based) Source: https://app.squeezely.tech/developer/api/docs Demonstrates a path-based GET request to retrieve audience members with a limit and email filter. ```http GET /api/audiences/123/members?limit=100&filter[email_not_empty]=1 ``` -------------------------------- ### Example Squeezely Signature Header Source: https://app.squeezely.tech/developer/api/docs An example of the X-Squeezely-Signature header value. ```text X-Squeezely-Signature: NzUxNzBmYzIzMGNkODhmMzJlNDc1ZmY0MDg3ZjgxZDk= ``` -------------------------------- ### Get Product Sets Source: https://app.squeezely.tech/developer/api/docs Get the product sets in your account. ```APIDOC ## GET /v1/productsets ### Description Get the productsets in your account. ### Method GET ### Endpoint /v1/productsets ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **total** (integer) - The total number of product sets found. - **data** (array) - An array of product set objects. - **id** (integer) - The unique identifier for the product set. - **name** (string) - The name of the product set. - **products** (integer) - The number of products in the set. - **personalized** (boolean) - Indicates if the product set is personalized. - **feed_url** (string) - The URL to the product set feed. #### Response Example ```json { "success": true, "total": 2, "data": [ { "id" : 1, "name" : "Most sold products", "products" : 10, "personalized" : false, "feed_url" : "https://app.squeezely.tech/products?account=VnBzeVhzV3dKQVduQkFDNll2V2VrUT09&productset=0N5RDBF7P3KS" }, { "id" : 2, "name" : "Recommended for you", "products" : 0, "personalized" : true, "feed_url" : "https://app.squeezely.tech/products?account=VnBzeVhzV3dKQVduQkFDNll2V2VrUT09&productset=0N5RDBF7P3KS&email=|*EMAIL*|" } ] } ``` ``` -------------------------------- ### Parse GET Request Webhook Source: https://app.squeezely.tech/developer/api/docs Example of how to parse a webhook callback sent as a GET request. ```php // Example of parsing a GET request type webhook: parse_str($_SERVER['QUERY_STRING'], $data); ``` -------------------------------- ### Retrieve Contact Information Example Source: https://app.squeezely.tech/developer/api/docs This JSON object shows an example response when retrieving contact information. It includes customer details and audience information. The 'customers' array will be populated if multiple customers match the query. ```json { "success": true, "errors": [], "customer": { "customer_phase": "No phase", "audiences": [1, 2, 3], "customfields": { "last_order_checkin_date": "2023-06-15" }, "firstname": "John", "lastname": "Schmidt", "gender": "m", "birthdate": "1985-12-31", "phone": "+31612345678", "postcode": null, "city": "Den Haag", "country": "nl", "currency": "EUR", "totalvalue": null, "lastpurchase": "2023-03-15", "firstpurchase": "2023-03-15", "totalorders": 5, "cartvalue": null, "newsletter": "no", "marketing": "no", "service": "no" }, "customers": [] } ``` -------------------------------- ### Product Category IDs Example (XML List) Source: https://app.squeezely.tech/developer/api/docs Demonstrates how to specify multiple category IDs for a product using an XML list structure. ```xml TV-1234 TV-4321 ``` -------------------------------- ### Fire InitiateCheckout Event with Products Source: https://app.squeezely.tech/developer/api/docs This snippet should be used when a user begins the checkout process. It includes an example of passing product details, such as ID, name, price, and quantity. ```javascript ``` -------------------------------- ### Get Product Data Source: https://app.squeezely.tech/developer/api/docs Retrieve data for up to 25 products by specifying their SKUs. The language parameter is optional. ```bash curl -X GET "https://api.squeezely.tech/v1/products?sku=SKU1,SKU2,SKU3&language=en-US" ``` -------------------------------- ### Backend API Request Example in PHP Source: https://app.squeezely.tech/developer/api/docs Example of how to make a server-to-server HTTP request to the Squeezely backend API using cURL in PHP. Ensure to replace placeholders with your actual account identifier and API key. ```php $url = "https://api.squeezely.tech/v1/"; $fields = [ "some_field" => "some_value" ]; $json = json_encode($fields); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "X-AUTH-ACCOUNT: ", "X-AUTH-APIKEY: ", "Content-Type: application/json", "Content-Length: " . strlen($json) ]); $result = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Anti-Flicker Snippet Installation Source: https://app.squeezely.tech/developer/api/docs Installs a script at the beginning of the HTML head to prevent page flickering caused by late loading of the frontend-pixel. The 'async' attribute is recommended for performance. ```javascript var javascript = document.createElement('script'); javascript.type = 'text/javascript'; javascript.id = '_sqzl_antiFlicker'; javascript.src = 'https://squeezely.tech/p?hqs=1&m=&u=' + encodeURIComponent(window.location.href); javascript.async = true document.head.appendChild(javascript); ``` -------------------------------- ### Category Details Example (XML) Source: https://app.squeezely.tech/developer/api/docs Shows the XML structure for defining a category with its ID, title, description, link, and Google Product Category. ```xml TV-1234 TV's 22" Only the best TV's 22" https://www.example.com/tvs/22 ``` -------------------------------- ### Example Audience Response Source: https://app.squeezely.tech/developer/api/docs This is an example of a successful response when querying audiences, showing audience details including ID, name, configured channels, version, and optional labels. ```JSON { "success": true, "total": 2, "data": [ { "id": 1, "name": "Visitors last month", "channels": [ "clang", "mailjet" ], "version": 3, "labels": [ "Newsletter", "VIP" ] }, { "id": 2, "name": "Loyal customers", "channels": [], "version": 1 } ] } ``` -------------------------------- ### Product Image Links Example (Multiple Elements) Source: https://app.squeezely.tech/developer/api/docs An alternative XML format for supplying multiple image URLs for a product, where each URL is a separate element. ```xml http://images.example.com/TV_123456.png http://images.example.com/TV_654321.png ``` -------------------------------- ### Get Product Custom Fields Source: https://app.squeezely.tech/developer/api/docs Get all available product custom fields for your account. ```APIDOC ## GET /products/custom-fields ### Description Get all available product custom fields for your account. ### Method GET ### Endpoint /products/custom-fields ### Response #### Success Response (200) - **data** (object) - An object containing custom field details. - **name** (string) - The unique name of the product custom field. - **type** (string) - Data type of the field (text, number, date, etc.). - **favorite** (integer) - Whether the field is marked as a favorite (0 or 1). #### Response Example ```json { "data": { "color": { "name": "color", "type": "text", "favorite": 0 }, "size": { "name": "size", "type": "text", "favorite": 0 } } } ``` ``` -------------------------------- ### API Response Structure Example Source: https://app.squeezely.tech/developer/api/docs Illustrates the structure of a typical API response, including fields like 'pii', 'archived', 'typeName', 'count', 'urlParameter', and 'settings'. This example shows data for 'Date', 'Counter', and 'Calculator' types. ```json { "pii": false, "archived": false, "typeName": "Date", "count": 8234, "urlParameter": false, "settings": null }, { "id": 126, "name": "custom_newsletter_clicks", "type": 4, "lastValue": false, "pii": false, "archived": false, "typeName": "Counter", "count": 12345, "urlParameter": false, "settings": { "decay_amount": 1, "decay_interval": 7 } }, { "id": 127, "name": "custom_max_order_value", "type": 5, "lastValue": true, "pii": false, "archived": false, "typeName": "Calculator", "count": 8234, "urlParameter": false, "settings": { "calculation": "maximum", "items": ["custom_order_value_1", "custom_order_value_2"] } } ] ``` -------------------------------- ### Product Category IDs Example (Multiple Elements) Source: https://app.squeezely.tech/developer/api/docs An alternative XML format for specifying multiple category IDs for a product, with each ID as a separate element. ```xml TV-1234 TV-4321 ``` -------------------------------- ### Example API Response Header for Rate Limiting Source: https://app.squeezely.tech/developer/api/docs An example of an API response header that indicates the number of remaining requests allowed within the current rate limit period. ```http sq-requests-remaining: 147 ``` -------------------------------- ### ViewContent Event Example Source: https://app.squeezely.tech/developer/api/docs Fire this event when a user views a product page. Ensure the 'products' array contains at least the 'id' property. ```javascript ``` -------------------------------- ### Get Product Data Source: https://app.squeezely.tech/developer/api/docs Retrieves product data for up to 25 products based on their SKUs. You can also specify the language for the product data. ```APIDOC ## GET /products ### Description Get product data for up to 25 products. ### Method GET ### Endpoint /products ### Parameters #### Query Parameters - **sku** (string) - Required - Comma separated list of skus - **language** (string) - Optional - Language of the product ``` -------------------------------- ### Example API Response for Contacts Source: https://app.squeezely.tech/developer/api/docs This is an example of a successful API response when retrieving contacts. It includes a success status, an empty errors array, a list of contact items, and a next_url for pagination. Each contact object contains detailed information. ```json { "success": true, "errors": [], "items": [ { "id": 12345, "email": "john.doe@example.com", "firstname": "John", "lastname": "Doe", "gender": "male", "birthdate": "1985-06-15", "phone": "+31612345678", "postcode": "1234AB", "city": "Amsterdam", "country": "NL", "currency": "EUR", "totalvalue": "1250.50", "lastpurchase": "2024-03-15 14:30:00", "firstpurchase": "2023-01-10 09:15:00", "totalorders": 8, "cartvalue": "75.00", "newsletter": "yes", "marketing": "yes", "service": "yes", "language": "nl", "customer_phase": "Active", "audiences": [101, 205, 308], "customfields": { "favorite_color": "blue", "loyalty_points": 1500 } }, { "id": 12346, "email": "jane.smith@example.com", "firstname": "Jane", "lastname": "Smith", "gender": "female", "birthdate": "1990-03-22", "phone": "+31687654321", "postcode": "5678CD", "city": "Rotterdam", "country": "NL", "currency": "EUR", "totalvalue": "2340.75", "lastpurchase": "2024-03-20 10:45:00", "firstpurchase": "2022-11-05 16:20:00", "totalorders": 15, "cartvalue": "0", "newsletter": "yes", "marketing": "no", "service": "yes", "language": "en", "customer_phase": "Loyal", "audiences": [101, 308], "customfields": { "favorite_color": "red", "loyalty_points": 3200 } } ], "next_url": "https://api.squeezely.tech/v1/contacts?limit=100&after=12346&filters[emailNotEmpty]=1" } ``` -------------------------------- ### Example Audience Members Response Source: https://app.squeezely.tech/developer/api/docs Shows the JSON structure for a paginated response of audience members, including items and a next_url. ```json { "items": [ { "id": 1234, "customer_id": 5678, "version": 3, "created_at": "2024-01-15 10:30:00", "email_hash": "abc123def456..." }, { "id": 1235, "customer_id": 5679, "version": 3, "created_at": "2024-01-15 10:31:00", "email_hash": "xyz789ghi012..." } ], "next_url": "https://api.squeezely.tech/v1/audiences/123/members?limit=100&after=5679&filter[email_not_empty]=1&filter[version]=3" } ``` -------------------------------- ### Retrieve Contact Information Source: https://app.squeezely.tech/developer/api/docs This example shows the structure of a successful response when retrieving contact information. It includes customer details and potentially multiple customers if identifiers are ambiguous. ```json { "success": true, "errors": [], "customer": { "customer_phase": "No phase", "audiences": [1, 2, 3], "customfields": { "last_order_checkin_date": "2023-06-15", }, "firstname": "John", "lastname": "Schmidt", "gender": "m", "birthdate": "1985-12-31", "phone": "+31612345678", "postcode": null, "city": "Den Haag", "country": "nl", "currency": "EUR", "totalvalue": null, "lastpurchase": "2023-03-15", "firstpurchase": "2023-03-15", "totalorders": 5, "cartvalue": null, "newsletter": "no", "marketing": "no", "service": "no" }, "customers": [] } ``` -------------------------------- ### Displaying Collections in Personalizations Source: https://app.squeezely.tech/developer/api/docs This example demonstrates how to access and display collection data within a personalization template. It shows how to check for defined collections and iterate through arrays. ```twig {{ exposedCollections(["*.*.customer_favorite_colors", "customer_settings.current_color"]) }} {% if collections.customer_settings is defined and collections.customer_settings.customer_favorite_colors is defined %}
    {% for color in collections.customer_settings.customer_favorite_colors %}
  • {{ color }}
  • {% endfor %}
{% else %} No favorite colors known {% endif %} Your current color is: {{ collections.customer_settings.current_color }} ``` -------------------------------- ### Personalization Settings - Targeting and Attribution Source: https://app.squeezely.tech/developer/api/docs Example of personalization settings including audience targeting and event attribution. Note that specific properties may not always be set. ```json { "settings": { "targeting":{ "include_audiences": [ { "id": 123, "name": "Audience 1" }, ], "exclude_audiences": [ { "id": 456, "name": "Audience 2" }, ], "location": { "include": { "type": "everywhere" }, "exclude": { "type": "none" } } }, "attribution": { "events": [ 'Purchase' ] } } } ``` -------------------------------- ### Parse JSON Webhook Source: https://app.squeezely.tech/developer/api/docs Example of how to parse a webhook callback sent with the application/json content type. ```php // Example of parsing a application/json type webhook $data = json_decode(file_get_contents('php://input'), true); ``` -------------------------------- ### Number Format Example Source: https://app.squeezely.tech/developer/api/docs Formats a number to display with a specified number of decimals, decimal separator, and thousand separator. Useful for currency or large number display. ```nunjucks {{ price | number_format(3, ".", ",") }} ``` -------------------------------- ### Merge Collections with Existing Data Source: https://app.squeezely.tech/developer/api/docs This example shows how to merge new data into an existing collection. New values are added to the 'customer_favorite_colors' array, extending the existing list. ```javascript window._sqzl.push({ "event" : "PageView", "collections" : { "customer_settings": { "customer_favorite_colors": ["violet"] } } }); ``` -------------------------------- ### Example JSON Response for Correct API Call Source: https://app.squeezely.tech/developer/api/docs A sample JSON response indicating a successful API request. It includes a 'success' flag and an empty 'errors' array. ```json { "success": true, // ... "errors": [] } ``` -------------------------------- ### Personalization Settings - URL Targeting Source: https://app.squeezely.tech/developer/api/docs Example of URL targeting settings within personalization, specifying include and exclude rules based on URL patterns. Test specific properties before use. ```json { "settings": { "targeting":{ ... "location": { "include": { "type": "starts_with", "ignore_query_parameters": false, "urls": [ 'https://www.example.com' ] }, "exclude": { 'type': "contains", 'urls': [ 'example', ] } } }, ... } } ``` -------------------------------- ### Personalization Settings - City Targeting Source: https://app.squeezely.tech/developer/api/docs Example of city targeting settings within personalization, including city names, IDs, and coordinates. Ensure specific properties are present before relying on them. ```json { "settings": { "targeting":{ ... "city": { "radius": 12, "cities": [ { "id": 2747373, "name": "The Hague", "coordinates": { "latitude": "52.076670000", "longitude": "4.298610000" } }, { "id": 123, "name": "Some City" } ] } }, ... } } ``` -------------------------------- ### Looping Through Personalization Items in Nunjucks Source: https://app.squeezely.tech/developer/api/docs Example of using Nunjucks templating to loop through personalization items in custom HTML inserts or overlays. The 'items' variable holds the product data. ```html Check out our bestsellers: {% for item in items %} {{ item.title }} now on sale for only {{ item.currency_sign }} {{ item.price }}! {% endfor %} ``` -------------------------------- ### Get Audiences Source: https://app.squeezely.tech/developer/api/docs Get the audiences in your account. ```APIDOC ## GET /v1/audiences ### Description Get the audiences in your account. ### Method GET ### Endpoint /v1/audiences ### Response #### Success Response (200) (Response structure not provided in source text) ``` -------------------------------- ### Track Purchase Event with Products Source: https://app.squeezely.tech/developer/api/docs This example shows how to send a purchase event with detailed product information to the /v1/track endpoint. Ensure you have the necessary customer and product data structured correctly. The `products` array supports individual product details like ID, name, category, price, and quantity. ```php $url = "https://api.squeezely.tech/v1/track"; $fields = [ "events" => [ [ "event" => "Purchase", "email" => $email, "firstname" => $firstname, "lastname" => $lastname, "orderid" => $orderId, "newsletter" => $newsletterOptin ? "yes" : "no", "products" => [ [ "id" => "ABC123", "name" => "Product 1", "category_ids" => ["CAT_1", "CAT_2"], "price" => 29.99, "quantity" => 2 ], [ "id" => "XYZ_789", "name" => "Product 2", "category_ids" => ["CAT_2"], "price" => 39.99, "quantity" => 1 ] ] ] ] ]; $json = json_encode($fields); $ch = curl_init(); ... $result = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### JavaScript: Fire 'Return' Event Source: https://app.squeezely.tech/developer/api/docs Use this snippet to fire a 'Return' event. Ensure all required properties like 'event', 'email', 'currency', and 'products' are correctly populated. ```javascript ``` -------------------------------- ### GET /v1/audiences Source: https://app.squeezely.tech/developer/api/docs Retrieves a list of audiences. This endpoint supports filtering by channel slugs. ```APIDOC ## GET /v1/audiences ### Description Retrieves a list of audiences. This endpoint supports filtering by channel slugs. ### Method GET ### Endpoint https://api.squeezely.tech/v1/audiences ### Parameters #### Query Parameters - **filters[channels]** (string) - Optional - Comma-separated list of channel slugs (e.g. `spotlerconnect`, `facebook`). When set to a non-empty value after parsing, the response only includes audiences whose `channels` field shares at least one slug with the filter (logical OR across the list). ### Request Example ```json GET https://api.squeezely.tech/v1/audiences?filters[channels]=spotlerconnect,facebook ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **total** (integer) - The total number of audiences returned. - **data** (array) - An array of audience objects. - **id** (integer) - The unique identifier of the audience. - **name** (string) - The name of the audience. - **channels** (array) - An array of channel slugs configured for the audience. - **version** (integer) - The version of the audience. - **labels** (array) - An array of label names associated with the audience (optional). #### Response Example ```json { "success": true, "total": 2, "data": [ { "id": 1, "name": "Visitors last month", "channels": [ "clang", "mailjet" ], "version": 3, "labels": [ "Newsletter", "VIP" ] }, { "id": 2, "name": "Loyal customers", "channels": [], "version": 1 } ] } ``` #### Error Response (400) - **Bad request** (e.g. invalid `filters[channels]` value or unknown channel slug) - **Error codes**: `UNKNOWN_CHANNEL_NAME` in `errors` ``` -------------------------------- ### Track a Lead Event Source: https://app.squeezely.tech/developer/api/docs Fire a 'Lead' event when a user signs up. Include the customer's email (or its SHA256 hash) and optionally a value, campaign, and source. ```javascript ``` -------------------------------- ### Initialize Squeezely Tracker Source: https://app.squeezely.tech/developer/api/docs Include this personalized script in the head section of your website pages to enable tracking. Replace with your unique identifier. ```html ``` -------------------------------- ### Get Personalizations Source: https://app.squeezely.tech/developer/api/docs Retrieves a list of all personalizations in the account. Includes details about their status, variants, and settings. ```APIDOC ## GET /v1/personalizations ### Description Retrieves a list of all personalizations in the account. This includes details such as the personalization's ID, name, creation and update timestamps, status, and associated variants. The response may also contain detailed settings for targeting and attribution. ### Method GET ### Endpoint /v1/personalizations ### Response #### Success Response (200 OK) - **success** (boolean) - Indicates if the request was successful. - **total** (integer) - The total number of personalizations returned. - **data** (array) - An array of personalization objects. - **id** (integer) - The unique identifier for the personalization. - **name** (string) - The name of the personalization. - **created_at** (string) - The timestamp when the personalization was created. - **updated_at** (string) - The timestamp when the personalization was last updated. - **status** (string) - The current status of the personalization (e.g., "paused", "published"). - **email** (boolean) - Indicates if the personalization is email-based. - **variants** (array) - An array of variant objects associated with the personalization. - **id** (integer) - The unique identifier for the variant. - **name** (string) - The name of the variant. - **created_at** (string) - The timestamp when the variant was created. - **updated_at** (string) - The timestamp when the variant was last updated. - **settings** (object) - An object containing targeting and attribution settings (optional). - **targeting** (object) - Defines the criteria for when the personalization should be displayed. - **include_audiences** (array) - Audiences that must be included. - **exclude_audiences** (array) - Audiences that must be excluded. - **location** (object) - Geographic targeting settings. - **include** (object) - Location inclusion criteria. - **exclude** (object) - Location exclusion criteria. - **countries** (array) - Array of ISO 3166-1 alpha-2 country codes for targeting. - **city** (object) - City-specific targeting settings. - **attribution** (object) - Defines attribution settings. - **events** (array) - List of events to track for attribution. ### Request Example (No request body for GET requests) ### Response Example ```json { "success": true, "total": 3, "data": [ { "id": 21, "name": "Back in stock", "created_at": "2021-08-25 11:03:09", "updated_at": "2021-08-25 15:54:44", "status": "paused", "email": false, "variants": [ { "id": 34, "name": "New custom variant", "created_at": "2021-08-25 11:03:09", "updated_at": "2021-08-25 11:06:10" } ] } ] } ``` ``` -------------------------------- ### Get Journeys Source: https://app.squeezely.tech/developer/api/docs Retrieves a list of all journeys associated with the account, including their status and creation/update timestamps. ```APIDOC ## GET /v1/journeys ### Description Fetches all journeys available in the account. ### Method GET ### Endpoint /v1/journeys ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **total** (integer) - The total number of journeys returned. - **data** (array) - A list of journey objects. - **id** (integer) - The unique identifier for the journey. - **name** (string) - The name of the journey. - **created_at** (string) - The timestamp when the journey was created. - **updated_at** (string) - The timestamp when the journey was last updated. - **status** (string) - The current status of the journey (e.g., 'published', 'draft'). #### Response Example ```json { "success": true, "total": 2, "data": [ { "id": 7, "name": "Newsletter", "created_at": "2021-08-25 15:46:05", "updated_at": "2021-08-25 15:48:34", "status": "published" }, { "id": 6, "name": "Abandoned cart", "created_at": "2021-08-25 15:42:19", "updated_at": "2021-08-25 15:45:12", "status": "draft" } ] } ``` ``` -------------------------------- ### GET /v1/audiences/{id}/members Source: https://app.squeezely.tech/developer/api/docs Retrieves paginated audience members for a specific live audience. ```APIDOC ## GET /v1/audiences/{id}/members ### Description Retrieve paginated audience members for a specific live audience. ### Method GET ### Endpoint https://api.squeezely.tech/v1/audiences/{id}/members ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the audience. #### Query Parameters - **limit** (integer) - Optional - Number of members to return per page (min: 1, max: 10000, default: 1000). - **after** (string) - Optional - Customer ID to start pagination after (for retrieving next pages). - **filter[email_not_empty]** (boolean) - Optional - Pass `true` to only select members that have an email address. Pass `false` (or omit the parameter) to include all members regardless of email status. - **filter[version]** (integer) - Optional - Specific version of the audience to retrieve members from. Defaults to the current version. #### Response codes HTTP status code | Description | Error codes ---|---|--- 200 | OK | 400 | Bad request | Invalid filter format or filter keys, audience not live 404 | Not found | Audience not found 429 | RATE_LIMIT | Rate limit exceeded (250 requests per minute). ``` -------------------------------- ### ViewCategory Event Example Source: https://app.squeezely.tech/developer/api/docs Fire this event when a user views a category page. The 'category_id' is mandatory. ```javascript ``` -------------------------------- ### Parse Form URL Encoded Webhook Source: https://app.squeezely.tech/developer/api/docs Example of how to parse a webhook callback sent with the application/x-form-urlencoded content type. ```php // Example of parsing a application/x-form-urlencoded type webhook $data = $_POST; ``` -------------------------------- ### Get Personalizations Source: https://app.squeezely.tech/developer/api/docs Retrieves a list of all personalizations in your account. The response includes details like ID, name, status, and associated variants. ```json { "success": true, "total": 3, "data": [ { "id": 21, "name": "Back in stock", "created_at": "2021-08-25 11:03:09", "updated_at": "2021-08-25 15:54:44", "status": "paused", "email": false, "variants": [ { "id": 34, "name": "New custom variant", "created_at": "2021-08-25 11:03:09", "updated_at": "2021-08-25 11:06:10" } ] }, { "id": 10, "name": "Homepage - Recommended for you", "created_at": "2021-08-17 10:49:00", "updated_at": "2021-08-25 15:53:48", "status": "published", "email": false, "variants": [ { "id": 45, "name": "New Overlay", "created_at": "2021-08-17 10:49:00", "updated_at": "2021-08-25 15:53:48" } ] }, { "id": 9, "name": "Abandoned cart email", "created_at": "2021-08-17 10:48:22", "updated_at": "2021-08-25 15:54:07", "status": "published", "email": true, "template": "...
", "max_products": 3, "url_template": "https://squeezely.tech/mailing/abc123/9/product-{ index }.jpg?email={email}", "image_template": "https://d.squeezely.tech/mailing/abc123/9/product-{ index }.jpg?email={email}", "image_preview": "https://d.squeezely.tech/mailing/abc123/9/product-1.jpg?email=preview" "variants": [ { "id": 56, "name": "New feedback form", "created_at": "2021-08-17 10:48:22", "updated_at": "2021-08-25 15:54:07" } ] }, { "id": 8, "name": "Personalization with targeting and attribution settings", ... "settings": { ... } } ] } ``` -------------------------------- ### Create or Update Products Source: https://app.squeezely.tech/developer/api/docs Create, update, or delete up to 250 products in a single API call. This endpoint supports various product properties including ID, title, price, images, and more. ```json { "products": [ { "id" : "ABC123", "title" : "Product 1", "link" : "https://yourshop.com/product-1" }, { "id" : "XYZ_789", "title" : "Product 2", "link" : "https://yourshop.com/product-2", "description" : "Product 2 description", "price" : "GBP 19.95", "image_link" : "https://yourshop.com/product-2.jpg", "condition" : "new", "inventory" : 80, "brand" : "Your brand", "size" : "M", "color" : "Red", "parent_id" : "XYZ", "category_ids": ["CAT-123", "CAT-321"] } ] } ``` -------------------------------- ### GET /v1/contacts Source: https://app.squeezely.tech/developer/api/docs Retrieve paginated contacts from your account using cursor-based pagination. Supports filtering by email presence and expanding category information. ```APIDOC ## GET /v1/contacts ### Description Retrieve paginated contacts from your account using cursor-based pagination. Supports filtering by email presence and expanding category information. ### Method GET ### Endpoint https://api.squeezely.tech/v1/contacts ### Parameters #### Query Parameters - **limit** (number) - Optional - Number of contacts to return per page (min: 1, max: 1000, default: 100). - **after** (string) - Optional - Contact ID to start pagination after (for retrieving next pages). - **filters[expandCategories]** (boolean) - Optional - Pass true to expand category IDs to include category names in custom fields. Pass false (or omit the parameter) to return category IDs only. - **filters[emailNotEmpty]** (boolean) - Optional - Pass true to only select contacts that have an email address. Pass false (or omit the parameter) to include all contacts regardless of email status. ### Response #### Success Response (200) - **items** (array) - Array of contact objects. - **next_url** (string) - Absolute URL to retrieve the next page of results. Will be null if there are no more pages. Each contact object in the **items** array contains: - **id** (string) - Unique identifier for this contact record. - **customer_id** (string) - The contact's unique identifier. - **version** (number) - The audience version this member belongs to. - **created_at** (string) - When the member was added to the audience (yyyy-mm-dd HH:ii:ss). - **email_hash** (string) - SHA256 hash of the contact's email address (if available). #### Response Example { "items": [ { "id": "1234", "customer_id": "5678", "version": 3, "created_at": "2024-01-15 10:30:00", "email_hash": "abc123def456..." } ], "next_url": "https://api.squeezely.tech/v1/contacts?limit=100&after=5679&filters[emailNotEmpty]=true" } #### Error Response (400) Bad request - Invalid filter format or parameters. #### Error Response (429) RATE_LIMIT - Rate limit exceeded (250 requests per minute). #### Error Response (503) Service unavailable - Merchant is currently in maintenance. ```