Ruby
Python
PHP
Java
Node.js
Go
.NET
Sendlane
Getting Credentials
Previously, the customer must have created and logged in with their sendlane account. To obtain the credentials, go to Account → API and create API Token.
Worflow
This solution uses a webhook to update custom fields of contact in Sendlane with recommendations. Adding the webhook before using the recommendations in any email or SMS is essential.
To store and insert the recommendations in Sendlane, Custom Fields will be used by item property and recommendation. For example, if you want to generate 2 recommendations with the title and image properties, the merge fields will look like: reco_1_title, reco_1_image, reco_2_title, reco_2_image.
The webhook must call the URL with a GET request:
- staging: https://us-central1-xminds-b2b-api-staging.cloudfunctions.net/sendlane_webhook_integration
- production: https://us-central1-xminds-b2b-api-prod.cloudfunctions.net/sendlane_webhook_integration
Query Parameters
- api-key (string): the token Base64 encodes the content <NAME>:<DB_ID>:<PASSWORD>.
- type (string): type of recommendation. The values allowed are profile_based, similar_items, precomputed_profile_based, precomputed_similar_items and profile_based_w_ctx_items.
- automation_id (string): id of workflow where the webhook is used. (parameter added by default for the webhook)
- list_id (string): list to which the contact belongs since it was called in the workflow. Necessary to update the contact in sandlane. (parameter added by default for the webhook)
- email (string): email of the contact. Necessary to update the contact in sandlane. (parameter added by default for the webhook)
- item_properties (list-of-string) (optional): names of the item properties that will be returned with the recommendations. By default, only the item_id of the recommendations is returned. Using the repeated parameter format (e.g. ...&item_properties=name&item_properties=price) or passing a single comma-separated list (e.g. ...&item_properties=name,price).
- custom_field_prefix (string) (optional): prefix of the custom field name. The format is <custom_field_prefix>_<reco_idx>_<item-property>. By default, the prefix is xminds.item.
- amt, scenario, filters, reranking, etc (optional): are all available, please refer to the endpoint documentations. More info in profile_based, similar_items, precomputed_profile_based, precomputed_similar_items and profile_based_w_ctx_items.
More documentation: https://git.crossingminds.org/b2b-api-integration/sendlane-webhook