Updating NeoStore Passes from an Adobe Campaign Custom Activity
For marketing managers using Adobe Campaign, automating updates to external systems like NeoStore can enhance your campaigns by providing personalized offers to customers. This guide will walk you through creating a custom activity in Adobe Campaign Classic to update NeoStore passes via their API. The target audience is power users comfortable with workflows but not necessarily coding experts.
Why Integrate Adobe Campaign with NeoStore?
Imagine you want to send an exclusive offer to your most loyal customers and update their NeoStore passes dynamically during a campaign. With a custom activity in Adobe Campaign, this can be seamlessly automated, ensuring timely and personalized customer engagement.
Steps to Update NeoStore Passes
Follow these steps to configure and execute the integration.
1. Understand the API Call
The NeoStore API expects a PATCH
request in the following format:
curl -X 'PATCH' \
'https://app-qa.neostore.cloud/api/xxxxx/passes?id.y2.customerId=00100000207298' \
-H 'accept: */*' \
-H 'X-API-KEY: xyz' \
-H 'Content-Type: application/json' \
-d '{
"additionalData": {
"adobe_message": "Exclusive offer for you, come visit us!"
}
}'
This updates a customer’s pass with additional data, including a personalized message. You’ll replicate this API call from Adobe Campaign for multiple customers.
2. Set Up Your Adobe Campaign Workflow
Create a workflow to handle the customer selection and API updates.
Key Steps in the Workflow
-
Query Activity:
- Use a query activity to select the target customers from your Adobe Campaign database.
- Filter customers based on criteria like loyalty tier, purchase history, or campaign engagement.
-
JavaScript Activity:
- Add a JavaScript activity to handle the API calls for each customer.
3. Write the JavaScript Code
The JavaScript activity will make the NeoStore API calls. Below is the complete script tailored for marketing managers:
JavaScript Code
// NeoStore API configuration
var apiUrl = "https://app-qa.neostore.cloud/api/xxxxx/passes";
var apiKey = "xyz"; // Replace with your API key
// Fetch the list of customers from the workflow context
var query = xtk.queryDef.create();
query.select("customerId") // Replace with the correct customer ID field
.from("customerTable"); // Replace with your database table
var customers = query.executeQuery(); // Execute query
// Loop through each customer and make the API call
for (var i = 0; i < customers.length; i++) {
var customerId = customers[i].customerId;
// Construct the API endpoint URL
var url = apiUrl + "?id.y2.customerId=" + encodeURIComponent(customerId);
// Define the payload for the API request
var payload = {
additionalData: {
adobe_message: "Exclusive offer for you, come visit us!"
}
};
try {
// Execute the API call
var response = http.request({
method: "PATCH",
url: url,
headers: {
"X-API-KEY": apiKey,
"Content-Type": "application/json",
"accept": "*/*"
},
body: JSON.stringify(payload)
});
// Log success for debugging
logInfo("Customer ID " + customerId + ": Update successful. Status: " + response.statusCode);
} catch (error) {
// Handle and log errors
logError("Customer ID " + customerId + ": Update failed. Error: " + error.message);
}
}
4. Save and Execute the Workflow
- Save the workflow and test it with a small batch of customers.
- Monitor the execution logs to verify that the API calls are successful.
- Confirm that the passes in NeoStore are updated with the new data.
Best Practices
- Test in a QA Environment: Always test API integrations in a staging or QA environment before production.
- Handle Errors Gracefully: Log errors and implement retries for failed API calls.
- Rate Limiting: If NeoStore enforces rate limits, introduce delays between API calls to avoid throttling.
- Secure API Keys: Store sensitive API keys securely in Adobe Campaign.
Conclusion
By leveraging a custom JavaScript activity in Adobe Campaign, you can seamlessly update NeoStore passes for personalized marketing campaigns. This integration not only saves time but also ensures your customers receive relevant offers at the right moment.
Ready to delight your customers with exclusive updates? Build your workflow today! 🎉
Feel free to reach out with questions or to share your success stories about integrating Adobe Campaign with NeoStore.