Universal Search Connector allows you to optimize the system and automate indexing of your products.
Here you can find an overview of the universal search connector in Emporix, along with its features and benefits.
With the Emporix universal search connector, it is possible to gather all events happening in the system and set up automated actions that will ensue in relation to those events. Every time an object is created, updated, or deleted, the events are being indexed and sent to the Webhook Service. The webhook events are further sent out to the Svix application, which in turn updates the search engine database of your choice. The actions, as configured in Svix, can be executed in various third-party applications, as the solution is universal and widely applicable.
The indexing process consists of the following sequence of events:
When a product-related event takes place, it is processed by CE.
The event is consumed by a messaging system and undergoes indexing.
An indexing message is sent to the Webhook Service.
The indexing messages are sent in an asynchronous way. The indexing service searches for changes every two minutes to gather all related events and send them in one collective message, for example when you update the price, availability, and delivery methods of a particular product. This may result in a delay in message delivery.
The Webhook Service forwards the message to the Svix Event Gateway.
The Event Gateway passes the event to your pre-configured endpoint for this particular event, and updates the search engine database of your choice.
For example, if a price is updated in the Emporix environment, an indexed message is sent to the Webhook Service. In Management Dashboard, if you enabled actions for index item updates and/or deletions, the events are passed further to the Svix Event Gateway. If an endpoint for the update/delete actions was configured in Svix, all relevant actions are executed in the third-party search engines that your system is integrated with.
Universal search engine integration solution
This feature is designed to be universal in order to fit your business' needs. You can use various search engines, such as Algolia, clerk.io, constructor.io, and others.
Product-related events
All product-related events, such as price updates, product deletions, and others, trigger the indexing service that sends events to Svix.
Management Dashboard navigation
The configuration and management of the indexing feature is handled through the Emporix Management Dashboard.
Webhooks integration
Thanks to the integration with the Webhook Service, the product-related events are automatically sent out to other integrated third party applications.
Event Gateway
In the Svix application, the event gateway serves as an intermediary between Emporix services and search engines.
Good search possibility is a key to achieving sales targets.
With Emporix, you get additional ways to enhance search functionality. Check out these resources:
Configure search indexer to bring great searching experience on your storefront.
The Indexing Service is designed to help you configure the search index in your Emporix instance.
The Indexing Service is responsible for including all your resources, such as products, or categories, in the search index and make them searchable on your storefront. You have to enable your own indexing service on Emporix by providing your credentials for the index provider into CE platform. Currently, the supported index provider is Algolia. For more information how you can configure search, see Search Configuration.
The Indexing Service gives you the possibility to provide your own API keys to the indexing provider, separately for each tenant. This approach gives you more flexibility in configuration.
There are two groups of endpoints in the Indexing Service:
Secured endpoints - that require a security scope and serve managing configuration.
Example response:
Public endpoints - that do not require any security scopes and they can be used directly on a storefront. The public endpoints do not return a writeKey, but a searchKey only.
Even though the public endpoints do not require any scopes, an authorization token is required to complete the request.
Be aware that changing configuration for indexing provider isn't enough to apply your changes in the index. Usually, the indexing process of your data is triggered by changes done on your products, or dependant entities, such as category, price, media etc. There is a scheduler job that discovers the delta changes on the resource data and starts reindexing of the updated instances, so that they are searchable on the storefront.
Applying the changes done to the search index configuration require updating all existing product data. To avoid updating all the data, there is a reindexing mechanism available. So, if you change the index configuration, remember to reindex all your product data by using the reindex endpoint.
As Emporix is a multi-site solution, data on each site may differ, such as availability or price. Therefore, site-aware data must be included in the index. The Indexing Service provides two index strategies:
MERGE: the default strategy. The strategy creates just a single index that contains information from all the sites. The site-aware information is stored in sitePrices and siteAvailabilities properties. These properties are maps where a key corresponds to a site code and a value corresponds to the price or availability object respectively. This approach is more performant as you have only one index.
SPLIT: an alternative strategy. The strategy creates as many indices as the number of sites declared in the system. The index item does not contain sitePrices and siteAvailabilities fields. All the site-aware fields are available on the root level. This approach may be more flexible as a particular index contains only information related to one site. But, the fields that are not site-aware, like description, name etc are duplicated across all the indices. The number of indices is significantly higher.
Changing the index strategy can be done in the following ways:
System Preferences of the Emporix Management Dashboard: see the .
API request to the Configuration Service
(If there is an already existing configuration for your tenant, send PUT request to update configuration. If there is no configuration yet, first send the POST request to create one. If there is no configuration, the MERGE strategy is used by default.)
Please remain patient as propagating changes to the index strategy may take up to 1 hour, so you might not be able to see the changes instantly.
{
"active": true,
"searchKey": "84dc4886f81f805c42bdd89d64de751a",
"applicationId": "8AP2HABA2I",
"indexName": "exampleTenant",
"provider": "ALGOLIA",
"writeKey": "51ebe89215dddcf85e5dacd5643d17e7"
} Example response:
```
{
"active": true,
"searchKey": "84dc4886f81f805c42bdd89d64de751a",
"applicationId": "8AP2HABA2I",
"indexName": "exampleTenant",
"provider": "ALGOLIA"
}
```{
"name": [
"Banana"
],
"localizedName": {
"en": "Banana"
},
"categories": [
"Food"
],
"popularity": 0,
"prices": [
{
"id": "659bd4e09862ec2ec136a61b",
"itemId": {
"itemType": "PRODUCT",
"id": "659bd4bfb9ce7a0b975c33eb",
"name": {
"en": "Banana"
}
},
"currency": "EUR",
"originalAmount": 1.99,
"effectiveAmount": 1.99,
"location": {
"countryCode": "DE"
},
"priceModelId": "63402c86af907617bb4e1234",
"priceModel": {
"id": "63402c86af907617bb4e1234",
"name": {
"en": "Default price model"
},
"description": {
"en": "Default price model"
},
"includesTax": false,
"measurementUnit": {
"quantity": 1,
"unitCode": "pc"
},
"tierDefinition": {
"tierType": "BASIC",
"tiers": [
{
"minQuantity": {
"quantity": 0,
"unitCode": "pc"
},
"id": "63402c86af907617bb4e9826"
}
]
}
},
"restrictions": {
"validity": null,
"siteCodes": [
"main"
]
},
"tierValues": [
{
"id": "63402c86af907617bb4e9826",
"priceValue": 1.99
}
],
"siteCode": "main"
}
],
"description": [
"Banana"
],
"localizedDescription": {
"en": "Banana"
},
"image": "http://res.cloudinary.com/saas-ag/image/upload/v1704711465/lspaymentstage/media/659bd5286bec48360e3b3a83.jpg",
"code": "Banana",
"categoriesMissing": false,
"available": false,
"distributionChannel": [
"ASSORTMENT"
],
"sitePrices": {
"DE": [
{
"id": "659bd4f29862ec2ec136a61c",
"itemId": {
"itemType": "PRODUCT",
"id": "659bd4bfb9ce7a0b975c33eb",
"name": {
"en": "Banana"
}
},
"currency": "EUR",
"originalAmount": 2.49,
"effectiveAmount": 2.49,
"location": {
"countryCode": "DE"
},
"priceModelId": "63402c86af907617bb4e1234",
"priceModel": {
"id": "63402c86af907617bb4e1234",
"name": {
"en": "Default price model"
},
"description": {
"en": "Default price model"
},
"includesTax": false,
"measurementUnit": {
"quantity": 1,
"unitCode": "pc"
},
"tierDefinition": {
"tierType": "BASIC",
"tiers": [
{
"minQuantity": {
"quantity": 0,
"unitCode": "pc"
},
"id": "63402c86af907617bb4e9826"
}
]
}
},
"restrictions": {
"validity": null,
"siteCodes": [
"DE",
"FR"
]
},
"tierValues": [
{
"id": "63402c86af907617bb4e9826",
"priceValue": 2.49
}
],
"siteCode": "DE"
}
],
"main": [
{
"id": "659bd4e09862ec2ec136a61b",
"itemId": {
"itemType": "PRODUCT",
"id": "659bd4bfb9ce7a0b975c33eb",
"name": {
"en": "Banana"
}
},
"currency": "EUR",
"originalAmount": 1.99,
"effectiveAmount": 1.99,
"location": {
"countryCode": "DE"
},
"priceModelId": "63402c86af907617bb4e1234",
"priceModel": {
"id": "63402c86af907617bb4e1234",
"name": {
"en": "Default price model"
},
"description": {
"en": "Default price model"
},
"includesTax": false,
"measurementUnit": {
"quantity": 1,
"unitCode": "pc"
},
"tierDefinition": {
"tierType": "BASIC",
"tiers": [
{
"minQuantity": {
"quantity": 0,
"unitCode": "pc"
},
"id": "63402c86af907617bb4e9826"
}
]
}
},
"restrictions": {
"validity": null,
"siteCodes": [
"main"
]
},
"tierValues": [
{
"id": "63402c86af907617bb4e9826",
"priceValue": 1.99
}
],
"siteCode": "main"
}
],
"FR": [
{
"id": "659bd4f29862ec2ec136a61c",
"itemId": {
"itemType": "PRODUCT",
"id": "659bd4bfb9ce7a0b975c33eb",
"name": {
"en": "Banana"
}
},
"currency": "EUR",
"originalAmount": 2.49,
"effectiveAmount": 2.49,
"location": {
"countryCode": "DE"
},
"priceModelId": "63402c86af907617bb4e1234",
"priceModel": {
"id": "63402c86af907617bb4e1234",
"name": {
"en": "Default price model"
},
"description": {
"en": "Default price model"
},
"includesTax": false,
"measurementUnit": {
"quantity": 1,
"unitCode": "pc"
},
"tierDefinition": {
"tierType": "BASIC",
"tiers": [
{
"minQuantity": {
"quantity": 0,
"unitCode": "pc"
},
"id": "63402c86af907617bb4e9826"
}
]
}
},
"restrictions": {
"validity": null,
"siteCodes": [
"DE",
"FR"
]
},
"tierValues": [
{
"id": "63402c86af907617bb4e9826",
"priceValue": 2.49
}
],
"siteCode": "FR"
}
]
},
"siteAvailabilities": {
"DE": {
"id": "DE:659bd4bfb9ce7a0b975c33eb",
"stockLevel": 700,
"productId": "659bd4bfb9ce7a0b975c33eb",
"site": "DE",
"available": false,
"popularity": 0,
"distributionChannel": "ASSORTMENT"
},
"main": {
"id": "main:659bd4bfb9ce7a0b975c33eb",
"stockLevel": 999,
"productId": "659bd4bfb9ce7a0b975c33eb",
"site": "main",
"available": false,
"popularity": 0,
"distributionChannel": "ASSORTMENT"
},
"FR": {
"id": "FR:659bd4bfb9ce7a0b975c33eb",
"stockLevel": 50,
"productId": "659bd4bfb9ce7a0b975c33eb",
"site": "FR",
"available": false,
"popularity": 0,
"distributionChannel": "ASSORTMENT"
}
},
"category_assignments": [
{
"id": "2918ddc4-0c1c-4977-bb91-a4c366c535a6",
"name": "Food",
"localizedName": {
"en": "Food"
},
"code": "food",
"localizedSlug": {
"en": "food"
},
"parent": null
}
],
"category_levels": {
"level0": [
"Food"
]
},
"_tags": [
"product",
"published"
],
"category_ids": [
"2918ddc4-0c1c-4977-bb91-a4c366c535a6"
],
"objectID": "urn:yaas:saasag:caasproduct:product:lspaymentstage;659bd4bfb9ce7a0b975c33eb"
} {
"name": [
"Banana"
],
"localizedName": {
"en": "Banana"
},
"categories": [
"Food"
],
"popularity": 0,
"prices": [
{
"id": "659bd4e09862ec2ec136a61b",
"itemId": {
"itemType": "PRODUCT",
"id": "659bd4bfb9ce7a0b975c33eb",
"name": {
"en": "Banana"
}
},
"currency": "EUR",
"originalAmount": 1.99,
"effectiveAmount": 1.99,
"location": {
"countryCode": "DE"
},
"priceModelId": "63402c86af907617bb4e1234",
"priceModel": {
"id": "63402c86af907617bb4e1234",
"name": {
"en": "Default price model"
},
"description": {
"en": "Default price model"
},
"includesTax": false,
"measurementUnit": {
"quantity": 1,
"unitCode": "pc"
},
"tierDefinition": {
"tierType": "BASIC",
"tiers": [
{
"minQuantity": {
"quantity": 0,
"unitCode": "pc"
},
"id": "63402c86af907617bb4e9826"
}
]
}
},
"restrictions": {
"validity": null,
"siteCodes": [
"main"
]
},
"tierValues": [
{
"id": "63402c86af907617bb4e9826",
"priceValue": 1.99
}
],
"siteCode": "main"
}
],
"description": [
"Banana "
],
"localizedDescription": {
"en": "Banana "
},
"image": "http://res.cloudinary.com/saas-ag/image/upload/v1704711465/lspaymentstage/media/659bd5286bec48360e3b3a83",
"code": "Banana",
"categoriesMissing": false,
"available": false,
"distributionChannel": [
"ASSORTMENT"
],
"category_assignments": [
{
"id": "2918ddc4-0c1c-4977-bb91-a4c366c535a6",
"name": "Food",
"localizedName": {
"en": "Food"
},
"code": "food",
"localizedSlug": {
"en": "food"
},
"parent": null
}
],
"category_levels": {
"level0": [
"Food"
]
},
"_tags": [
"product",
"published"
],
"category_ids": [
"2918ddc4-0c1c-4977-bb91-a4c366c535a6"
],
"objectID": "urn:yaas:saasag:caasproduct:product:TENANT;659bd4bfb9ce7a0b975c33eb"
}
curl --location --request PUT 'https://api.emporix.io/configuration/{TENANT}/configurations/indexing_siteAwareFieldsStrategy' \
--header 'authorization: Bearer {TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "indexing_siteAwareFieldsStrategy",
"value": {
"strategy": "MERGE"
}
}'
curl --location --request PUT 'https://api.emporix.io/configuration/{TENANT}/configurations/indexing_siteAwareFieldsStrategy' \
--header 'authorization: Bearer {TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "indexing_siteAwareFieldsStrategy",
"value": {
"strategy": "SPLIT"
}
}'
Learn the possibilities for configuring search in Emporix.
You can integrate the Emporix Commerce Engine with any index providers by leveraging the webhook events concept. Emporix CE recognizes all changes around a product item like the product itself, its price, category or availability related to the product. If any of the connected entities is modified, our platform prepares an index-item object which contains all the necessary data.
Log in to the Management Dashboard and go to Administration -> Webhooks.
Choose the webhooks strategy that best suits your needs.
Extend the Index item webhook details and enable the Index item updated and the Index item deleted events.
Depending on the chosen webhook strategy, there are different ways to configure the endpoints for receiving notifications about events happening in the system. Configure your strategy to be able to process the events.
Commerce Engine allows you to configure your own search functionality. You can choose any provider that suits your needs. For demonstration purposes of how you can configure search through the webhooks functionality, we present examples of configuring Algolia and BatteryIncluded. These are the search engines that can be configured to work with Emporix CE and Svix.
Before you start configuring a search engine in Emporix, ensure the following:
Enable the Index item updated and Index item deleted events are enabled in Management Dashboard, see .
Activate Algolia or BatteryIncluded account.
Initial steps
Log in to the Management Dashboard and go to Administration -> Webhooks.
Go to Svix by choosing the Open Svix Dashboard button.
To start the endpoint configuration, go to Endpoints.
Follow the steps for one of the providers: Algolia or BatteryIncluded.
Creating and updating products
In Endpoints, choose Add Endpoint and fill in the fields with the following values:
Endpoint URL - https://{ALGOLIA_APPLICATION_ID}.algolia.net/1/indexes - provide your Algolia application ID
Description - Algolia Create/Update
Message filtering - select only the index-item.updated event
Choose Create and check if your configuration was properly saved.
Go to the Advanced tab, provide the required custom headers and enable the transformation feature:
Key: X-Algolia-API-Key
Value: YOUR_ALGOLIA_ADMIN_API_KEY
Find the right values for your keys in your application settings (API Keys) in your Algolia account.
In the Transformations section, set the transformation feature to enabled.
In Edit transformation, start working on the Algolia mapping.
Since there are differences between the default mapping in Svix and Algolia requirements, we need to adjust the mapping to make it work properly.
The default mapping available in Svix is as follows:
According to Algolia API Reference, the request that should be sent is as follows:
To learn more about Algolia API, see .
In the Edit transformation section, change the code to create the right mapping: a. Change the http method:
b. Modify the target URL:
c. Optional: Modify the message body. For example, you can add additional field like image based on media field:
Choose Run test for the index-item.updated payload. As a result, you can see your transformed output.
If the output is correct, save your changes.
To test the configuration, create a product in Management Dashboard and after a few minutes check if it appears in your index in the Algolia account. With this configuration, every time when a product is created or updated, the appropriate event is propagated to Svix, transformed and sent to Algolia.
Deleting products
In Endpoints, choose the Add Endpoint. Fill in the fields with the following values:
Endpoint URL - https://{ALGOLIA_APPLICATION_ID}.algolia.net/1/indexes - provide your Algolia application ID
Description - Algolia Delete
Message filtering - select only the index-item.deleted event
Choose Create and check if your configuration was properly saved.
Go to the Advanced tab, provide the required custom headers and enable the transformation feature:
Key: X-Algolia-API-Key
Value: YOUR_ALGOLIA_ADMIN_API_KEY
Find the right values for your keys in your application settings (API Keys) in your Algolia account.
In the Transformations section, set the transformation feature to enabled.
According to Algolia API Reference, the request that should be sent is as follows:
To learn more about Algolia API, see .
In the Edit transformation section, change the code to create the right mapping: a. Change the http method:
b. Change the target URL:
c. If the output is correct, save your changes.
To test the configuration, delete a product in Management Dashboard and after a few minutes check if it was deleted in your index in the Algolia account. With this configuration, every time when a product gets deleted, the appropriate event is propagated to Svix, transformed and then sent to Algolia.
Creating and updating products
In Endpoints, choose Add Endpoint. Fill in the fields with the following values:
Endpoint URL - https://api.batteryincluded.io/api/v1/collections/{BATTERY_INCLUDED_TENANT}/documents/import
Description - BatteryIncluded Create/Update
Message filtering - select only the index-item.updated event
Replace the {BATTERY_INCLUDED_TENANT} with the value from the URL address in the BatteryIncluded Portal. For example, if the URL looks like this https://portal.batteryincluded.io/#/discover/customer.emporix, the {BATTERY_INCLUDED_TENANT} value is customer.emporix.
Choose Create and check if your configuration was properly saved.
Go to the Advanced tab, provide the required custom headers:
Key: X-BI-API-KEY Value: Your private integration key
Find the right values for your keys in your connection settings in your BatteryIncluded account.
To test the configuration, create a product in Management Dashboard and after a few minutes check if it appears in your index in the BatteryIncluded account. With this configuration, every time when a product is created or updated, the appropriate event is propagated to Svix, transformed and then sent to BatteryIncluded.
Deleting products
In Endpoints, choose Add Endpoint. Fill in the fields with the following values:
Endpoint URL - https://api.batteryincluded.io/api/v1/collections/{BATTERY_INCLUDED_TENANT}/documents/delete
Description - BatteryIncluded Delete
Message filtering - select only the index-item.deleted event
Replace the {BATTERY_INCLUDED_TENANT} with the value from the URL address in the BatteryIncluded Portal. For example, if the URL looks like this https://portal.batteryincluded.io/#/discover/customer.emporix, the {BATTERY_INCLUDED_TENANT} value is customer.emporix.
Choose Create and check if your configuration was properly saved.
Go to the Advanced tab, provide the required custom headers and enable the transformation feature:
Key: X-BI-API-KEY Value: Your private integration key
If the output is correct, save your changes.
To test the configuration, delete a product in Management Dashboard and after a few minutes check if it was deleted in your index in the BatteryIncluded account. With this configuration, every time when a product is deleted, the appropriate event is propagated to Svix, transformed and then sent to BatteryIncluded.
In the Message Filtering section, choose the index-item events:
index-item.deleted
index-item.updated
Save your endpoint configuration by choosing the Create button.
You can test the configuration by going back to the Emporix Management Dashboard and adding a new product. After a few minutes, you should see the updated delivery statistics in Svix.
Key: X-Algolia-Application-Id
Value: YOUR_ALGOLIA_APPLICATION_ID
Key: X-Algolia-Application-Id
Value: YOUR_ALGOLIA_APPLICATION_ID
In the Edit transformation section, change the code to create the right mapping. Modify the HTTP method:








