### Get Recommended Products - Basic Request Source: https://docs.salesmanago.com/ Send a POST request to the /api/recommendation/get endpoint with client credentials and strategy details to get product recommendations. ```json { "clientId": "a1b2-...-c3d4", "apiKey": "e5f6-...-g7h8", "requestTime": 1659938888000, "sha": "2aa3-...-e00c", "strategyId": "21c2-...-3266", "contactId": "abcd-...-.defg", "includeProductData": false } ``` -------------------------------- ### Authentication Data Example Source: https://docs.salesmanago.com/ This is an example of the authorization data required for SALESmanago API requests. ```APIDOC ## Authentication Data All requests must include authentication data. Here is an example of the required format: ```json { "clientId": "your-client-id-123", "apiKey": "your-api-key-123", "requestTime": 1327056031488, "sha": "2aa3927a7dee8c2a712adb5375f5fa36dd8fe00c" } ``` ### Parameters * **clientId** (string) - Your unique Client identifier. * **apiKey** (string) - Any random string of characters. * **requestTime** (number) - A UNIX timestamp in milliseconds. * **sha** (string) - Value generated from sha1(apiKey+clientId+apiSecret). ``` -------------------------------- ### Get Recommended Products Source: https://docs.salesmanago.com/ Retrieves a list of recommended products. The response can contain product IDs or detailed product data, depending on the request parameters. ```APIDOC ## Get Recommended Products ### Description This API method enables you to retrieve a list of recommended products – either as an array of product IDs or as an array of objects containing product data. The products are selected based on a recommendation strategy created in the Recommendation Architect. The recommendations can be personalized (per Contact/anonymous visitor) or generic (e.g., _Most frequently purchased products_ or _Products from selected brand_). Data obtained through this method can be used to display recommendations across various channels and tools, also external to (not associated with) SALESmanago. For example, you can display them in your mobile app or on a POS or print them out. ### Method POST ### Endpoint `https://xxx.salesmanago.com/api/recommendation/get` ### Parameters #### Request Body - **clientId** (string) - Required - Your client ID. - **apiKey** (string) - Required - Your API key. - **requestTime** (integer) - Required - Timestamp of the request in milliseconds. - **sha** (string) - Required - SHA256 hash of the request parameters. - **strategyId** (string) - Required - The ID of the recommendation strategy to use. - **contactId** (string) - Optional - The ID of the contact for whom to generate recommendations. If not provided, generic recommendations might be returned. - **includeProductData** (boolean) - Optional - If true, the response will include detailed product data. Defaults to false. ### Request Example ```json { "clientId": "a1b2-...-c3d4", "apiKey": "e5f6-...-g7h8", "requestTime": 1659938888000, "sha": "2aa3-...-e00c", "strategyId": "21c2-...-3266", "contactId": "abcd-...-.defg", "includeProductData": false } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **products** (array) - An array of product objects, each containing `id` and `urlAppendix`, returned when `includeProductData` is false. - **id** (string) - The product ID. - **urlAppendix** (string) - A URL appendix for tracking or linking. - **productIds** (array) - An array of product IDs, returned when `includeProductData` is false and product data is not requested. - **productData** (array) - An array of detailed product objects, returned when `includeProductData` is true. - **productId** (string) - The product ID. - **urlAppendix** (string) - A URL appendix for tracking or linking. - **name** (string) - The name of the product. - **mainCategory** (string) - The main category of the product. - **categories** (array) - An array of categories the product belongs to. - **description** (string) - A description of the product. - **productUrl** (string) - The URL of the product. - **mainImageUrl** (string) - The URL of the main product image. - **available** (boolean) - Indicates if the product is available. - **quantity** (integer) - The available quantity of the product. - **price** (number) - The price of the product. - **discountPrice** (number) - The discounted price of the product. - **systemDetails** (object) - System-specific details about the product. - **brand** (string) - The brand of the product. - **manufacturer** (string) - The manufacturer of the product. - **popularity** (integer) - The popularity score of the product. - **gender** (integer) - Gender classification (e.g., 0 for unspecified). - **season** (string) - The season the product is associated with. - **color** (string) - The color of the product. - **bestseller** (boolean) - Indicates if the product is a bestseller. - **newProduct** (boolean) - Indicates if the product is new. - **customDetails** (object) - Custom details provided for the product. - **problems** (array) - An array of problems encountered during the request, if any. #### Response Example (without product data) ```json { "success": true, "products": [ { "id": "P123", "urlAppendix": "utm_source=salesmanago&prod_id=3243454" }, { "id": "P456", "urlAppendix": "utm_source=salesmanago&prod_id=4324345" }, { "id": "P789", "urlAppendix": "utm_source=salesmanago&prod_id=9324354" }, { "id": "P987", "urlAppendix": "utm_source=salesmanago&prod_id=132436" } ], "problems": [] } ``` #### Response Example (with product data, limited to 2 products) ```json { "success": true, "productIds": ["P123", "P234"], "productData": [ { "productId": "P123", "urlAppendix": "utm_source=salesmanago&prod_id=4324345", "name": "White t-shirt", "mainCategory": "t-shirts", "categories": [ "Winter collection", "Linen products" ], "description": "Classic t-shirt with...", "productUrl": "https://example.com/shop/t-shirts/white-t-shirt", "mainImageUrl": "https://example.com/media/white-t-shirt-cover.jpg", "available": true, "quantity": 90, "price": 29.99, "discountPrice": 19.99, "systemDetails": { "brand": "My Brand", "manufacturer": "My Brand", "popularity": 40, "gender": 0, "season": "summer", "color": "white", "bestseller": true, "newProduct": false }, "customDetails": { "detail1": "linen", "detail2": "short" } }, { "productId": "P234", "urlAppendix": "utm_source=salesmanago&prod_id=8765421", "name": "White t-shirt", "mainCategory": "t-shirts", "categories": [ "Winter collection", "Linen products" ], "description": "Classic t-shirt with...", "productUrl": "https://example.com/shop/t-shirts/white-t-shirt", "mainImageUrl": "https://example.com/media/white-t-shirt-cover.jpg", "available": true, "active": true, "quantity": 90, "price": 29.99, "discountPrice": 19.99, "systemDetails": { "brand": "My Brand", "manufacturer": "My Brand", "popularity": 40, "gender": 0, "season": "summer", "color": "white", "bestseller": true, "newProduct": false }, "customDetails": { "detail1": "linen", "detail2": "short" } } ] } ``` ``` -------------------------------- ### Send External Event with JavaScript (Simple) Source: https://docs.salesmanago.com/frontend-sdk This simple example demonstrates sending a basic external event, such as a download, using the `sm` JavaScript function. Ensure the originating domain is whitelisted in SALESmanago settings. ```javascript sm('extEvent', { "owner": "salesmanago.user@yourcompany.com", "email": "name@example.com", "date": 1659938888, "contactExtEventType": "DOWNLOAD" }); ``` -------------------------------- ### Add File to Contact - CURL Example Source: https://docs.salesmanago.com/ This CURL command demonstrates how to upload a file and assign it to a contact using the SALESmanago API. It specifies the endpoint, headers, and data parts for the request. ```bash curl -X POST "https://xxx.salesmanago.com/api/contact/addFile" \ -H "Accept: application/json, application/*+json" \ -F 'request={"clientId": "a1b2-...-c3d4", "apiKey": "e5f6-...-g7h8", "requestTime": 1659938888000, "sha": "2aa3-...-e00c", "owner": "salesmanago.user@yourcompany.com", "email": "name@example.com"};type=application/json' \ -F 'file=@/data/uploads/campaign-assets/spring-promo-brief.pdf' ``` -------------------------------- ### Send External Event with JavaScript (Advanced) Source: https://docs.salesmanago.com/frontend-sdk This advanced example shows how to send a purchase event with additional details like products, value, and location. External Events must be assigned to an existing contact; otherwise, they will be discarded. ```javascript let date = new Date(); sm('extEvent', { "owner": "salesmanago.user@yourcompany.com", "email": "name@example.com", "date": date.getTime(), "contactExtEventType": "PURCHASE", "products": "p0123, p4567", "value": 189.99, "location": "examplecom", "products": "p0123, p4567", "externalId": "ID-123456", "details": ["detail1", "detail2"] }); ``` -------------------------------- ### Request Product Recommendations Source: https://docs.salesmanago.com/frontend-sdk Use SMApi.setAll() to configure recommendation parameters and SMApi.execute('recommendation') to fetch recommendations. The result is a promise that resolves with product IDs. ```javascript const recommendationData = { "strategyId": "21c2-...-3266", "productIds": ["P123", "P456"], "includeProductData": false, "maxItems": 4 } SMApi.setAll(recommendationData ); SMApi.execute('recommendation').then((result) => { console.log(result); }); ``` -------------------------------- ### Handle WEB_PUSH_API_STARTED Event Source: https://docs.salesmanago.com/frontend-sdk Listen for the WEB_PUSH_API_STARTED message to display the consent form. Ensure the event data is parsed correctly. ```javascript window.addEventListener('message', (event) => { if (event.data) { const data = JSON.parse(event.data); if (data.topic === 'WEB_PUSH_API_STARTED') { smWebPushApi.displayConsentForm('08673fa0-dc17-40ac-8b90-5867ae8d5801'); } } }); ``` -------------------------------- ### HTTP Methods and Content-Types Source: https://docs.salesmanago.com/v3 SALESmanago API v3 supports POST and GET HTTP methods. POST is used for data insertion, updates, and deletions, as well as asynchronous data downloads. GET is used for synchronous data downloads. All POST requests must be in JSON format. ```APIDOC ## Methods and Content-Types SALESmanago API v3 uses two HTTP methods: * POST – used for inserting, updating, and deleting data. It is also used when asynchronously downloading data from SALESmanago * GET – used when synchronously downloading data from SALESmanago All POST requests must be encapsulated in JSON format. Most libraries automatically add Content-Type: application/json header when sending data encapsulated in JSON. ``` -------------------------------- ### Response with Product IDs Source: https://docs.salesmanago.com/frontend-sdk The SDK returns a promise that resolves with product IDs and a URL appendix for tracking. This format is useful when you only need product identifiers. ```json { "products": [ { "productId": "P123", "urlAppendix": "utm_source=salesmanago&prod_id=3243454" }, { "productId": "P456", "urlAppendix": "utm_source=salesmanago&prod_id=4324345" }, { "productId": "P789", "urlAppendix": "utm_source=salesmanago&prod_id=9324354" }, { "productId": "P987", "urlAppendix": "utm_source=salesmanago&prod_id=132436" } ] "requestId": "e29ad8ad-3d80-4bcb-92bb-3a3b11960445", "finalResponse": true, } ``` -------------------------------- ### Get Visit Statistics Source: https://docs.salesmanago.com/frontend-sdk Retrieves statistics about website visits and pageviews. ```APIDOC ## Get visit statistics ### Description Retrieves statistics about website visits and pageviews. ### Method sm.api.pageStats(); ### Response #### Success Response - **visits** (Integer) - Number of visits to any page on the current domain. A new visit is initiated each time a new pageview takes place more than 3 hours after the last pageview. - **views** (Integer) - Number of pageviews, i.e., the number of times a new page is loaded on the current domain. - **ts** (UNIX timestamp (ms)) - Timestamp of the last pageview (UNIX timestamp, GMT+0). - **isNewSession** (Boolean) - This flag will be set to true if the current pageview is the first during this visit. ``` -------------------------------- ### Get conversation data Source: https://docs.salesmanago.com/ Retrieves detailed data for a specific conversation using its ID. ```APIDOC ## Get conversation data ### Description In order to get conversation data the below method should be used. ### Method GET ### Endpoint `https://xxx.salesmanago.com/api/messaging/mass/conversation/data` ### Parameters #### Query Parameters - **conversationId** (int) - Required - Conversation identifier. ### Request Example ```json { "clientId": "a1b2-...-c3d4", "apiKey": "e5f6-...-g7h8", "requestTime": 1659938888000, "sha": "2aa3-...-e00c", "conversationId": 12345 } ``` ### Response #### Success Response (200) - **success** (Boolean) - Boolean value informing about the result of request (successful/not successful). - **message** (Array) - Array of additional information enabling error identification. - **messagingContentList** (Array of objects) - List of conversation data objects. #### Response Example ```json { "success": true, "message": [], "messagingContentList": [ { "name": "Spring Campaign", "date": 1649938888000, "textContent": "Visit example.com and get up to 50% off", "phone": "+15554443322", "contactId" : "1a2b-...-3c4d", "externalId": null, "channel" : "SMS" }, { "name": "Spring Campaign", "date": 1659938888000, "textContent": "Visit example.com and get up to 50% off", "phone": "+15554443333", "contactId" : "1a2b-...-3c4d", "externalId": null, "channel" : "SMS" }, { "name": "Spring Campaign", "date": 1669938888000, "textContent": "Example Visit example.com and get up to 50% off", "phone": "+15554443344", "contactId" : "1a2b-...-3c4d", "externalId": null, "channel" : "SMS" } ] } ``` ``` -------------------------------- ### Create Product Collection - Response Source: https://docs.salesmanago.com/v3 This is a sample successful response after creating a Product Collection. It confirms the operation and provides the unique identifier for the newly created collection. ```json { "collectionUUID": "0a1b-...-2c3d", "success": true } ``` -------------------------------- ### Get Page Statistics Source: https://docs.salesmanago.com/frontend-sdk Retrieve visit and pageview statistics for the current visitor using the pageStats method. ```javascript sm.api.pageStats(); ``` -------------------------------- ### Sample Response for Product Catalog Operations Source: https://docs.salesmanago.com/v3 This is a sample JSON response indicating the success of a product catalog operation. ```json { "success": true } ``` -------------------------------- ### Get Workflow Statistics Source: https://docs.salesmanago.com/ Retrieves statistics for a specified workflow. Requires client ID, API key, and workflow details. ```APIDOC ## GET /api/workflow/statistics ### Description Retrieves statistics for a specified workflow. ### Method GET ### Endpoint `https://xxx.salesmanago.com/api/workflow/statistics` ### Parameters #### Query Parameters - **clientId** (string) - Required - The client ID for authentication. - **apiKey** (string) - Required - The API key for authentication. - **requestTime** (integer) - Required - The timestamp of the request. - **sha** (string) - Required - A SHA hash for request security. - **workflowId** (integer) - Required - The ID of the workflow to retrieve statistics for. - **period** (string) - Required - The period for which to retrieve statistics (e.g., "PREVIOUS_YEAR"). ### Request Example ```json { "clientId": "axf46o35hgrf015q", "apiKey": "test123test", "requestTime": 1348046897664, "sha": "3436a3efd8c63f72c8ba827d53d1297482e6d85d", "workflowId": 10032430, "period": "PREVIOUS_YEAR" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (array) - An array of messages or errors. - **name** (string) - The name of the workflow. - **creationDate** (integer) - The creation date of the workflow. - **launchesNumber** (integer) - The number of times the workflow has been launched. - **revenueStats** (object) - Statistics related to revenue. - **totalSales** (float) - Total sales. - **totalLastClickSales** (float) - Total sales from the last click. - **totalTransactionNumber** (integer) - Total number of transactions. - **totalLastClickTransactionNumber** (integer) - Total number of transactions from the last click. - **emailSales** (float) - Sales generated via email. - **emailLastClickSales** (float) - Last click sales generated via email. - **emailTransactionNumber** (integer) - Number of transactions via email. - **emailLastClickTransactionNumber** (integer) - Number of transactions via email from the last click. - **webPushSales** (float) - Sales generated via web push. - **webPushClickSales** (float) - Click sales generated via web push. - **webPushTransactionNumber** (integer) - Number of transactions via web push. - **webPushLastClickTransactionNumber** (integer) - Number of transactions via web push from the last click. - **smsSales** (float) - Sales generated via SMS. - **smsClickSales** (float) - Click sales generated via SMS. - **smsTransactionNumber** (integer) - Number of transactions via SMS. - **smsLastClickTransactionNumber** (integer) - Number of transactions via SMS from the last click. - **emailStats** (object) - Statistics related to email performance. - **averageOr** (string) - Average OR. - **uniqueOpens** (integer) - Number of unique opens. - **allOpens** (integer) - Total number of opens. - **averageCtr** (string) - Average CTR. - **uniqueClicks** (integer) - Number of unique clicks. - **allClicks** (integer) - Total number of clicks. - **averageCtor** (string) - Average CTOR. - **optOut** (string) - Opt-out rate. - **contactsOptOut** (integer) - Number of contacts who opted out. - **sentMessages** (integer) - Number of messages sent. - **messageToSend** (integer) - Number of messages to send. - **failedMessages** (integer) - Number of failed messages. - **spam** (integer) - Number of spam reports. - **softBounces** (integer) - Number of soft bounces. - **hardBounces** (integer) - Number of hard bounces. #### Response Example ```json { "success": true, "message": [], "name": "New Workflow 2022-02-23 12:53", "creationDate": 1645617296, "launchesNumber": 0, "revenueStats": { "totalSales": 0.0, "totalLastClickSales": 0.0, "totalTransactionNumber": 0, "totalLastClickTransactionNumber": 0, "emailSales": 0.0, "emailLastClickSales": 0.0, "emailTransactionNumber": 0, "emailLastClickTransactionNumber": 0, "webPushSales": 0.0, "webPushClickSales": 0.0, "webPushTransactionNumber": 0, "webPushLastClickTransactionNumber": 0, "smsSales": 0.0, "smsClickSales": 0.0, "smsTransactionNumber": 0, "smsLastClickTransactionNumber": 0 }, "emailStats": { "averageOr": "-", "uniqueOpens": 0, "allOpens": 0, "averageCtr": "-", "uniqueClicks": 0, "allCliks": 0, "averageCtor": "-", "optOut": "-", "contactsOptOut": 0, "sentMessages": 0, "messageToSend": 0, "failedMessages": 0, "spam": 0, "softBounces": 0, "hardBounces": 0 } } ``` ``` -------------------------------- ### Create Product Catalog Request Source: https://docs.salesmanago.com/v3 Use this JSON payload to create a new product catalog. Specify catalog name, default status, and currency. ```json { "catalogName": "Example.com Product Catalog", "setAsDefault": true, "currency": "USD", "location": "examplecom" } ``` -------------------------------- ### List Product Catalogs Request Source: https://docs.salesmanago.com/v3 This GET method retrieves a list of all product catalogs. No additional parameters are required for this request. ```json GET https://api.salesmanago.com/v3/product/catalogList ``` -------------------------------- ### Get Most Purchased Products Source: https://docs.salesmanago.com/ Retrieve a list of product IDs that have been most purchased. This method requires a `location` identifier to specify the data source. ```json { "clientId": "your-client-id-123", "apiKey": "salesmanago", "requestTime": 1481543324302, "sha": "02bfe70541d3907cf487f26dc2665b184b1221a7", "location": "dataSource" } ``` ```json { "message" : [ ], "success" : true, "productIds" : [ 6754, 6755 ] } ``` -------------------------------- ### Sample Response - Product IDs Source: https://docs.salesmanago.com/ A successful response containing an array of product IDs when 'includeProductData' is set to false. ```json { "success": true, "products": [ { "id": "P123", "urlAppendix": "utm_source=salesmanago&prod_id=3243454" }, { "id": "P456", "urlAppendix": "utm_source=salesmanago&prod_id=4324345" }, { "id": "P789", "urlAppendix": "utm_source=salesmanago&prod_id=9324354" }, { "id": "P987", "urlAppendix": "utm_source=salesmanago&prod_id=132436" } ], "problems": [] } ``` -------------------------------- ### Get URL of file with exported data Source: https://docs.salesmanago.com/ Obtain the URL for a file containing exported data. This is part of an asynchronous export process. ```APIDOC ## Get URL of file with exported data ### Description Retrieves the URL for a file containing exported data. This is typically used after initiating an asynchronous export. ### Method POST ### Endpoint `https://xxx.salesmanago.com/api/job/status` ### Parameters #### Request Body - **clientId** (string) - Required - Your client ID. - **apiKey** (string) - Required - Your API key. - **requestTime** (integer) - Required - Timestamp of the request. - **sha** (string) - Required - SHA hash for authentication. - **owner** (string) - Required - The email address of the data owner. - **requestId** (integer) - Required - The unique identifier for the export request. ### Request Example ```json { "clientId": "a1b2-...-c3d4", "apiKey": "e5f6-...-g7h8", "requestTime": 1659938888000, "sha": "2aa3-...-e00c", "owner": "salesmanago.user@yourcompany.com", "requestId": 1234567 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (array) - Additional information or error messages. May contain 'Job not start yet' before completion. - **fileUrl** (string) - The URL of the exported file. Only present when the export is completed. #### Response Example (Before Completion) ```json { "success": true, "message": [ "Job not start yet" ] } ``` #### Response Example (After Completion) ```json { "success": true, "message": [], "fileUrl": "https://storage.googleapis.com/sm-file/a1b2-...-c3d4/1234-...-5678/abcd-...-efgh.json?GoogleAccessId=..." } ``` ``` -------------------------------- ### Sample Response for Similar Products Search Source: https://docs.salesmanago.com/v3 This response lists products identified as visually similar to the uploaded image, ordered by similarity score. ```json { "products": [ { "id": "P123", "score": 0.82, "urlAppendix": "utm_source=salesmanago&prod_id=3243454" }, { "id": "P456", "score": 0.81, "urlAppendix": "utm_source=salesmanago&prod_id=4324345" }, { "id": "P789", "score": 0.80, "urlAppendix": "utm_source=salesmanago&prod_id=9324354" }, { "id": "P987", "score": 0.77, "urlAppendix": "utm_source=salesmanago&prod_id=132436" } ], "problems": [] } ``` -------------------------------- ### Execute Product Recommendations Source: https://docs.salesmanago.com/frontend-sdk This method retrieves a list of recommended products. You can choose to receive either product IDs or full product data. Recommendations are based on strategies configured in the Recommendation Architect and can be personalized or generic. ```APIDOC ## SMApi.execute('recommendation') ### Description Retrieves a list of recommended products based on a configured strategy. The response can contain product IDs or detailed product data. ### Method `execute` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const recommendationData = { "strategyId": "21c2-...-3266", "productIds": ["P123", "P456"], "includeProductData": false, "maxItems": 4 } SMApi.setAll(recommendationData ); SMApi.execute('recommendation').then((result) => { console.log(result); }); ``` ### Response #### Success Response When executed, the Frontend SDK returns a promise. A resolved promise contains the following response: **Response without product data:** ```json { "products": [ { "productId": "P123", "urlAppendix": "utm_source=salesmanago&prod_id=3243454" }, { "productId": "P456", "urlAppendix": "utm_source=salesmanago&prod_id=4324345" }, { "productId": "P789", "urlAppendix": "utm_source=salesmanago&prod_id=9324354" }, { "productId": "P987", "urlAppendix": "utm_source=salesmanago&prod_id=132436" } ], "requestId": "e29ad8ad-3d80-4bcb-92bb-3a3b11960445", "finalResponse": true } ``` **Response with product data (limited to 2 products):** ```json { "success": true, "productIds": ["P123", "P234"], "productData": [ { "productId": "P123", "urlAppendix": "utm_source=salesmanago&prod_id=4324345", "name": "White t-shirt", "mainCategory": "t-shirts", "categories": [ "Winter collection", "Linen products" ], "description": "Classic t-shirt with...", "productUrl": "https://example.com/shop/t-shirts/white-t-shirt", "mainImageUrl": "https://example.com/media/white-t-shirt-cover.jpg", "available": true, "quantity": 90, "price": 29.99, "discountPrice": 19.99, "systemDetails": { "brand": "My Brand", "manufacturer": "My Brand", "popularity": 40, "gender": 0, "season": "summer", "color": "white", "bestseller": true, "newProduct": false }, "customDetails": { "detail1": "linen", "detail2": "short" } }, { "productId": "P234", "urlAppendix": "utm_source=salesmanago&prod_id=8765421", "name": "White t-shirt", "mainCategory": "t-shirts", "categories": [ "Winter collection", "Linen products" ], "description": "Classic t-shirt with...", "productUrl": "https://example.com/shop/t-shirts/white-t-shirt", "mainImageUrl": "https://example.com/media/white-t-shirt-cover.jpg", "available": true, "active": true, "quantity": 90, "price": 29.99, "discountPrice": 19.99, "systemDetails": { "brand": "My Brand", "manufacturer": "My Brand", "popularity": 40, "gender": 0, "season": "summer", "color": "white", "bestseller": true, "newProduct": false }, "customDetails": { "detail1": "linen", "detail2": "short" } } ] } ``` #### Error Response Details not provided in the source. ``` -------------------------------- ### Get Conversation Statistics Source: https://docs.salesmanago.com/ Retrieves statistics for a specific messaging conversation, including sent, delivered, undelivered, and clicked counts per channel. ```APIDOC ## GET /api/messaging/conversationStats ### Description Fetches statistics for a given messaging conversation. ### Method GET ### Endpoint `https://xxx.salesmanago.com/api/messaging/conversationStats` ### Parameters #### Query Parameters - **conversationId** (integer) - Required - Messaging conversation ID. - **channel** (string) - Optional - Channel type to filter statistics. Allowed values: SMS, VIBER, WHATS_APP, ALL. Defaults to ALL. - **source** (string) - Optional - Messaging source type to filter statistics. Allowed values: BIRTHDAY, MASS, RULE, WORKFLOW, TEST, ALERT, RFM, ALL. Defaults to ALL. ### Request Example ```json { "clientId": "a1b2-...-c3d4", "apiKey": "e5f6-...-g7h8", "requestTime": 1659938888000, "sha": "2aa3-...-e00c" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (array) - Array of additional information for error identification. - **conversationId** (integer) - The ID of the conversation. - **sentDate** (long) - The date the message was sent as a UNIX timestamp in milliseconds. - **user** (string) - The SALESmanago user to whom the conversation is assigned. - **name** (string) - The name of the message visible in SALESmanago. - **textContent** (string) - The content of the sent message. - **[channel]** (object) - Object containing statistics for a specific channel (e.g., SMS, VIBER, WHATS_APP). - **cancelled** (boolean) - Indicates whether the messaging was canceled in the given channel. - **sent** (integer) - Number of sent messages in the given channel. - **delivered** (integer) - Number of delivered messages in the given channel. - **undelivered** (integer) - Number of undelivered messages in the channel. - **clicked** (integer) - Number of clicked messages in the channel. #### Response Example ```json { "success": true, "message": [], "conversationId": 9876543, "sentDate": 1659938888000, "user": "salesmanago.user@example.com", "name": "Spring Campaign", "textContent": "Spring is here! Refresh your wardrobe with –20% on new arrivals. Shop now: https://example.com", "statistics": { "SMS": { "cancelled": false, "sent": 1200, "delivered": 1150, "undelivered": 50, "clicked": 800 }, "VIBER": { "cancelled": false, "sent": 1200, "delivered": 1150, "undelivered": 50, "clicked": 800 } } } ``` ``` -------------------------------- ### Downloading the list of Workflow 2.0 Source: https://docs.salesmanago.com/ Download the list of Workflow 2.0 configurations. This method requires authentication details and a timestamp. ```APIDOC ## Downloading the list of Workflow 2.0 ### Description Downloads the list of available Workflow 2.0 configurations. ### Method POST ### Endpoint `https://xxx.salesmanago.com/api/workflow/list` ### Request Body - **clientId** (string) - Required - Your client ID. - **apiKey** (string) - Required - Your API key. - **requestTime** (integer) - Required - Timestamp of the request. - **sha** (string) - Required - SHA hash for authentication. ### Request Example ```json { "clientId" : "your-client-id-123", "apiKey" : "your-api-key-123", "requestTime" : 1234567896541, "sha" : "4f69782e826841f794080cae87648e42" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (array) - Additional information or error messages. - **workflows** (array) - A list of workflow objects. - **id** (integer) - The unique identifier of the workflow. - **name** (string) - The name of the workflow. #### Response Example ```json { "success": true, "message": [], "workflows": [ { "id": 1000001, "name": "workflow 1" }, { "id": 1000002, "name": "workflow 2" } ] } ``` ``` -------------------------------- ### Getting list of user accounts for a client Source: https://docs.salesmanago.com/ Retrieve a list of user accounts associated with a specific client. This method requires authentication details and a timestamp. ```APIDOC ## Getting list of user accounts for a client ### Description Retrieves a list of user accounts for a given client. ### Method POST ### Endpoint `https://xxx.salesmanago.com/api/user/listByClient` ### Request Body - **clientId** (string) - Required - Your client ID. - **apiKey** (string) - Required - Your API key. - **requestTime** (integer) - Required - Timestamp of the request. - **sha** (string) - Required - SHA hash for authentication. ### Request Example ```json { "clientId": "your-api-key-123", "apiKey": "your-client-id-123", "requestTime": 1234567896541, "sha": "4f69782e826841f794080cae87648e42" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (array) - Additional information or error messages. - **users** (array) - A list of user email addresses. #### Response Example ```json { "success": true, "message": [], "users": [ "admin@vendor.pl", "test@test.pl" ] } ``` ``` -------------------------------- ### Sample Response - Product Details Source: https://docs.salesmanago.com/ A response including detailed product information when 'includeProductData' is true. The response may limit the number of products returned. ```json { "success": true, "productIds": ["P123", "P234"], "productData": [ { "productId": "P123", "urlAppendix": "utm_source=salesmanago&prod_id=4324345", "name": "White t-shirt", "mainCategory": "t-shirts", "categories": [ "Winter collection", "Linen products" ], "description": "Classic t-shirt with...", "productUrl": "https://example.com/shop/t-shirts/white-t-shirt", "mainImageUrl": "https://example.com/media/white-t-shirt-cover.jpg", "available": true, "quantity": 90, "price": 29.99, "discountPrice": 19.99, "systemDetails": { "brand": "My Brand", "manufacturer": "My Brand", "popularity": 40, "gender": 0, "season": "summer", "color": "white", "bestseller": true, "newProduct": false }, "customDetails": { "detail1": "linen", "detail2": "short" } }, { "productId": "P234", "urlAppendix": "utm_source=salesmanago&prod_id=8765421", "name": "White t-shirt", "mainCategory": "t-shirts", "categories": [ "Winter collection", "Linen products" ], "description": "Classic t-shirt with...", "productUrl": "https://example.com/shop/t-shirts/white-t-shirt", "mainImageUrl": "https://example.com/media/white-t-shirt-cover.jpg", "available": true, "active": true, "quantity": 90, "price": 29.99, "discountPrice": 19.99, "systemDetails": { "brand": "My Brand", "manufacturer": "My Brand", "popularity": 40, "gender": 0, "season": "summer", "color": "white", "bestseller": true, "newProduct": false }, "customDetails": { "detail1": "linen", "detail2": "short" } } ] } ``` -------------------------------- ### Create Product Collection - Request Source: https://docs.salesmanago.com/v3 Use this endpoint to create a new Product Collection. Associate it with a specific Product Catalog by providing its UUID. The response includes the new collection's UUID. ```json { "name": "Wishlist", "catalogId": "21c2-...-3266" } ``` -------------------------------- ### Get Contact Count in Funnel/Stage Source: https://docs.salesmanago.com/ Retrieves the number of contacts within a specified funnel or stage. If the stage is not provided, it returns the total count for the funnel. ```APIDOC ## Get Contact Count in Funnel/Stage ### Description Retrieves the number of contacts within a specified funnel or stage. If the stage is not provided, it returns the total count for the funnel. ### Method POST ### Endpoint `https://xxx.salesmanago.com/api/funnel/count` ### Parameters #### Request Body - **clientId** (string) - Required - user id - **apiKey** (string) - Required - API key - **requestTime** (integer) - Required - time the request was made (ms) - **sha** (string) - Required - generated sha - **owner** (string) - Required - user email - **funnel** (string) - Required - name of funnel - **stage** (string) - Optional - name of stage. When empty, the method returns the number of contacts across the funnel. When provided, it returns the number in the selected step. ### Request Example ```json { "clientId": "clientId", "apiKey": "apiKey", "requestTime": 1234567896541, "sha": "4f69782e826841f794080cae87648e42", "owner": "owner@mail.com", "funnel": "funnel_name", "stage": "stage name" } ``` ### Response #### Success Response (200) - **success** (boolean) - boolean value informing about the result of request (successful/not successful) - **message** (array) - array of additional information - **count** (integer) - number of contacts in the funnel/stage #### Response Example ```json { "success": true, "message": [], "count": 123 } ``` ``` -------------------------------- ### Sample Product Catalog Response Source: https://docs.salesmanago.com/v3 This JSON object represents a successful response when retrieving product catalog information. It includes details about available catalogs and account limits. ```json { "catalogs": [ { "catalogId": "21c2-...-3266", "name": "Example.com Product Catalog", "setAsDefault": false, "currency": "USD", "location": "examplecom" }, { "catalogId": "a2d4-...-f0e3", "name": "Online Store Catalog", "setAsDefault": true, "currency": "EUR", "location": "myonlinestore" } ], "limits": { "max": 3 } } ```