{
"availability": {
"available": false,
"distributionChannel": "ASSORTMENT",
"id": "main:643dacfad50d664c58694c2d",
"popularity": -2147483648,
"productId": "643dacfad50d664c58694c2d",
"site": "main",
"stockLevel": 2313
},
"available": false,
"categoryAssignments": [
{
"id": "79eccb8b-b163-4cb9-9528-ed9468b9f740",
"localizedName": {
"en": "c1"
},
"name": "c1"
}
],
"code": "Oranges",
"id": "643dacfad50d664c58694c2d",
"medias": [
{
"contentType": "image/jpeg",
"customAttributes": {
"height": 800,
"name": "oranges.jpeg",
"sizeKB": 156.7138671875,
"width": 1200
},
"mainImage": false,
"url": "http://res.cloudinary.com/saas-ag/image/upload/v1681763617/lsindexdbstage/media/643dad208fc03d22f4e857e6"
}
],
"popularity": -2147483648,
"prices": [
{
"currency": "EUR",
"effectiveAmount": 1.55,
"id": "643dad10c0dc2925289a6206",
"itemId": {
"id": "643dacfad50d664c58694c2d",
"itemType": "PRODUCT",
"name": {
"en": "Oranges"
}
},
"location": {
"countryCode": "DE"
},
"originalAmount": 1.55,
"priceModel": {
"description": {
"en": "Default price model"
},
"id": "63402c86af907617bb4e1234",
"includesTax": false,
"measurementUnit": {
"quantity": 1,
"unitCode": "pc"
},
"name": {
"en": "Default price model"
},
"tierDefinition": {
"tierType": "BASIC",
"tiers": [
{
"id": "63402c86af907617bb4e9826",
"minQuantity": {
"quantity": 0,
"unitCode": "pc"
}
}
]
}
},
"priceModelId": "63402c86af907617bb4e1234",
"restrictions": {
"siteCodes": [
"main"
]
},
"siteCode": "main",
"tierValues": [
{
"id": "63402c86af907617bb4e9826",
"priceValue": 1.55
}
]
}
],
"published": true,
"siteCode": "main",
"tags": [
"product",
"published"
]
}
"id": "String",
"siteCode" : "String"
{
"id": "643dab38a9e0f24d6bda45ee",
"siteCode": "main"
}
/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param.webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param.webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
// modify the webhook object...
// and return it
return webhook
}curl "https://${APPLICATION_ID}.algolia.net/1/indexes/contacts/myID" \
-X PUT \
-H "X-Algolia-API-Key: ${API_KEY}" \
-H "X-Algolia-Application-Id: ${APPLICATION_ID}" \
-d '{
"name": "Betty Jane Mccamey",
"company": "Vita Foods Inc.",
"email": "[email protected]"
}'/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param.webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param.webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
webhook.method = "PUT";
return webhook
}/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param.webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param.webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
var indexName = "emporix_" + webhook.payload.siteCode;
webhook.url = webhook.url + "/" + indexName + "/" + webhook.payload.id;
webhook.method = "PUT";
return webhook
}
/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param.webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param.webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
if(webhook.payload.medias && webhook.payload.medias.length > 0) {
webhook.payload.image = webhook.payload.medias[0].url;
}
var indexName = "emporix_" + webhook.payload.siteCode;
webhook.url = webhook.url + "/" + indexName + "/" + webhook.payload.id;
webhook.method = "PUT";
return webhook
}curl -X DELETE \
-H "X-Algolia-API-Key: ${API_KEY}" \
-H "X-Algolia-Application-Id: ${APPLICATION_ID}" \
"https://${APPLICATION_ID}.algolia.net/1/indexes/contacts/myID"/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param.webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param.webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
webhook.method = "DELETE";
return webhook
}/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param.webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param.webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
var indexName = "emporix_" + webhook.payload.siteCode;
webhook.url = webhook.url + "/" + indexName + "/" + webhook.payload.id;
webhook.method = "DELETE";
return webhook
} /**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param.webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param.webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
// modify the webhook object...
// convert data
const playload = [webhook.payload.id]
webhook.method = "DELETE";
webhook.payload = playload
return webhook
}
